kern/117973: [panic] [lpt] 7.0-BETA2: repeatable panic while printing to /dev/lpt0

Eugene Grosbein eugen at
Sun Nov 11 04:10:02 PST 2007

>Number:         117973
>Category:       kern
>Synopsis:       [panic] [lpt] 7.0-BETA2: repeatable panic while printing to /dev/lpt0
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 11 12:10:01 UTC 2007
>Originator:     Eugene Grosbein
>Release:        FreeBSD 7.0-BETA2 i386
Svyaz-Service JSC
System: FreeBSD 7.0-BETA2 FreeBSD 7.0-BETA2 #0: Sun Nov 11 18:36:42 KRAT 2007 eu at i386
	Dualcore SMP system with custom kernel
	Parallel ink printer HP DeskJect 610C
	OpenOffice 2.0.4.rc2
	GNU GhostScript 7.07_15

	While printing a very simple one-page file from OpenOffice
	to local printer though lpd system panices and I've crashdump.
	This is 100% repeatable. The workaround is to issue a command
	before printing:

/usr/sbin/lptcontrol -e -d /dev/lpt0.ctl
	Just print a page, printer starts to print, it prints first line
	then system reboots.

	Here is kgdb script:

Script started on Sun Nov 11 18:45:50 2007
[GDB will not be able to debug user-mode threads: /usr/lib/ Undefined symbol "ps_pglobal_lookup"]
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 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-marcel-freebsd".

Unread portion of the kernel message buffer:
lpt0: [ITHREAD]

Fatal trap 30: reserved (unknown) fault while in kernel lmpotd0e:
 c[pGuIiAdN T=- L1O;C KaEpD]ic id
 =l pt001:
 pointer	= 0x20:0xc1127d4c
stack pointer	        = 0x28:0xe4093c88
frame pointer	        = 0x28:0xe4093c88
code segment		= base 0x0, limit 0xfffff, type 0x1b
			= DPL 0, pres 1, def32 1, gran 1
processor eflags	= interrupt enabled, IOPL = 0
current process		= 10 (idle: cpu1)
trap number		= 30
panic: reserved (unknown) fault
cpuid = 1
KDB: stack backtrace:
db_trace_self_wrapper(c07c47a4,e4093b64,c057d7b0,c07e51dc,1,...) at 0xc0464d91 = db_trace_self_wrapper+0x26
kdb_backtrace(c07e51dc,1,c07aff8c,e4093b70,1,...) at 0xc05a3274 = kdb_backtrace+0x29
panic(c07aff8c,c07e659f,c5519f68,1,1,...) at 0xc057d7b0 = panic+0x10f
trap_fatal(c0598b78,6,0,c07c3b0a,1e,...) at 0xc077bcc9 = trap_fatal+0x32e
trap(e4093c48) at 0xc077ca05 = trap+0x549
calltrap() at 0xc0763cfb = calltrap+0x6
--- trap 0x1e, eip = 0xc1127d4c, esp = 0xe4093c88, ebp = 0xe4093c88 ---
acpi_cpu_c1(e4093cc0,e4093ca8,c551a440,1,10,...) at 0xc1127d4c = acpi_cpu_c1+0x5
acpi_cpu_idle(e4093cf4,c059987f,1,0,c084bc40,...) at 0xc1121778 = acpi_cpu_idle+0x17c
cpu_idle(1,0,c084bc40,c551a440,202,...) at 0xc076e4b8 = cpu_idle+0x28
sched_idletd(0,e4093d38,10000020,0,80000020,...) at 0xc059987f = sched_idletd+0x2d5
fork_exit(c05995aa,0,e4093d38) at 0xc055e6a1 = fork_exit+0x99
fork_trampoline() at 0xc0763d70 = fork_trampoline+0x8
--- trap 0, eip = 0, esp = 0xe4093d70, ebp = 0 ---
Uptime: 1m41s
Physical memory: 2029 MB
Dumping 146 MB: 131 115 99 83 67 51 35 19 3

#0  doadump () at pcpu.h:195
195		__asm __volatile("movl %%fs:0,%0" : "=r" (td));
(kgdb) where
#0  doadump () at pcpu.h:195
#1  0xc057d4f2 in boot (howto=260)
    at /usr/local/src/sys/kern/kern_shutdown.c:409
