From owner-freebsd-hackers@freebsd.org Fri Jun 30 02:35:05 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D766ADAAEC3 for ; Fri, 30 Jun 2017 02:35:05 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id BD74E7C7B5 for ; Fri, 30 Jun 2017 02:35:05 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: by mailman.ysv.freebsd.org (Postfix) id B9879DAAEC2; Fri, 30 Jun 2017 02:35:05 +0000 (UTC) Delivered-To: hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B924EDAAEC1 for ; Fri, 30 Jun 2017 02:35:05 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-15.reflexion.net [208.70.210.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D7767C7B4 for ; Fri, 30 Jun 2017 02:35:04 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 14688 invoked from network); 30 Jun 2017 02:35:03 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 30 Jun 2017 02:35:03 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v8.40.1) with SMTP; Thu, 29 Jun 2017 22:35:03 -0400 (EDT) Received: (qmail 9606 invoked from network); 30 Jun 2017 02:35:03 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 30 Jun 2017 02:35:03 -0000 Received: from [192.168.1.114] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id ABFA2EC7E56; Thu, 29 Jun 2017 19:35:02 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: extract panic message & debugging from vmcore.0 ? From: Mark Millard In-Reply-To: <20170630021205.GA43579@mail.michaelwlucas.com> Date: Thu, 29 Jun 2017 19:35:02 -0700 Cc: hackers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20170630021205.GA43579@mail.michaelwlucas.com> To: "Michael W. Lucas" X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jun 2017 02:35:05 -0000 On 2017-Jun-29, at 7:12 PM, Michael W. Lucas = wrote: > Short question: how do I get debug information for a PR from a vmcore? >=20 > Long question: we have conflicting docs. Which should I follow? >=20 > Good news: I needed a panic for the new "Absolute FreeBSD" anyway, > this one will do. >=20 > Details: >=20 > I got an actual kernel panic by running "gpart resize" on: >=20 > FreeBSD storm 12.0-CURRENT FreeBSD 12.0-CURRENT #1 r318747: Tue May 23 = 16:27:01 EDT 2017 root@storm:/usr/obj/usr/src/sys/GENERIC amd64 >=20 > I dumped it at the panic prompt, savecore ran at boot. According to > the Handbook, the next step is to run "kgdb kernel.debug vmcore.0" to > recover the panic message. But no kgdb is installed. Look for /usr/libexec/kgdb . But for some, most, or all TARGET_ARCH's the FreeBSD folks now recommend using kgdb from ports. (Which you built and installed.) /usr/libexec/kgdb is more for means-of-last-resort use when one can not get to the point of having the port kgdb around. > After some searching, I installed devel/gdb. >=20 > # kgdb kernel.debug /var/crash/vmcore.0 > GNU gdb (GDB) 7.12.1 [GDB v7.12.1 for FreeBSD] > Copyright (C) 2017 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later = > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. Type "show = copying" > and "show warranty" for details. > This GDB was configured as "x86_64-portbld-freebsd12.0". > Type "show configuration" for configuration details. > For bug reporting instructions, please see: > . > Find the GDB manual and other documentation resources online at: > . > For help, type "help". > Type "apropos word" to search for commands related to "word"... > Reading symbols from kernel.debug...done. > ABI doesn't support a vmcore target >=20 > Well, that's not good. I did more searching and found > /usr/src/tools/debugscripts/README. >=20 > # cd /usr/obj/usr/src/sys/GENERIC > # make gdbinit > # gdb kernel.debug Did you miss a /var/crash/vmcore.0 above? > GNU gdb (GDB) 7.12.1 [GDB v7.12.1 for FreeBSD] > Copyright (C) 2017 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later = > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. Type "show = copying" > and "show warranty" for details. > This GDB was configured as "x86_64-portbld-freebsd12.0". > Type "show configuration" for configuration details. > For bug reporting instructions, please see: > . > Find the GDB manual and other documentation resources online at: > . > For help, type "help". > Type "apropos word" to search for commands related to "word"... > Reading symbols from kernel.debug...done. > .gdbinit:16: Error in sourced command file: > No symbol "remotebaud" in current context. Unsure about the above. Separately. . . I'm no expert but you might need to pick between the default minidump vs. a full memory dump depending on purposes and what information is to be extracted: debug.minidump: 1 vs. debug.minidump: 0 in the sysctl debug.minidump output. I doubt that they are fully equivalent. Of course a full memory dump implies needing space ready to hold that full copy. =3D=3D=3D Mark Millard markmi at dsl-only.net