Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Sep 2001 07:20:01 -0700 (PDT)
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/30482: calcru calls printf while holding a spin lock
Message-ID:  <200109111420.f8BEK1i69395@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/30482; it has been noted by GNATS.

From: Bruce Evans <bde@zeta.org.au>
To: Ville-Pertti Keinonen <will@iki.fi>
Cc: <freebsd-gnats-submit@FreeBSD.ORG>
Subject: Re: kern/30482: calcru calls printf while holding a spin lock
Date: Wed, 12 Sep 2001 00:13:38 +1000 (EST)

 On Mon, 10 Sep 2001, Ville-Pertti Keinonen wrote:
 
 > >Description:
 > A machine that previously frequently reported problems with
 > microuptime() going backwards in calcru started crashing after a
 > recent update.
 >
 > I'm just guessing based on the stack trace and the panic message
 > (and this is the first time I look at anything related to SMPng
 > locking), but it seems that calcru calls printf which eventually
 > tries to wake up another process and grab allproc_lock while
 > sched_lock is held...
 >
 > This seems like an obvious enough bug that it should not require
 > further details.
 
 This is a bug in printf().  printf() must work when ordinary spinlocks
 like sched_lock are held (for debugging).  Known bugs in printf():
 - the syscons console driver is not reentrant.  The corresponding
   "microtime() goes backwards" printf() in mi_switch() was ifdefed out
   a long time ago to avoid panicing for this bug.
 - the TIOCCONS ioctl causes ordinary printf()s to go to a tty (usually
   a pty).  This can never have worked for printf()s from interrupt
   handlers and now causes a panic instead of random misbehaviour when
   printf() is called with a spinlock held.
 
 Workaround: always use a serial console and don't permit it to be stolen
 by TIOCCONS.
 
 Bruce
 

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




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