kdb_backtrace 'feature'?

Kris Kennaway kris at obsecurity.org
Mon Dec 11 17:04:32 PST 2006


On Mon, Dec 11, 2006 at 04:43:52PM -0800, Julian Elischer wrote:
> Kris Kennaway wrote:
> >On Mon, Dec 11, 2006 at 03:09:16PM -0800, Julian Elischer wrote:
> >>I often have the following:
> >>
> >>
> >>code x() does some bad thing 'A'.. it's a known thing and you can tell
> >>where it was done from (x()) but x() tell at the time that it is bad.
> >>
> >>at some later time, you discover 'A' is bad but now you don't know who
> >>was teh bad caller of x()
> >>
> >>
> >>The solution I'm looking for:
> >>
> >>when x() is called it calls kdb_backtrace, but has teh backtrace written 
> >>to a static 16K buffer instead of being put out the normal way.
> >>
> >>when A is found to be wrong, we can see who the last caller of x() was
> >>and how it was called.
> >>
> >>
> >>I am looking at it now.. but if anyone has any thoughts let me know...
> >
> >See <sys/stack.h>
> 
> interesting... is there any documentation on how to use this and what 
> its limitations are?
> 
> man -k stack doesn't provide anything..  grrrrr.

I thought threre was a manpage but couldnt find it when I replied
(hence citing the header).  It's pretty trivial though, see
kern/subr_stack.c and also grep for usage of stack_save.

Kris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20061212/9a75cdbb/attachment.pgp


More information about the freebsd-current mailing list