Bogus signal handler causes kernel panic (5.2.1-p8/i386)

Simon Barner barner at in.tum.de
Fri Jun 18 13:54:59 GMT 2004


Bruce,

first of all thanks a lot for your comprehensive replys. I tried both of
your patched with the following results:

- patch 1 ("the quick & dirty one"): The panic is gone, the program is its
  infinite loop printing lots of '.'s and some '*'s, without any
  recognizable pattern and consumes 100% cpu, but nothing bad happens.

- patch 2 ("the not so quick one"): My system still panics (stack trace
  attached).
  
  Additionally, I see the following messages on my console (e.g. when I
  run `script' (but only as root IIRC, I can examine this further if you
  need this information):
  
Jun 18 14:56:09 zi025 kernel: kernel trap 22 with interrupts disabled
Jun 18 14:56:09 zi025 kernel: npxdna: fpcurthread == curthread 1 times
                                                              ^^^
                                            this counter is increasing

For your reference, I also attached my kernel configuration.

Simon
-------------- next part --------------
GNU gdb 5.2.1 (FreeBSD)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or 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.
This GDB was configured as "i386-unknown-freebsd"...
panic: arithmetic trap
panic messages:
---
Fatal trap 6: arithmetic trap while in kernel mode
instruction pointer	= 0x8:0xc061670a
stack pointer	        = 0x10:0xcb4b89e4
frame pointer	        = 0x10:0xcb4b89e4
code segment		= base 0x0, limit 0xfffff, type 0x1b
			= DPL 0, pres 1, def32 1, gran 1
processor eflags	= resume, IOPL = 0
current process		= 775 (a.out)
trap number		= 6
panic: arithmetic trap

syncing disks, buffers remaining... 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 
giving up on 139 buffers
Uptime: 1m46s
Dumping 192 MB
 16 32 48 64 80 96 112 128 144 160 176
---
Reading symbols from /usr/src/sys/i386/compile/KISTE/modules/usr/src/sys/modules/fdescfs/fdescfs.ko.debug...done.
Loaded symbols for /usr/src/sys/i386/compile/KISTE/modules/usr/src/sys/modules/fdescfs/fdescfs.ko.debug
Reading symbols from /boot/kernel/green_saver.ko...done.
Loaded symbols for /boot/kernel/green_saver.ko
#0  doadump () at ../../../kern/kern_shutdown.c:240
240		dumping++;
(kgdb) bt
#0  doadump () at ../../../kern/kern_shutdown.c:240
#1  0xc04f0cbb in boot (howto=256) at ../../../kern/kern_shutdown.c:372
#2  0xc04f0f91 in panic () at ../../../kern/kern_shutdown.c:550
#3  0xc0611f68 in trap_fatal (frame=0xcb4b89a4, eva=0)
    at ../../../i386/i386/trap.c:821
#4  0xc0611ab4 in trap (frame=
      {tf_fs = 24, tf_es = 16, tf_ds = 16, tf_edi = 0, tf_esi = -1055699840, tf_ebp = -884241948, tf_isp = -884241968, tf_ebx = 514, tf_edx = -1055699840, tf_ecx = -884241776, tf_eax = -884241776, tf_trapno = 6, tf_err = 0, tf_eip = -1067358454, tf_cs = 8, tf_eflags = 65606, tf_esp = -884241932, tf_ss = -1067358532})
    at ../../../i386/i386/trap.c:618
#5  0xc0605998 in calltrap () at {standard input}:94
#6  0xc06166bc in npxsetregs (td=0x0, addr=0x0) at ../../../i386/isa/npx.c:963
#7  0xc060bd6b in set_fpcontext (td=0xc1134c80, mcp=0x0)
    at ../../../i386/i386/machdep.c:2529
#8  0xc060a76a in sigreturn (td=0xc1134c80, uap=0x0)
    at ../../../i386/i386/machdep.c:982
#9  0xc061224b in syscall (frame=
      {tf_fs = 47, tf_es = 47, tf_ds = 47, tf_edi = -1077940612, tf_esi = -1077940604, tf_ebp = -1077940684, tf_isp = -884241036, tf_ebx = 1, tf_edx = 672409248, tf_ecx = 13, tf_eax = 417, tf_trapno = 22, tf_err = 2, tf_eip = -1077936211, tf_cs = 31, tf_eflags = 582, tf_esp = -1077941560, tf_ss = 47})
    at ../../../i386/i386/trap.c:1010
#10 0xc06059ed in Xint0x80_syscall () at {standard input}:136
---Can't read userspace from dump, or kernel process---

(kgdb) bt full
#0  doadump () at ../../../kern/kern_shutdown.c:240
No locals.
#1  0xc04f0cbb in boot (howto=256) at ../../../kern/kern_shutdown.c:372
No locals.
#2  0xc04f0f91 in panic () at ../../../kern/kern_shutdown.c:550
	td = (struct thread *) 0xc1134c80
	bootopt = 256
	newpanic = 0
	ap = 0xcb4b894c "G\001e?"
	buf = "arithmetic trap", '\0' <repeats 240 times>
#3  0xc0611f68 in trap_fatal (frame=0xcb4b89a4, eva=0)
    at ../../../i386/i386/trap.c:821
	code = 16
	type = 6
	ss = 16
	esp = 0
	softseg = {ssd_base = 0, ssd_limit = 1048575, ssd_type = 27, 
  ssd_dpl = 0, ssd_p = 1, ssd_xx = 0, ssd_xx1 = 0, ssd_def32 = 1, ssd_gran = 1}
#4  0xc0611ab4 in trap (frame=
      {tf_fs = 24, tf_es = 16, tf_ds = 16, tf_edi = 0, tf_esi = -1055699840, tf_ebp = -884241948, tf_isp = -884241968, tf_ebx = 514, tf_edx = -1055699840, tf_ecx = -884241776, tf_eax = -884241776, tf_trapno = 6, tf_err = 0, tf_eip = -1067358454, tf_cs = 8, tf_eflags = 65606, tf_esp = -884241932, tf_ss = -1067358532})
    at ../../../i386/i386/trap.c:618
---Type <return> to continue, or q <return> to quit---
	td = (struct thread *) 0xc1134c80
	p = (struct proc *) 0xc226dc5c
	sticks = 3257326684
	i = 0
	ucode = 0
	type = 6
	code = 0
	eva = 0
#5  0xc0605998 in calltrap () at {standard input}:94
No locals.
#6  0xc06166bc in npxsetregs (td=0x0, addr=0x0) at ../../../i386/isa/npx.c:963
	s = 514
#7  0xc060bd6b in set_fpcontext (td=0xc1134c80, mcp=0x0)
    at ../../../i386/i386/machdep.c:2529
	addr = (union savefpu *) 0xcb4b8a90
#8  0xc060a76a in sigreturn (td=0xc1134c80, uap=0x0)
    at ../../../i386/i386/machdep.c:982
	uc = {uc_sigmask = {__bits = {0, 0, 0, 0}}, uc_mcontext = {
    mc_onstack = 0, mc_gs = 47, mc_fs = 47, mc_es = 47, mc_ds = 47, 
    mc_edi = -1077940612, mc_esi = -1077940604, mc_ebp = -1077940684, 
    mc_isp = -884241036, mc_ebx = 1, mc_edx = 672409248, mc_ecx = 13, 
    mc_eax = 1, mc_trapno = 12, mc_err = 2, mc_eip = 671874187, mc_cs = 31, 
    mc_eflags = 662, mc_esp = -1077940740, mc_ss = 47, mc_len = 640, 
    mc_fpformat = 65537, mc_ownedfp = 131074, mc_spare1 = {0}, mc_fpstate = {
---Type <return> to continue, or q <return> to quit---
      -60801, -65536, -1, 0, 0, 0, -65536, -589504512, -589505316, 1476411390, 
      175106046, 1073648009, -402761728, -1853289873, 1476411390, 175106046, 
      1073648009, -1396195328, -1694889029, 16382, 0, 1073989632, 
      0 <repeats 106 times>}, mc_spare2 = {0, 0, 0, 0, 0, 0, 0, 0}}, 
  uc_link = 0x0, uc_stack = {ss_sp = 0x0, ss_size = 0, ss_flags = 4}, 
  uc_flags = 0, __spare__ = {0, 0, 0, 0}}
	p = (struct proc *) 0xc226dc5c
	regs = (struct trapframe *) 0xcb4b8d48
	cs = 0
	eflags = 662
	error = 0
	ret = 0
#9  0xc061224b in syscall (frame=
      {tf_fs = 47, tf_es = 47, tf_ds = 47, tf_edi = -1077940612, tf_esi = -1077940604, tf_ebp = -1077940684, tf_isp = -884241036, tf_ebx = 1, tf_edx = 672409248, tf_ecx = 13, tf_eax = 417, tf_trapno = 22, tf_err = 2, tf_eip = -1077936211, tf_cs = 31, tf_eflags = 582, tf_esp = -1077941560, tf_ss = 47})
    at ../../../i386/i386/trap.c:1010
	params = 0xbfbfeacc---Can't read userspace from dump, or kernel process---

(kgdb)
-------------- next part --------------
#
# GENERIC -- Generic kernel configuration file for FreeBSD/i386
#
# For more information on this file, please read the handbook section on
# Kernel Configuration Files:
#
#    http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
#
# The handbook is also available locally in /usr/share/doc/handbook
# if you've installed the doc distribution, otherwise always see the
# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the
# latest information.
#
# An exhaustive list of options and more detailed explanations of the
# device lines is also present in the ../../conf/NOTES and NOTES files. 
# If you are in doubt as to the purpose or necessity of a line, check first 
# in NOTES.
#
# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.394.2.3 2004/01/26 19:42:11 nectar Exp $
makeoptions	DEBUG=-g
machine		i386
cpu		I586_CPU
ident		KISTE	

options		CPU_FASTER_5X86_FPU
options		CPU_SUSP_HLT
options		CPU_UPGRADE_HW_CACHE
options		CPU_WT_ALLOC
options		NO_F00F_HACK

options 	SCHED_4BSD		#4BSD scheduler
options 	INET			#InterNETworking
options		INET6
options 	FFS			#Berkeley Fast Filesystem
options 	SOFTUPDATES		#Enable FFS soft updates support
options 	UFS_ACL			#Support for access control lists
options 	UFS_DIRHASH		#Improve performance on big directories
options 	MD_ROOT			#MD is a potential root device
options 	MSDOSFS			#MSDOS Filesystem
options         SMBFS                   #SMB/CIFS filesystem
options 	CD9660			#ISO 9660 Filesystem
options 	PROCFS			#Process filesystem (requires PSEUDOFS)
options         PSEUDOFS                #Pseudo-filesystem framework
options 	COMPAT_43		#Compatible with BSD 4.3 [KEEP THIS!]
options 	COMPAT_FREEBSD4		#Compatible with FreeBSD4
options 	SCSI_DELAY=15000	#Delay (in ms) before probing SCSI
options 	KTRACE			#ktrace(1) support
options 	SYSVSHM			#SYSV-style shared memory
options 	SYSVMSG			#SYSV-style message queues
options 	SYSVSEM			#SYSV-style semaphores
options 	_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
options 	KBD_INSTALL_CDEV	# install a CDEV entry in /dev
options         COMPAT_LINUX
options		LINPROCFS

# Debugging for use in -current
#options 	DDB			#Enable the kernel debugger
#options 	INVARIANTS		#Enable calls of extra sanity checking
#options 	INVARIANT_SUPPORT	#Extra sanity checks of internal structures, required by INVARIANTS
#options 	WITNESS			#Enable checks to detect deadlocks and cycles
#options 	WITNESS_SKIPSPIN	#Don't run witness on spinlocks for speed

device		isa
device		eisa
device		pci

# Floppy drives
device		fdc

# ATA and ATAPI devices
device		ata
device		atadisk			# ATA disk drives
device		atapicd			# ATAPI CDROM drives
device		atapicam		# emulate ATAPI devices as
					# SCSI ditto via CAM	
device          scbus           	# base SCSI code
device          pass            	# CAM passthrough driver
device          cd              	# SCSI CD-ROMs
options 	ATA_STATIC_ID		# Static device numbering

# atkbdc0 controls both the keyboard and the PS/2 mouse
device		atkbdc		# AT keyboard controller
device		atkbd		# AT keyboard
device		psm		# PS/2 mouse

device		vga		# VGA video card driver

device		splash		# Splash screen and screen saver support

# syscons is the default console driver, resembling an SCO console
device		sc

# Enable this for the pcvt (VT220 compatible) console driver
#device		vt
#options 	XSERVER			# support for X server on a vt console
#options 	FAT_CURSOR		# start with block cursor

# Floating point support - do not disable.
device		npx

# Power management support (see NOTES for more options)
device		apm
# Add suspend/resume support for the i8254.
device		pmtimer

# Serial (COM) ports
device		sio		# 8250, 16[45]50 based serial ports

# Parallel port
device		ppc
device		ppbus		# Parallel port bus (required)
device		lpt		# Printer
device		ppi		# Parallel port interface device

# PCI Ethernet NICs that use the common MII bus controller code.
# NOTE: Be sure to keep the 'device miibus' line in order to use these NICs!
device		miibus		# MII bus support
#device		rl		# RealTek 8129/8139
device		xl		# 3com 90x (Boomerang)

options         RANDOM_IP_ID
options		NETSMB
options		NETSMBCRYPTO
options         LIBMCHAIN
options         LIBICONV

# Pseudo devices - the number indicates how many units to allocate.
device		random		# Entropy device
device		loop		# Network loopback
device		ether		# Ethernet support
device		pty		# Pseudo-ttys (telnet etc)

# The `bpf' device enables the Berkeley Packet Filter.
# Be aware of the administrative consequences of enabling this!
device		bpf		# Berkeley packet filter

### ipfilter ###
options         IPFILTER                #ipfilter support
options         IPFILTER_LOG            #ipfilter logging
options         IPFILTER_DEFAULT_BLOCK  #block all packets by default
options         PFIL_HOOKS              #required by IPFILTER

# Sound
device pcm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: Digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20040618/0a84af20/attachment.bin


More information about the freebsd-current mailing list