From owner-freebsd-questions@FreeBSD.ORG Fri Dec 28 11:44:58 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 406C716A41B for ; Fri, 28 Dec 2007 11:44:58 +0000 (UTC) (envelope-from kris@FreeBSD.org) Received: from weak.local (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 83C0213C442; Fri, 28 Dec 2007 11:44:57 +0000 (UTC) (envelope-from kris@FreeBSD.org) Message-ID: <4774E1B8.1080500@FreeBSD.org> Date: Fri, 28 Dec 2007 12:44:56 +0100 From: Kris Kennaway User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Brian O'Shea References: <276958.21567.qm@web39510.mail.mud.yahoo.com> In-Reply-To: <276958.21567.qm@web39510.mail.mud.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: buildkernel with INVARIANTS, WITNESS, DEBUG_LOCKS, etc. fails X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2007 11:44:58 -0000 Brian O'Shea wrote: > Hello FreeBSD developers, > > Building a FreeBSD 6.2-RELEASE kernel on an Intel Pentium 4 with the > following config options causes buildkernel to fail with undefined > references to stack_save, stack_zero, and stack_print functions: > > makeoptions DEBUG=-g > options INVARIANTS > options INVARIANT_SUPPORT > options WITNESS > options DEBUG_LOCKS > options DEBUG_VFS_LOCKS > options DIAGNOSTIC > > Am I just omitting an option that causes this code to be linked > correctly, or alternatively is there a workaround for this? I followed > the instructions from the following developers handbook page on > debugging deadlocks: > > http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/kerneldebug-deadlocks.html > > Below I have included as much information as I can think of that would > be relevant to this problem. Please let me know if you would like me to > provide any more information. > > Regards, > -brian > > > Output from uname -a : > FreeBSD apsara.hsd1.ca.comcast.net. 6.2-RELEASE FreeBSD 6.2-RELEASE #1: Fri Nov > 9 00:08:34 PST 2007 > root@apsara.hsd1.ca.comcast.net.:/usr/obj/usr/src/sys/APSARA i386 > > CPU information from dmesg: > > CPU: Intel(R) Pentium(R) 4 CPU 1.80GHz (1796.95-MHz 686-class CPU) > Origin = "GenuineIntel" Id = 0xf24 Stepping = 4 > > Features=0x3febfbff MOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM> > > Relevant (non-comment) diffs between a kernel config that bulids > (APSARA) and one that doesn't (APSARA-DEBUG) included below: > > 23c22 > < ident APSARA > --- >> ident APSARA-DEBUG > 28c27,38 > < #makeoptions DEBUG=-g # Build kernel with gdb(1) debug > symbols > --- >> makeoptions DEBUG=-g # Build kernel with gdb(1) debug > symbols >> # >> # The following options have been set in an attempt to track down the >> # problem with the snd_cmi driver, which causes the system to hang if >> # it is used to play audio content: >> # >> options INVARIANTS >> options INVARIANT_SUPPORT >> options WITNESS >> options DEBUG_LOCKS >> options DEBUG_VFS_LOCKS >> options DIAGNOSTIC > > Relevant error messages from make buildkernel (with KERNCONF set to > APSARA-DEBUG) included below: > > linking kernel.debug > kern_lock.o(.text+0x15d): In function `lockmgr': > /usr/src/sys/kern/kern_lock.c:176: undefined reference to `stack_save' > kern_lock.o(.text+0x26c):/usr/src/sys/kern/kern_lock.c:223: undefined reference > to `stack_save' > kern_lock.o(.text+0x4c4):/usr/src/sys/kern/kern_lock.c:306: undefined reference > to `stack_save' > kern_lock.o(.text+0x5f9):/usr/src/sys/kern/kern_lock.c:365: undefined reference > to `stack_save' > kern_lock.o(.text+0x737):/usr/src/sys/kern/kern_lock.c:410: undefined reference > to `stack_save' > kern_lock.o(.text+0x95d): In function `lockinit': > /usr/src/sys/kern/kern_lock.c:504: undefined reference to `stack_zero' > kern_lock.o(.text+0xae3): In function `lockmgr_printinfo': > /usr/src/sys/kern/kern_lock.c:596: undefined reference to `stack_print' > *** Error code 1 I think you also need DDB. This is a minor bug which you could send-pr about if you like. Kris