FreeBSD and threads in 3.0

Andreas Ericsson ae at op5.se
Wed Sep 12 12:09:36 CEST 2007


Oriol Capsada wrote:
> Hi all,
> 
> I have seen that in the "What's new" section of the 3.x documentation 
> the "known issue" with FreeBSD and threads that appeared in the 2.x 
> documentation is there no more.
> 
> Does anyone know if that problem with FreeBSD and threads is solved in 
> the 3.0 version? And if it's not, should the known issue announcement be 
> added again in the 3.x documentation?


Judging by the code, it appears to be solved.

The problem was that nagios used fork() in a subthread of the main process.
There are a plethora of various resource contention problems associated
with that behaviour, and the various standards controlling commonly used
C api's leave a lot of the reactions to some of the subtler errors listed
as "undefined", or "implementation specific", which means it *might* work,
and most likely usually will, but in the long run (over 50k+ iterations),
you run into "undefined behaviour". This "undefined behaviour" usually means
(in C, when threads are in the picture) either a segfault or an infinite
loop in the form of a spinlock on some locked-and-never-released resource.

>From what I can see in the code, this behaviour is now scrapped, and Nagios
uses temporary files to transfer status from an executed check to the
master process. This has its problems too, but the symptoms of those problems
rarely (if ever) cause programs to crash completely, and the errors are
much more pleasant to debug than the once-every-50k-iteration kind, which
can, literally take *weeks* to trigger.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/




More information about the Developers mailing list