random(4) related panic: sleeping without a mutex

Simon L. Nielsen simon at FreeBSD.org
Sun Apr 11 14:54:39 PDT 2004


I getting the following panic on my Soekris Net4801 box right after init
has been started:

Mounting root from ufs:/dev/ad0s1a
start_init: trying /sbin/init
panic: sleeping without a mutex
at line 144 in file /data/nanobsd/src/sys/kern/kern_synch.c
Stopped at      Debugger+0x45:  xchgl   %ebx,in_Debugger.0
db> trace
Debugger(c0636dcb) at Debugger+0x45
__panic(c06375fc,90,c06375d4,c8758b70,c04cc4ee) at __panic+0xc7
msleep(c0682740,0,1a0,c06476ac,0) at msleep+0xae
random_read(c06865a4,c8758c88,20000,c065bfe0,74) at random_read+0x41
spec_read(c8758bec,c8758c38,c052853c,c8758bec,20000) at spec_read+0x110
spec_vnoperate(c8758bec) at spec_vnoperate+0x13
vn_read(c17f1aa0,c8758c88,c0ac2d80,0,c1777540) at vn_read+0x1a0
dofileread(c1777540,c17f1aa0,7,bfbfcb6c,74) at dofileread+0xb0
read(c1777540,c8758d14,3,4,296) at read+0x3b
syscall(2f,2f,2f,bfbfeea8,7) at syscall+0x217
Xint0x80_syscall() at Xint0x80_syscall+0x1d
--- syscall (3, FreeBSD ELF32, read), eip = 0x280c15e7, esp = 0xbfbfcb2c, ebp = 0xbfbfcbf8 ---

It seems related to Mark Murray latest random(4) updates.  This is with
-CURRENT from today.  I can trace the problem to the tsleep call in :


	/* Blocking logic */
	while (!random_systat.seeded && !error) {
		if (flag & IO_NDELAY)
			error = EWOULDBLOCK;
			error = tsleep(&random_systat,
			    PUSER | PCATCH, "block", 0);

But my kernel foo is not sufficient to make more sense out of that, so I
hope somebody else can.  It happens both with my custom kernel config

I don't have a gdb trace since the box only has a flash card so it's a
bit difficult to create one, but if it's important I can probably find a
way - just let me know.

Simon L. Nielsen
FreeBSD Documentation Team
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20040411/5d6ffcc5/attachment-0001.bin

More information about the freebsd-current mailing list