#2  0xc057d7df in panic (fmt=Variable "fmt" is not available.
) at /usr/local/src/sys/kern/kern_shutdown.c:563
#3  0xc077bcc9 in trap_fatal (frame=0xe4093c48, eva=0)
    at /usr/local/src/sys/i386/i386/trap.c:872
#4  0xc077ca05 in trap (frame=0xe4093c48)
    at /usr/local/src/sys/i386/i386/trap.c:659
#5  0xc0763cfb in calltrap () at /usr/local/src/sys/i386/i386/exception.s:139
#6  0xc1127d4c in ?? ()
#7  0xe4093cc0 in ?? ()
#8  0xc076e4b8 in cpu_idle () at /usr/local/src/sys/i386/i386/machdep.c:1156
Previous frame inner to this frame (corrupt stack?)
(kgdb) bt full
#0  doadump () at pcpu.h:195
No locals.
#1  0xc057d4f2 in boot (howto=260)
    at /usr/local/src/sys/kern/kern_shutdown.c:409
	_giantcnt = Variable "_giantcnt" is not available.
(kgdb) quit

Script done on Sun Nov 11 18:46:07 2007

	Here comes boot log:

Copyright (c) 1992-2007 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 7.0-BETA2 #0: Sun Nov 11 18:36:42 KRAT 2007
eu at
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel(R) Pentium(R) D CPU 2.80GHz (2805.72-MHz 686-class CPU)
Origin = "GenuineIntel"  Id = 0xf62  Stepping = 2
AMD Features=0x20100000<NX,LM>
AMD Features2=0x1<LAHF>
Cores per package: 2
real memory  = 2146050048 (2046 MB)
avail memory = 2085523456 (1988 MB)
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
cpu0 (BSP): APIC ID:  0
cpu1 (AP): APIC ID:  1
ioapic0: Changing APIC ID to 2
ioapic0 <Version 2.0> irqs 0-23 on motherboard
kqemu version 0x00010300
kqemu: KQEMU installed, max_locked_mem=1039036kB.
acpi0: <INTEL D975XBX> on motherboard
acpi0: [ITHREAD]
acpi0: Power Button (fixed)
Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x408-0x40b on acpi0
cpu0: <ACPI CPU> on acpi0
cpu1: <ACPI CPU> on acpi0
acpi_button0: <Sleep Button> on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
pcib1: <ACPI PCI-PCI bridge> at device 1.0 on pci0
pci1: <ACPI PCI bus> on pcib1
nvidia0: <GeForce 7600 GS> port 0x3000-0x307f mem 0x91000000-0x91ffffff,0x80000000-0x8fffffff,0x90000000-0x90ffffff irq 16 at device 0.0 on pci1
nvidia0: [GIANT-LOCKED]
nvidia0: [ITHREAD]
pcm0: <Intel 82801G High Definition Audio Controller> mem 0x92200000-0x92203fff irq 22 at device 27.0 on pci0
pcm0: [ITHREAD]
pcib2: <ACPI PCI-PCI bridge> at device 28.0 on pci0
pci2: <ACPI PCI bus> on pcib2
pcib3: <ACPI PCI-PCI bridge> at device 28.4 on pci0
pci3: <ACPI PCI bus> on pcib3
pcib4: <ACPI PCI-PCI bridge> at device 28.5 on pci0
pci4: <ACPI PCI bus> on pcib4
em0: <Intel(R) PRO/1000 Network Connection Version - 6.5.3> port 0x2000-0x201f mem 0x92100000-0x9211ffff irq 17 at device 0.0 on pci4
em0: Ethernet address: 00:16:76:6b:04:d7
em0: [FILTER]
uhci0: <UHCI (generic) USB controller> port 0x4080-0x409f irq 23 at device 29.0 on pci0
uhci0: [ITHREAD]
usb0: <UHCI (generic) USB controller> on uhci0
usb0: USB revision 1.0
uhub0: <Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1> on usb0
uhub0: 2 ports with 2 removable, self powered
uhci1: <UHCI (generic) USB controller> port 0x4060-0x407f irq 19 at device 29.1 on pci0
uhci1: [ITHREAD]
usb1: <UHCI (generic) USB controller> on uhci1
usb1: USB revision 1.0
uhub1: <Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1> on usb1
uhub1: 2 ports with 2 removable, self powered
uhci2: <UHCI (generic) USB controller> port 0x4040-0x405f irq 18 at device 29.2 on pci0
uhci2: [ITHREAD]
usb2: <UHCI (generic) USB controller> on uhci2
usb2: USB revision 1.0
uhub2: <Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1> on usb2
uhub2: 2 ports with 2 removable, self powered
uhci3: <UHCI (generic) USB controller> port 0x4020-0x403f irq 16 at device 29.3 on pci0
uhci3: [ITHREAD]
usb3: <UHCI (generic) USB controller> on uhci3
usb3: USB revision 1.0
uhub3: <Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1> on usb3
uhub3: 2 ports with 2 removable, self powered
ehci0: <Intel 82801GB/R (ICH7) USB 2.0 controller> mem 0x92204400-0x922047ff irq 23 at device 29.7 on pci0
ehci0: [ITHREAD]
usb4: EHCI version 1.0
usb4: companion controllers, 2 ports each: usb0 usb1 usb2 usb3
usb4: <Intel 82801GB/R (ICH7) USB 2.0 controller> on ehci0
usb4: USB revision 2.0
uhub4: <Intel EHCI root hub, class 9/0, rev 2.00/1.00, addr 1> on usb4
uhub4: 8 ports with 8 removable, self powered
umass0: <vendor 0x3538 USB Mass Storage Device, class 0/0, rev 2.00/1.00, addr 2> on uhub4
pcib5: <ACPI PCI-PCI bridge> at device 30.0 on pci0
pci5: <ACPI PCI bus> on pcib5
atapci0: <Promise PDC20268 UDMA100 controller> port 0x1018-0x101f,0x1024-0x1027,0x1010-0x1017,0x1020-0x1023,0x1000-0x100f mem 0x92004000-0x92007fff irq 18 at device 2.0 on pci5
atapci0: [ITHREAD]
ata2: <ATA channel 0> on atapci0
ata2: [ITHREAD]
ata3: <ATA channel 1> on atapci0
ata3: [ITHREAD]
pci5: <serial bus, FireWire> at device 4.0 (no driver attached)
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
atapci1: <Intel ICH7 UDMA100 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x40b0-0x40bf irq 18 at device 31.1 on pci0
ata0: <ATA channel 0> on atapci1
ata0: [ITHREAD]
ata1: <ATA channel 1> on atapci1
ata1: [ITHREAD]
atapci2: <Intel ICH7 SATA300 controller> port 0x40c8-0x40cf,0x40e4-0x40e7,0x40c0-0x40c7,0x40e0-0x40e3,0x40a0-0x40af mem 0x92204000-0x922043ff irq 19 at device 31.2 on pci0
atapci2: [ITHREAD]
atapci2: AHCI Version 01.10 controller with 4 ports detected
ata4: <ATA channel 0> on atapci2
ata4: [ITHREAD]
ata5: <ATA channel 1> on atapci2
ata5: [ITHREAD]
ata6: <ATA channel 2> on atapci2
ata6: [ITHREAD]
ata7: <ATA channel 3> on atapci2
ata7: [ITHREAD]
pci0: <serial bus, SMBus> at device 31.3 (no driver attached)
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
atkbd0: [ITHREAD]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [ITHREAD]
psm0: model IntelliMouse, device ID 3
sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
sio0: type 16550A
sio0: [FILTER]
cryptosoft0: <software crypto> on motherboard
orm0: <ISA Option ROM> at iomem 0xcf000-0xd17ff pnpid ORM0000 on isa0
ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0
ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
ppc0: FIFO with 16/16/8 bytes threshold
ppbus0: <Parallel port bus> on ppc0
ppbus0: IEEE1284 device found /NIBBLE/ECP
Probing for PnP devices on ppbus0:
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
ppc0: [ITHREAD]
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
ugen0: <American Power Conversion Back-UPS 500 FW: 6.5.I USB FW: c1, class 0/0, rev 1.10/1.00, addr 2> on uhub0
ugen1: <Hewlett-Packard HP ScanJet 2200C, class 255/0, rev 1.10/1.00, addr 2> on uhub1
Timecounters tick every 1.000 msec
Fast IPsec: Initialized Security Association Processing.
ipfw2 initialized, divert enabled, rule-based forwarding enabled, default to deny, logging disabled
acd0: DVDR <NEC DVD RW ND-3500AG/2.18> at ata0-master UDMA33
ad4: 190782MB <WDC WD2000JB-00REA0 20.00K20> at ata2-master UDMA100
ad8: 238475MB <Seagate ST3250620AS 3.AAK> at ata4-master SATA300
pcm0: <HDA Codec: Sigmatel STAC9221D>
pcm0: <HDA Driver Revision: 20071020_0048>
cd0 at ata0 bus 0 target 0 lun 0
cd0: <_NEC DVD_RW ND-3500AG 2.18> Removable CD-ROM SCSI-0 device 
cd0: 33.000MB/s transfers
cd0: cd present [4141760 x 2048 byte records]
SMP: AP CPU #1 Launched!
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <Generic USB Flash Disk 0.00> Removable Direct Access SCSI-2 device 
da0: 40.000MB/s transfers
da0: 984MB (2015232 512 byte sectors: 64H 32S/T 984C)
Trying to mount root from ufs:/dev/ad4s1a

	Here is kernel config file:

