Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Jan 2003 10:48:04 -0800
From:      <Vijay.Singh@nokia.com>
To:        <hackers@freebsd.org>
Subject:   panic with kqueue
Message-ID:  <4D7B558499107545BB45044C63822DDE8588CD@mvebe001.americas.nokia.com>

next in thread | raw e-mail | index | archive | help
Greetings. I am trying to port kqueue to a FreeBSD 2.x based system. I =
have taken the base code from the 4.4.0-Release and then merged fixes =
all the way to the current version of the kern_event.c file. Some other =
changes needed were=20

1. adding struct klist p_klist to the proc struct
2. adding struct klist si_note to the selinfo struct
3. adding function pointer fo_kqfilter and file type DTYPE_KUEUE to the =
file struct

etc

I have added a KNOTE(&p1->p_klist, NOTE_FORK | p2->p_pid); to =
kern_fork.c and I get this panic

Fatal trap 12: page fault while in kernel mode
fault virtual address   =3D 0x46
fault code              =3D supervisor read, page not present
instruction pointer     =3D 0x8:0xc01716c8
code segment            =3D base 0x0, limit 0xfffff, type 0x1b
                        =3D DPL 0, pres 1, def32 1, gran 1
processor eflags        =3D interrupt enabled, resume, IOPL =3D 0
current process         =3D 1 (init)
interrupt mask          =3D=20
kernel: type 12 trap, code=3D0
panic: page fault

syncing disks... done

kernel stack backtrace:
_panic(fmt=3D100) at _panic+0x64
_panic(fmt=3Dc02dbdac) at _panic+0x64
_trap_fatal(frame=3Dbfbffebc) at _trap_fatal+0x2b3
_trap_pfault(frame=3Dbfbffebc,usermode=3D0) at _trap_pfault+0x1ac
_trap(frame=3De7710010) at _trap+0x277
calltrap() at calltrap+0x15
--- trap 12, eip =3D 0xc01716c8, ebp =3D 0xbfbfff00 ---
_knote(list=3Dc7c8f700,hint=3D40000005) at _knote+0x14
_fork1(p1=3Dc7c8f600,isvfork=3D0,retval=3Dbfbfff8c) at _fork1+0x3fb
_fork(p=3Dc7c8f600,uap=3Dbfbfff94,retval=3Dbfbfff8c) at _fork+0x10
_syscall(frame=3D27) at _syscall+0x172
_Xsyscall() at _Xsyscall+0x2b
--- syscall 2, eip =3D 0x7d05, ebp =3D 0xbfbfbd3c ---
Rebooting...

I would really appreciate if someone could offer some help as this is my =
first real kernel work. I am guessing that either the kqueue module has =
not been inited (I dont have SYSINIT and zalloc stuff, I replaced the =
zalloc with malloc) or the p->p_klist isnt being initialized probably =
with a SLIST_INIT( ). Please help.

regards
vijay

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D7B558499107545BB45044C63822DDE8588CD>