From nobody@FreeBSD.org  Fri Mar  4 01:38:12 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 1FE6C16A4CF
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  4 Mar 2005 01:38:12 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 95E1D43D53
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  4 Mar 2005 01:38:11 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j241cB3O097967
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 4 Mar 2005 01:38:11 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j241cBEM097966;
	Fri, 4 Mar 2005 01:38:11 GMT
	(envelope-from nobody)
Message-Id: <200503040138.j241cBEM097966@www.freebsd.org>
Date: Fri, 4 Mar 2005 01:38:11 GMT
From: Mike Jakubik <mikej@rogers.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Reproducible panic with port iplog and -current
X-Send-Pr-Version: www-2.3

>Number:         78384
>Category:       kern
>Synopsis:       [panic][mutex] Reproducible panic with port iplog and -current
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    vwe
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 04 01:40:21 GMT 2005
>Closed-Date:    Sun May 11 16:43:40 UTC 2008
>Last-Modified:  Sun May 11 16:43:40 UTC 2008
>Originator:     Mike Jakubik
>Release:        FreeBSD 6.0-CURRENT
>Organization:
n/a
>Environment:
FreeBSD fbsd.wettoast.net 6.0-CURRENT FreeBSD 6.0-CURRENT #1: Wed Mar  2 19:46:30 EST 2005     root@fbsd.wettoast.net:/usr/obj/usr/src/sys/DP  i386
>Description:
Hello,

It seems that the port iplog, causes a panic when it is stopped. Oddly
enough it works fine when running. Below is the information i gathered, i dont know what commands to feed the debugger to provide useful info, so instructions are welcome. I have also defined dumpdev in rc.conf and makeoptions DEBUG=-g" in kernel, but the system does not dump. I dont understand why, even dmesg reports its setup.

kernel dumps on /dev/ad0s1b
swapon: adding /dev/ad0s1b as swap device

It just sits there after the panic message. And yes, the swap partition is larger than physical memory. Anyways, here is what i gathered. This happens on a 1 month old kernel, as well as a recently cvsuped one.

---

root@fbsd:~# sync
root@fbsd:~# /usr/local/etc/rc.d/iplog.sh stop
 iplogroot@fbsd:~# kernel trap 12 with interrupts disabled