machine		i386
cpu		I686_CPU
ident		DADV

options		INCLUDE_CONFIG_FILE	# Include this file in kernel
options		SMP
device		apic			# I/O APIC
options 	PREEMPTION		# Enable kernel thread preemption

makeoptions	DEBUG=-g		# Build kernel with gdb(1) debug symbols

options 	SCHED_ULE		# ULE scheduler

options 	INET			# InterNETworking
options 	FFS			# Berkeley Fast Filesystem
options 	SOFTUPDATES		# Enable FFS soft updates support
options 	UFS_DIRHASH		# Improve performance on big directories
options 	NFSCLIENT		# Network Filesystem Client
options 	NFSSERVER		# Network Filesystem Server
options 	MSDOSFS			# MSDOS Filesystem
options		NTFS
options 	LIBICONV
options 	NTFS_ICONV

options 	CD9660			# ISO 9660 Filesystem
options		CD9660_ICONV
options 	PROCFS			# Process filesystem (requires PSEUDOFS)
options 	PSEUDOFS		# Pseudo-filesystem framework
options 	COMPAT_43TTY		# Compatible with BSD 4.3 [KEEP THIS!]
options 	COMPAT_FREEBSD4		# Compatible with FreeBSD4
options 	COMPAT_FREEBSD5		# Compatible with FreeBSD5
options 	COMPAT_FREEBSD6		# Compatible with FreeBSD5
options 	SCSI_DELAY=3000		# 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

