Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Apr 1999 14:10:57 +0930 (CST)
From:      Greg Lehey <grog@lemis.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/11299: Recent kernels have broken symbol tables, confusing gdb
Message-ID:  <199904240440.OAA09541@freebie.lemis.com>

next in thread | raw e-mail | index | archive | help

>Number:         11299
>Category:       kern
>Synopsis:       Recent kernels have broken symbol tables, confusing gdb
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 23 21:50:01 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     Greg Lehey
>Release:        FreeBSD-4.0-CURRENT
>Organization:
LEMIS
>Environment:

	4.0-CURRENT after about mid-April

>Description:

I've just had a strange experience.  I have some gdb macros which I
use for debugging Vinum.  One, ps, gives me a ps-like listing:

(kgdb) ps
Check your .gdbinit, it contains a y command
  pid    proc    addr   uid  ppid  pgrp   flag stat comm         wchan
 1544 c68a5100 c6df3000    0  1534  1544  004006  2  Vinum
 1534 c68a57e0 c6ddb000    0  1524  1534  004086  3  bash         wait c68a57e0
 1524 c68a5c00 c6dc9000 1004  1516  1524  004086  3  bash         wait c68a5c00

Another macro helps me load symbols from a kld:

Without:

(kgdb) bt
#0  Debugger (msg=0xc11696a0 "vinum debug") at ../../i386/i386/db_interface.c:318
#1  0xc1163585 in ?? ()
#2  0xc01826ea in spec_ioctl (ap=0xc6df4e1c) at ../../miscfs/specfs/spec_vnops.c:440

With:

(kgdb) bt
#0  Debugger (msg=0xc11696a0 "vinum debug") at ../../i386/i386/db_interface.c:318
#1  0xc1163585 in vinumioctl (dev=0x40001901, cmd=0xc008464b, data=0xc6df4ee0 "", flag=0x3, p=0xc68a5100)
    at /src/PANIC/src/sys/modules/Vinum/../../dev/Vinum/vinumioctl.c:96
#2  0xc01826ea in spec_ioctl (ap=0xc6df4e1c) at ../../miscfs/specfs/spec_vnops.c:440

This has worked quite nicely for some time.  Since yesterday, after
building a kernel with newbus support, I get strange messages if I
read in the Vinum symbols before reading in the kernel symbols:

(kgdb) bt
#0  Debugger (msg=0xc11696a0 "vinum debug") at ../../i386/i386/db_interface.c:318
#1  0xc1163585 in vinumioctl (dev=0x40001901, cmd=0xc008464b, data=0xc6df4ee0 "", flag=0x3, p=0xc68a5100)
    at /src/PANIC/src/sys/modules/Vinum/../../dev/Vinum/vinumioctl.c:96
During symbol reading, "repeated" header file opt_global.h not previously seen, at symtab pos 23.
During symbol reading, Invalid symbol data: type number (2,2) out of range at symtab pos 25..
#2  0xc01826ea in spec_ioctl (ap=0xc6df4e1c) at ../../miscfs/specfs/spec_vnops.c:440

The following stack frames also look strange:

#5  0xc017ccdd in vn_ioctl (fp=<error type>, com=<incomplete type>, data=<incomplete type>, p=<error type>)
    at vnode_if.h:395
#6  0xc015c5f7 in ioctl (p=0xc68a5100, uap=0xc6df4f94) at ../../kern/sys_generic.c:564
#7  0xc021e916 in syscall (frame=<error type>) at ../../i386/i386/trap.c:1071

I debugged gdb and found that it was finding these references
(opt_global.h) in cd9660_rrip.o, which it read after reading the Vinum
kld symbols.  If I can convince it to read the kernel symbols first, I
don't have any trouble.  I don't think that it's anything to do with
that particular file; there must be about 30 files in a typical kernel
build which refer to this symbol.

>How-To-Repeat:

	See above.  The "ps" macro is in
	/usr/src/sys/modules/vinum/.gdbinit.kernel, and the "asf"
	macro which loads the symbols of the vinum kld is in
	/usr/src/sys/modules/vinum/.gdbinit.vinum.paths.  It's
	probably easiest to start vinum: just run vinum(8) without any
	parameters, and then enter:

	# vinum
	vinum -> debug 256
	vinum -> debug

	This will cause gdb to go into serial debugging mode.  It
	would also probably be possible to do this with gdb against
	/dev/mem.  If anybody proposes to try it this way, contact me
	and we'll discuss what is needed.

>Fix:

	Not investigated.

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199904240440.OAA09541>