Fatal trap 12: page fault while in kernel mode
fault virtual address   = 0x4
fault code              = supervisor read, page not present
instruction pointer     = 0x8:0xc051274f
stack pointer           = 0x10:0xd8a55b04
frame pointer           = 0x10:0xd8a55b2c
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, def32 1, gran 1
processor eflags        = resume, IOPL = 0
current process         = 526 (iplog)
[thread pid 526 tid 100105 ]
Stopped at      propagate_priority+0x13f:       movl    0x4(%eax),%eax
db> trace
Tracing pid 526 tid 100105 td 0xc1b85730
propagate_priority(c1b85730,0,c0649a96,254,c0698620) at
propagate_priority+0x13f
turnstile_wait(c19a7858,c1b878a0,c0645f57,216,c19a7858) at
turnstile_wait+0x38b
_mtx_lock_sleep(c19a7858,c1b85730,0,c06495f9,206) at _mtx_lock_sleep+0x134
_mtx_lock_flags(c19a7858,0,c06495f9,206,1) at _mtx_lock_flags+0xbf
sleepq_calc_signal_retval(0,0,c0647242,da,0) at
sleepq_calc_signal_retval+0x38
msleep(c19ab400,c19ab468,11a,c064fdf9,0) at msleep+0x3de
bpfread(c19abd00,d8a55c80,0,3a2,8000) at bpfread+0x1bc
devfs_read_f(c1a16a20,d8a55c80,c1551d00,0,c1b85730) at devfs_read_f+0xa6
dofileread(c1b85730,c1a16a20,7,807d000,8000) at dofileread+0x9b
read(c1b85730,d8a55d14,c,3ff,3) at read+0x6b
syscall(2f,2f,2f,808f600,0) at syscall+0x245
Xint0x80_syscall() at Xint0x80_syscall+0x1f
--- syscall (3, FreeBSD ELF32, read), eip = 0x281133cf, esp = 0xbfabde0c,
ebp = 0xbfabde28 ---
db> continue
panic: blockable sleep lock (sleep mutex) process lock @
/usr/src/sys/i386/i386/trap.c:696
KDB: enter: panic
[thread pid 526 tid 100105 ]
Stopped at      kdb_enter+0x30: leave
db> trace
Tracing pid 526 tid 100105 td 0xc1b85730
kdb_enter(c0646b1d,c06937e0,c064a32c,d8a559f0,100) at kdb_enter+0x30
panic(c064a32c,c0657a46,c06461d5,c065d5e6,2b8) at panic+0xcc
witness_checkorder(c19a7858,9,c065d5e6,2b8,0) at witness_checkorder+0xc7
_mtx_lock_flags(c19a7858,0,c065d5e6,2b8,c1b85730) at _mtx_lock_flags+0x8a
trap_pfault(d8a55ac4,0,4,1ce,4) at trap_pfault+0xa1
trap(18,10,10,c1b86540,c1b85730) at trap+0x34d
calltrap() at calltrap+0x5
--- trap 0xc, eip = 0xc051274f, esp = 0xd8a55b04, ebp = 0xd8a55b2c ---
propagate_priority(c1b85730,0,c0649a96,254,c0698620) at
propagate_priority+0x13f
turnstile_wait(c19a7858,c1b878a0,c0645f57,216,c19a7858) at
turnstile_wait+0x38b
_mtx_lock_sleep(c19a7858,c1b85730,0,c06495f9,206) at _mtx_lock_sleep+0x134
_mtx_lock_flags(c19a7858,0,c06495f9,206,1) at _mtx_lock_flags+0xbf
sleepq_calc_signal_retval(0,0,c0647242,da,0) at
sleepq_calc_signal_retval+0x38
msleep(c19ab400,c19ab468,11a,c064fdf9,0) at msleep+0x3de
bpfread(c19abd00,d8a55c80,0,3a2,8000) at bpfread+0x1bc
devfs_read_f(c1a16a20,d8a55c80,c1551d00,0,c1b85730) at devfs_read_f+0xa6
dofileread(c1b85730,c1a16a20,7,807d000,8000) at dofileread+0x9b
read(c1b85730,d8a55d14,c,3ff,3) at read+0x6b
syscall(2f,2f,2f,808f600,0) at syscall+0x245
Xint0x80_syscall() at Xint0x80_syscall+0x1f
--- syscall (3, FreeBSD ELF32, read), eip = 0x281133cf, esp = 0xbfabde0c,
ebp = 0xbfabde28 ---
db> continue
Uptime: 33m37s

---

And here is my kernel config:

---
machine         i386
cpu             I686_CPU
ident           DP

options         SCHED_4BSD              # 4BSD scheduler
options         PREEMPTION              # Enable kernel thread preemption
options         INET                    # InterNETworking
options         FFS                     # Berkeley Fast Filesystem
options         SOFTUPDATES             # Enable FFS soft updates support
options         UFS_DIRHASH             # Improve performance on big
directories
options         COMPAT_43               # Compatible with BSD 4.3 [KEEP
THIS!]

options         COMPAT_FREEBSD4         # Compatible with FreeBSD4

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         ADAPTIVE_GIANT          # Giant mutex is adaptive.

# Bus support.  Do not remove isa, even if you have no isa slots
device          isa
device          pci

# Floppy drives
device          fdc

# ATA and ATAPI devices
device          ata
device          atadisk         # ATA disk drives
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          vga             # VGA video card driver

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

device          agp             # support several AGP chipsets

# Floating point support - do not disable.
device          npx

# 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

# PCI Ethernet NICs.
device          em              # Intel PRO/1000 adapter Gigabit Ethernet
Card

# 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          fxp             # Intel EtherExpress PRO/100B (82557, 82558)
device          xl              # 3Com 3c90x (``Boomerang'', ``Cyclone'')

