Date: Thu, 26 Aug 2004 06:04:16 GMT From: "Maarten L. Hekkelman" <m.hekkelman@cmbi.kun.nl> To: freebsd-gnats-submit@FreeBSD.org Subject: threads/70975: unexpected and unreliable behaviour when using SYSV semaphore, fork and pipe Message-ID: <200408260604.i7Q64G1p031707@www.freebsd.org> Resent-Message-ID: <200408260610.i7Q6AMwV029485@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 70975 >Category: threads >Synopsis: unexpected and unreliable behaviour when using SYSV semaphore, fork and pipe >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-threads >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Aug 26 06:10:22 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Maarten L. Hekkelman >Release: 5.2.1-RELEASE-p8 >Organization: Radboud Universiteit Nijmegen, Afd. CMBI >Environment: FreeBSD cmbidb1.cmbi.kun.nl 5.2.1-RELEASE-p8 FreeBSD 5.2.1-RELEASE-p8 #6: Thu Aug 19 08:19:25 CEST 2004 root@cmbidb1.cmbi.kun.nl:/usr/obj/usr/src/sys/MY_KERNEL i386 >Description: I have some code that works fine on IRIX and Linux but fails on FreeBSD. What I do is start a number of threads (using pthreads) that each create a pipe and fork/exec a subprocess to read from using the pipe. The problem is that either the code blocks on reading from the pipe, even when O_NONBLOCK is set. Or the semaphore created with semget fails when I try to call semop with it after a number of times. I'm using this semaphore to limit the number of running threads. The error code after semop fails is always "Interrupted system call". As noted before, the code works fine on other OS's Linux and IRIX. I believe it used to work in FreeBSD 4.6 but I'm not sure, it doesn't work with 4.9. >How-To-Repeat: Source code for an app showing this behaviour can be found at http://www.hekkelman.com/~maarten/test.cpp Run the app with two parameters, the first is the number of threads to use and the second is the number of subprocesses to spawn. >Fix: >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200408260604.i7Q64G1p031707>