From owner-freebsd-hackers@FreeBSD.ORG Mon Mar 17 23:24:45 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4DAF4189 for ; Mon, 17 Mar 2014 23:24:45 +0000 (UTC) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A4E2990C for ; Mon, 17 Mar 2014 23:24:44 +0000 (UTC) Received: from ur.dons.net.au (ppp118-210-139-70.lns20.adl6.internode.on.net [118.210.139.70]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id s2HNOMFB057869 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 18 Mar 2014 09:54:29 +1030 (CST) (envelope-from doconnor@gsoft.com.au) Subject: Re: Extracting user stack traces from a crash dump Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Content-Type: multipart/signed; boundary="Apple-Mail=_4EB32AC7-AC84-490A-8A67-5207FA555653"; protocol="application/pgp-signature"; micalg=pgp-sha1 From: "Daniel O'Connor" In-Reply-To: Date: Tue, 18 Mar 2014 09:54:22 +1030 Message-Id: <3E530A84-432D-40DE-A229-6E3DFCA1FA14@gsoft.com.au> References: <21FD6187-811C-48D9-BAC8-105F54F39989@gsoft.com.au> To: Ryan Stone X-Mailer: Apple Mail (2.1874) X-Spam-Score: 0.163 () BAYES_00,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: FreeBSD Hackers X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 23:24:45 -0000 --Apple-Mail=_4EB32AC7-AC84-490A-8A67-5207FA555653 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 On 17 Mar 2014, at 22:32, Ryan Stone wrote: > On Mon, Mar 17, 2014 at 5:41 AM, Daniel O'Connor = wrote: >> Hi, >> Does anyone know of a tool that can extract userland stack traces = from a crash dump? >> I did some googling and the closest I can see is to use DDB, but = obviously that is only possible when I can access the console. >>=20 >> Is it something procstat should/could be extended to do? >=20 > If I'm understanding you correctly, you have a kernel core and you > want to see the backtrace in *userland*? e.g. >=20 > malloc() > strdup() > main() Yep. > That's not possible with a minidump. A minidump does not include > memory for any userland processes, only the kernel, so you can't see > what any userland threads were doing at the time of the crash. You > could find the trap frame for the thread at the bottom of the kernel > stack and map the instruction pointer for the top userland frame, but > that's it. OK, thanks. I'll think of another way then! Do you know how to script DDB to dump userland stack frames on panic? I = had a go with... sudo ddb script 'kdb.enter.panic=3Dtextdump set; capture on; show = allpcpu; bt;ps; alltrace/u; show alllocks; call doadump; reset' However that output didn't show up in /var/crash as I was hoping.. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C --Apple-Mail=_4EB32AC7-AC84-490A-8A67-5207FA555653 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iD8DBQFTJ4Qm5ZPcIHs/zowRArc5AJ4gY3f0PRvG/AMp5Kj2SQk4sY1L6ACeOYK1 plsK3b3vpVUNYQW/MteEaHc= =kLIC -----END PGP SIGNATURE----- --Apple-Mail=_4EB32AC7-AC84-490A-8A67-5207FA555653--