Subject: GDB busted, what did I do to deserve this?
To: None <current-users@NetBSD.ORG>
From: Craig M. Chase <chase@pine.ece.utexas.edu>
List: current-users
Date: 11/14/1995 20:00:04
Well, it has been about two weeks, and I've not seen anybody else
complain, so I must conclude that I am the only person with this
malady, and that I have somehow inflicted this pain on myself.
gdb broke thoroughly around about the start of November when I
upgraded to a NetBSD-1.1ALPHA (i386) kernel and system.
I have two Pentium systems that are suffering from this problem.
The synopsis:
chase@orac>/usr/bin/cc -g -static -o hello hello.c
chase@orac>/usr/bin/gdb hello
GDB is free software and you are welcome to distribute copies of it
under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.11 (i386-netbsd), Copyright 1993 Free Software Foundation, Inc...
(gdb) break main
Breakpoint 1 at 0x1098: file hello.c, line 5.
(gdb) run
Starting program: /a/orac/home/orac/chase/src/hello
Breakpoint 1, main () at hello.c:5
5 printf("hello world\n");
(gdb) n
Program received signal SIGSEGV (11), Segmentation fault
0x1099 in main () at hello.c:5
5 printf("hello world\n");
(gdb) print "ARRRRHHGGGG!"
Program received signal SIGSEGV (11), Segmentation fault
0x1099 in main () at hello.c:5
5 printf("hello world\n");
The program being debugged stopped while in a function called from GDB.
When the function (malloc) is done executing, GDB will silently
stop (instead of continuing to evaluate the expression containing
the function call).
(gdb) quit
The program is running. Quit anyway (and kill it)? (y or n) y
And this is true with both gdb-4.14 (which I recompiled after
installing the new kernel, before recompiling it, gdb itself core
dump, now it's just the inferior that SEGVs) and static or non-static
linking, gcc-2.4.5 or gcc-2.7.0
Any time I stop the program in gdb (breakpoint, step, next, etc),
there is an extremely high (not quite 1) probability that next time I
start the program (e.g., continue, step, next, etc) the inferior will
SEGV for no reason).
What did I do that caused gdb to break? I'm at my wits end on this
one.
My kernel configuration file follows. Thanks!
Craig
------------------------------------------------------------
# $NetBSD: GENERIC,v 1.21 1995/09/14 12:46:42 hpeyerl Exp $
#
# GENERIC -- everything that's currently supported
#
machine i386 # architecture, used by config; REQUIRED
options I386_CPU # CPU classes; at least one is REQUIRED
options I485_CPU
options I586_CPU
#options MATH_EMULATE # floating point emulation
options DUMMY_NOPS # speed hack; recommended
options XSERVER,UCONSOLE
options INSECURE # insecure; allow /dev/mem writing for X
options MACHINE_NONCONTIG
maxusers 12 # estimated number of users
options TIMEZONE=0 # time zone to adjust RTC time by
options DST=0 # daylight savings time used by RTC
options SWAPPAGER # paging; REQUIRED
options VNODEPAGER # mmap() of files
options DEVPAGER # mmap() of devices
#options DDB # in-kernel debugger
#makeoptions DEBUG="-g" # compile full symbol table
#options DIAGNOSTIC # internally consistency checks
#options KTRACE # system call tracing, a la ktrace(1)
options SYSVMSG # System V-like message queues
options SYSVSEM # System V-like semaphores
options SYSVSHM # System V-like memory sharing
options SHMMAXPGS=1024 # 1024 pages is the default
options COMPAT_NOMID # compatibility with 386BSD, BSDI, NetBSD 0.8,
options COMPAT_09 # NetBSD 0.9,
options COMPAT_10 # NetBSD 1.0,
options COMPAT_43 # and 4.3BSD
options TCP_COMPAT_42 # TCP bug compatibility with 4.2BSD
options COMPAT_FREEBSD # binary compatibility with FreeBSD
options COMPAT_SVR4 # binary compatibility with SVR4
options COMPAT_IBCS2 # binary compatibility with SCO and ISC
options COMPAT_LINUX # binary compatibility with Linux
options USER_LDT # user-settable LDT; used by WINE
options LKM # loadable kernel modules
options FFS # UFS
#options QUOTA # UFS quotas
#options LFS # log-structured file system
options MFS # memory file system
options NFSCLIENT # Network File System client
options NFSSERVER # Network File System server
options CD9660 # ISO 9660 + Rock Ridge file system
options MSDOSFS # MS-DOS file system
options FDESC # /dev/fd
options FIFO # FIFOs; RECOMMENDED
options KERNFS # /kern
options NULLFS # loopback file system
options PORTAL # ?
options PROCFS # /proc
options UMAPFS # NULLFS + uid and gid remapping
options UNION # union file system
options GATEWAY # packet forwarding
options INET # IP + ICMP + TCP + UDP
options NS # XNS
config netbsd swap generic
options GENERIC
isa0 at root
pci0 at root
npx0 at isa? port 0xf0 irq 13 # math coprocessor
#pc0 at isa? port 0x60 irq 1 # generic PC console device
vt0 at isa? port 0x60 irq 1
com0 at isa? port 0x3f8 irq 4 # standard PC serial ports
com1 at isa? port 0x2f8 irq 3
#com2 at isa? port 0x3e8 irq 5
#com3 at isa? port 0x2e8 irq 9
#ast0 at isa? port 0x1a0 irq 5 # AST 4-port serial cards
#com* at ast? slave ? flags 1
#boca0 at isa? port 0x100 irq 5 # BOCA 8-port serial cards
#com* at boca? slave ?
#rtfps0 at isa? port 0x1230 irq 10 # RT 4-port serial cards
#com* at rtfps? slave ?
#cy0 at isa? ...
lpt0 at isa? port 0x378 irq 7 # standard PC parallel ports
#lpt1 at isa? port 0x278
#lpt2 at isa? port 0x3bc
#lms0 at isa? port 0x23c irq 5 # Logitech bus mouse
#lms1 at isa? port 0x238 irq 5
#mms0 at isa? port 0x23c irq 5 # Microsoft InPort mouse
#mms1 at isa? port 0x238 irq 5
#pms0 at isa? port 0x60 irq 12 # PS/2 auxiliary port mouse
ahc0 at pci? bus ? dev ? # Adaptec 2940 PCI SCSI controller
scsibus* at ahc?
#aha0 at isa? port 0x330 irq ? drq ? # Adaptec 154[02] SCSI controllers
#scsibus* at aha?
#ahb0 at isa? port ? irq ? # Adaptec 174[024] SCSI controllers
#aha1 at isa? port 0x334 irq ? drq ? # Adaptec 154[02] SCSI controllers
sd* at scsibus? target ? lun ? # SCSI disk drives
st* at scsibus? target ? lun ? # SCSI tape drives
cd* at scsibus? target ? lun ? # SCSI CD-ROM drives
#ch* at scsibus? target ? lun ? # SCSI autochangers
fdc0 at isa? port 0x3f0 irq 6 drq 2 # standard PC floppy controllers
#fdc1 at isa? port 0x370 irq ? drq ?
fd* at fdc? drive ?
#mcd0 at isa? port 0x300 irq 10 # Mitsumi CD-ROM drives
#wdc0 at isa? port 0x1f0 irq 14 # ST506, ESDI, and IDE controllers
#wdc1 at isa? port 0x170 irq ?
#wd* at wdc? drive ?
#wt0 at isa? port 0x300 irq 5 drq 1 # Archive and Wangtek QIC tape drives
ed0 at isa? port 0x280 iomem 0xd0000 irq 9 # WD/SMC, 3C503, and NE[12]000
#ed1 at isa? port 0x250 iomem 0xd8000 irq 9 # ethernet cards
#ed2 at isa? port 0x300 iomem 0xcc000 irq 10
#eg0 at isa? ... # 3C505 ethernet cards
##nel0 at isa? port 0x300 irq 9 # 3C501 ethernet cards
#ep0 at isa? port ? irq ? # 3C509 ethernet cards
#ie0 at isa? port 0x360 iomem 0xd0000 irq 7 # StarLAN, 3C507, and Etherexpress
#le0 at isa? port 0x320 irq 10 drq 7 # IsoLan, NE2100, and DEPCA
#de* at pci? bus ? dev ?
#pss0 at isa? port 0x220 irq 7 drq 6 # Personal Sound System
#sp0 at pss0 port 0x530 irq 10 drq 0 # sound port driver
sb0 at isa? port 0x220 irq 7 drq 1 # SoundBlaster
#wss0 at isa? port 0x530 irq 10 drq 0 # Windows Sound System
#pas0 at isa? port 0x220 irq 7 drq 1 # ProAudio Spectrum
#gus0 at isa? port 0x220 irq 7 drq 1 flags 6 # Gravis Ultra Sound (flags is record drq for full-duplex)
#spkr0 at isa? #...
pseudo-device loop 1 # network loopback
pseudo-device bpfilter 8 # packet filter
pseudo-device sl 2 # CSLIP
pseudo-device ppp 2 # PPP
pseudo-device tun 2 # network tunneling over tty
pseudo-device pty 64 # pseudo-terminals
pseudo-device tb 1 # tablet line discipline
pseudo-device vnd 4 # paging to files
--
Craig Chase --- Assistant Professor
Electrical and Computer Engineering
The University of Texas at Austin
Austin, TX 78721 --- (512) 471-7457
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.2
mQCNAzCNf0YAAAEEANXpNKQilG9pAMd1OqXNteVYNaKoI7cXvBpl2nYpGNe/CZrS
U/Vebi1PfKy6eWqbgsUOo1yPzfBmh5GGA0TUcyalIN8Aur4w0LdWAFP5ihMQEQYh
g33Nfjq0xBFyxHDP76X+pq5idGYj9ZZKGDTeFwzKIAmKPvggohGN4hjScfM9AAUR
tCVDcmFpZyBNLiBDaGFzZSA8Y2hhc2VAZWNlLnV0ZXhhcy5lZHU+
=rjIy
-----END PGP PUBLIC KEY BLOCK-----