Re: Need advice on how to debug

From: Andres Kroonmaa <andre@dont-contact.us>
Date: Thu, 22 Jan 2004 08:58:01 +0200

 If you know the function, then you can try create gdb script that
 after breaking at some line of the function enables hardware write
 breakpoint on stack section that should not be written, continue, and
 when reaching return, removes hw breakpoint.
 Just first thing that comes to mind..

On 22 Jan 2004, at 0:05, Henrik Nordstrom <hno@squid-cache.org> wrote:

> Hello fellow coders.
>
> I am in desperate need of some advice in how to debug a intermettent stack
> smashing problem.
>
> There is no problem detecting when this happens as Squid segfaults almost
> immediately (on return from the function which smashed the stack), just
> not where. As the stack is quite smashed a function return ends up at
> address 0 and there is no stack frames to follow..
>
> As the problem does not occur very frequently running with full debug
> enabled is not really feasible.
>
> I have tried using stackshield, but that tool is simply not yet mature or
> maintained and the current version has very many bugs, mostly due to very
> weak parser.. (needs to be rewritten). Attempted to build Squid with
> stackshield enabled (after fixing some obvious bugs in stackshield) but
> the resulting binary is not even a fully valid binary..
>
> Does any of you know about other tools which can be used to trap where the
> stack gets smashed?
>
> Regards
> Henrik
>

------------------------------------
 Andres Kroonmaa <andre@online.ee>
 CTO, Microlink Data AS
 Tel: 6501 731, Fax: 6501 725
 Pärnu mnt. 158, Tallinn
 11317 Estonia
Received on Thu Jan 22 2004 - 00:12:16 MST

This archive was generated by hypermail pre-2.1.9 : Sat Jan 31 2004 - 12:00:10 MST