On 23 Jan 2004, at 15:07, Henrik Nordstrom <hno@squid-cache.org> wrote:
> On Fri, 23 Jan 2004, Andres Kroonmaa wrote:
>
> > This works with 3.0 only. But for fun, I tried to extract latest probe
> > trace from a core I had. After some scripting, you'd get something like
> > this, which is intact even when stack is completely smashed.
>
> Cool.
>
> It would be quite interesting to add something like this in the SEGV
> handler of Squid-3.
Is it worth the effort? have core and with scripts its easier.
I think for more general approach, it would make sense to arrange ifdefed
code that creates some global ringbuffer, global counter, and debug() macros
to do something like: array[index++ & 0xff] = __FUNCTION__ besides other stuff.
This would leave more precise and verbose trace of last N^2 debug statements
that have been passed. After you identify the function that crashes, you
can take approach I suggested initially to catch the crash with gdb and
have full backtrace just before stack gets smashed.
------------------------------------
Andres Kroonmaa <andre@online.ee>
CTO, Microlink Data AS
Tel: 6501 731, Fax: 6501 725
Pärnu mnt. 158, Tallinn
11317 Estonia
Received on Fri Jan 23 2004 - 08:34:54 MST
This archive was generated by hypermail pre-2.1.9 : Sat Jan 31 2004 - 12:00:10 MST