# Pseudo devices.
device          loop            # Network loopback
device          mem             # Memory and kernel memory devices
device          io              # I/O device
device          random          # Entropy device
device          ether           # Ethernet support
device          pty             # Pseudo-ttys (telnet etc)
device          bpf             # Berkeley packet filter

# USB support
device          uhci            # UHCI PCI->USB interface
device          ohci            # OHCI PCI->USB interface
device          usb             # USB Bus (required)

device          pf
options         ALTQ
options         ALTQ_PRIQ

# Debugging
makeoptions     DEBUG=-g
options         INVARIANTS
options         INVARIANT_SUPPORT
options         WITNESS
options         WITNESS_SKIPSPIN
---

Thanks.
>How-To-Repeat:
Install /usr/ports/net/iplog. Configure and run. Stop iplog (/usr/local/etc/rc.d/iplog.sh stop).

>Fix:
Dont use iplog :)
>Release-Note:
>Audit-Trail:

From: "Mike Jakubik" <mikej@rogers.com>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: kern/78384: Reproducible panic with port iplog and -current
Date: Sat, 5 Mar 2005 14:07:11 -0500 (EST)

 The problem seem to be PREEMPTION, disabling it in the kernel stops the
 panic from occuring.
 

From: Gleb Smirnoff <glebius@FreeBSD.org>
To: Mike Jakubik <mikej@rogers.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/78384: Reproducible panic with port iplog and -current
Date: Wed, 9 Mar 2005 18:17:45 +0300

 On Sat, Mar 05, 2005 at 07:10:15PM +0000, Mike Jakubik wrote:
 M>  The problem seem to be PREEMPTION, disabling it in the kernel stops the
 M>  panic from occuring.
 
 Does debug.mpsafenet=0 fixes the problem?
 
 -- 
 Totus tuus, Glebius.
 GLEBIUS-RIPN GLEB-RIPE

From: "Mike Jakubik" <mikej@rogers.com>
To: "Gleb Smirnoff" <glebius@FreeBSD.org>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: kern/78384: Reproducible panic with port iplog and -current
Date: Wed, 9 Mar 2005 20:04:46 -0500 (EST)

 Gleb Smirnoff said:
 
 > Does debug.mpsafenet=0 fixes the problem?
 
 It does not.
 
State-Changed-From-To: open->feedback 
State-Changed-By: rwatson 
State-Changed-When: Sat Mar 8 20:03:30 UTC 2008 
State-Changed-Why:  
Scanning back through old BPF bugs, and this sounds like it might be one. 
Christian Peron has done a lot of BPF locking cleanups and fixes in more 
recent releases (6.x, and now 7.0).  Could you confirm whether this 
problem still occurs for you on FreeBSD 6.3 or 7.0?  Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=78384 
State-Changed-From-To: feedback->suspended 
State-Changed-By: vwe 
State-Changed-When: Sat May 10 17:15:14 UTC 2008 
State-Changed-Why:  

no feedback received for quite some time - suspending this for now 
this ticket will get closed after 6.0 EOL date (soon) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=78384 
Responsible-Changed-From-To: freebsd-bugs->vwe 
Responsible-Changed-By: vwe 
Responsible-Changed-When: Sat May 10 17:25:47 UTC 2008 
Responsible-Changed-Why:  

track for EOL 

http://www.freebsd.org/cgi/query-pr.cgi?pr=78384 

From: Mike Jakubik <mikej@rogers.com>
To: bug-followup@FreeBSD.org, mikej@rogers.com
Cc:  
Subject: Re: kern/78384: [panic][mutex] Reproducible panic with port iplog
 and -current
Date: Sat, 10 May 2008 17:13:48 -0400

 Tested on FreeBSD 7.0-STABLE #0: Fri May  9 13:54:00 EDT 2008 , all is 
 good, looks like its fixed.
 
 Thanks.
 
State-Changed-From-To: suspended->closed 
State-Changed-By: vwe 
State-Changed-When: Sun May 11 16:42:34 UTC 2008 
State-Changed-Why:  

issue seems to has been fixed - closing now 
thanks for reporting! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=78384 
>Unformatted:
