From owner-freebsd-current@FreeBSD.ORG Tue Dec 12 01:04:32 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C170B16A532 for ; Tue, 12 Dec 2006 01:04:32 +0000 (UTC) (envelope-from kris@obsecurity.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3840643E1F for ; Tue, 12 Dec 2006 01:00:17 +0000 (GMT) (envelope-from kris@obsecurity.org) Received: from obsecurity.dyndns.org (elvis.mu.org [192.203.228.196]) by elvis.mu.org (Postfix) with ESMTP id BBC0D1A3C1C; Mon, 11 Dec 2006 17:01:35 -0800 (PST) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id 1B88A513F8; Mon, 11 Dec 2006 20:01:32 -0500 (EST) Date: Mon, 11 Dec 2006 20:01:31 -0500 From: Kris Kennaway To: Julian Elischer Message-ID: <20061212010131.GA88098@xor.obsecurity.org> References: <457DE51C.905@elischer.org> <20061212001154.GA87602@xor.obsecurity.org> <457DFB48.7020704@elischer.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="M9NhX3UHpAaciwkO" Content-Disposition: inline In-Reply-To: <457DFB48.7020704@elischer.org> User-Agent: Mutt/1.4.2.2i Cc: FreeBSD Current , Kris Kennaway Subject: Re: kdb_backtrace 'feature'? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Dec 2006 01:04:32 -0000 --M9NhX3UHpAaciwkO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 writte= n=20 > >>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 >=20 > interesting... is there any documentation on how to use this and what=20 > its limitations are? >=20 > 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 --M9NhX3UHpAaciwkO Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFFff9rWry0BWjoQKURAp3qAKC+DxPUFXnUUcwy3nb54Vfh/rX+4QCcDFi3 xydWwPkI+HeKUISZ4X9vVg4= =ChLn -----END PGP SIGNATURE----- --M9NhX3UHpAaciwkO--