Date: Sun, 15 Aug 2004 14:12:25 -0700 (PDT) From: John Polstra <jdp@polstra.com> To: Robert Watson <rwatson@freebsd.org> Cc: mbr@freebsd.org Subject: RE: thread-unsafe syslog code in libc? Message-ID: <XFMail.20040815141225.jdp@polstra.com> In-Reply-To: <Pine.NEB.3.96L.1040815160330.30898Q-100000@fledge.watson.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 15-Aug-2004 Robert Watson wrote: > On Sun, 15 Aug 2004, John Polstra wrote: > >> The above is only to handle an unusual error case. >> >> There is some thread-unsafeness here, but it doesn't look like it would >> matter under normal conditions. > > So maybe we're dealing with a user space race where multiple threads > attempt to do a first syslog in parallel? Probably not that. You said it was a simultaneous connect() and close(), right? The close is only done in disconnectlog() and closelog(). The former is only called in unusual error cases, and the latter is called by applications. So I guess one culprit could be a first syslog call in one thread and a closelog call in another thread. Or, maybe the system ran out of mbufs and the send() did fail, causing disconnectlog to be used and exercising the race. An out of mbufs condition might also contribute to the kernel panic you mentioned. John
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20040815141225.jdp>