device		pci

# ATA and ATAPI devices
device		ata
device		atadisk		# ATA disk drives
device		atapicd		# ATAPI CDROM drives
options 	ATA_STATIC_ID	# Static device numbering
device		atapicam

# SCSI peripherals
device		scbus		# SCSI bus (required for SCSI)
device		da		# Direct Access (disks)
device		cd		# CD
device		pass		# Passthrough device (direct SCSI access)

# 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

# syscons is the default console driver, resembling an SCO console
device		sc
options		SC_HISTORY_SIZE=1000

# 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		em		# Intel PRO/1000 adapter Gigabit Ethernet Card

# Pseudo devices.
device		loop		# Network loopback
device		random		# Entropy device
device		ether		# Ethernet support
device		pty		# Pseudo-ttys (telnet etc)
device		md		# Memory "disks"
device		gif		# IPv6 and IPv4 tunneling
device		tap			#Virtual Ethernet driver
device		bpf		# Berkeley packet filter

# USB support
device		uhci		# UHCI PCI->USB interface
device		ohci		# OHCI PCI->USB interface
device		ehci		# EHCI PCI->USB interface (USB 2.0)
device		usb		# USB Bus (required)
device		ugen		# Generic
device		umass		# Disks/Mass storage - Requires scbus and da
device		if_bridge

device		crypto
options		IPSEC
options		IPDIVERT
options		DUMMYNET

options 	NETGRAPH		# netgraph(4) system
options 	NETGRAPH_BLUETOOTH		# ng_bluetooth(4)
options 	NETGRAPH_BLUETOOTH_SOCKET	# ng_btsocket(4)

device		ucom
device		umodem

option		VFS_AIO

device		sound
device		snd_hda

options		LINPROCFS

options 	KDB
options 	KDB_TRACE
options 	DDB
options 	DDB_NUMSYM
options 	GDB


	And now /etc/src.conf:


	And relevant part of /etc/make.conf:



	Unknown. As I've mentioned, switching to extended mode
	with lptcontrol(8) helps to not panic.

Eugene Grosbein

More information about the freebsd-bugs mailing list