Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Apr 2004 23:54:36 +0200
From:      "Simon L. Nielsen" <simon@FreeBSD.org>
To:        freebsd-current@freebsd.org
Cc:        Mark Murray <markm@FreeBSD.org>
Subject:   random(4) related panic: sleeping without a mutex
Message-ID:  <20040411215436.GB881@zaphod.nitro.dk>

next in thread | raw e-mail | index | archive | help

--lEGEL1/lMxI0MVQ2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello

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
Debugger("panic")
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 =3D 0x280c15e7, esp =3D 0xbfbfcb2=
c, ebp =3D 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 :

sys/dev/random/randomdev.c:106:

	/* Blocking logic */
	while (!random_systat.seeded && !error) {
		if (flag & IO_NDELAY)
			error =3D EWOULDBLOCK;
		else
			error =3D 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
and GENERIC.

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.

--=20
Simon L. Nielsen
FreeBSD Documentation Team

--lEGEL1/lMxI0MVQ2
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAeb6ch9pcDSc1mlERAvFDAJwO8k3+zkdYF+5kAKW+uz6QZtBlHACfZR0r
6tOW5KevCLaojCfLVdeMlV8=
=SmtU
-----END PGP SIGNATURE-----

--lEGEL1/lMxI0MVQ2--



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