Re: Need advice on how to debug

From: Robert Collins <robertc@dont-contact.us>
Date: Thu, 22 Jan 2004 15:04:07 +1100

On Thu, 2004-01-22 at 10:05, Henrik Nordstrom 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?

Not that I've used :[. There was a linux distro with stack-protection in
gcc IIRC. I asked a gcc hacker I know and was pointed at 'mudflap' as
'promising'.

Possibly valgrind or another profiler could give you some detail too.

Hope that helps.

Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Received on Wed Jan 21 2004 - 21:04:12 MST

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