Re: [LOR] kqueue()

From: Craig Rodrigues <rodrigc_at_crodrigues.org>
Date: Sun, 17 Jul 2005 11:39:36 -0400
On Sat, Jul 16, 2005 at 10:44:43PM +0000, Wojciech A. Koszek wrote:
> http://FreeBSD.czest.pl/dunstan/kqueuetest.c
> 
> Compile:
> [1] gcc kqueuetest.c -o kqueuetest
> Run with shell's PID:
> [2] ./kqueuetest $$
> [3] Suspend execution with CTRL^Z and move task to
>     background: bg %1

I can reproduce this LOR:

13 0xc066291c in _mtx_assert (m=0xc1bff600, what=0, 
    file=0xc0878298 "/usr/src/sys/kern/kern_event.c", line=1039)
    at /usr/src/sys/kern/kern_mutex.c:751
#14 0xc065180e in kqueue_expand (kq=0xc1bff600, fops=0x0, ident=3014, waitok=0)
    at /usr/src/sys/kern/kern_event.c:1039
#15 0xc0651261 in kqueue_register (kq=0xc1bff600, kev=0xd15f0c40, td=0x0, 
    waitok=0) at /usr/src/sys/kern/kern_event.c:828
#16 0xc065068e in filt_proc (kn=0xc18af6e8, hint=0)
    at /usr/src/sys/kern/kern_event.c:413
#17 0xc0652644 in knote (list=0xc1b071b4, hint=1073744838, islocked=1)
    at /usr/src/sys/kern/kern_event.c:1548
#18 0xc0656c24 in fork1 (td=0xc1b034b0, flags=20, pages=0, procp=0xd15f0cd4)
    at /usr/src/sys/kern/kern_fork.c:696
#19 0xc0655bd8 in fork (td=0xc1b034b0, uap=0xd15f0d04)
    at /usr/src/sys/kern/kern_fork.c:96



It looks like on line 1545 of kern_event.c, we have a KQ_LOCK(kq);,
and then on line 1039, the KQ_NOTOWNED(kq); assertion fails, because
the lock is never released.

-- 
Craig Rodrigues        
rodrigc_at_crodrigues.org
Received on Sun Jul 17 2005 - 13:39:50 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:39 UTC