Date: Tue, 6 Jul 2004 10:24:41 -0700 (PDT) From: Logan Gabriel <gersh@tabby.sonn.com> To: freebsd-threads@freebsd.org Subject: Signal handling thread not working. Message-ID: <20040706093353.K13095@tabby.sonn.com>
next in thread | raw e-mail | index | archive | help
Hello, I am writing a multi threaded daemon for a number of unix platforms. In this daemon I create one thread to do signal handling with sigwait(). Signals in all other threads are blocked out. There is a problem with SIGCHLD in many FreeBSD thread libs, (It creates a zombie process). (Source code for example application: http://67.41.131.100/pthreadbug.c) The real application runs on 4.x and uses linuxthreads from ports so that is what I am most interested in having resolved, however I have noticed this code produces zombie processes with the normal user threads library (-pthread) on 4.x and with -lc_r in 5.x # # FreeBSD 4.9-STABLE #0: Wed Nov 12 23:16:46 GMT 2003 # [root@vmware] gcc -o pthreadbug pthreadbug.c -pthread ./pthreadbug ### Sigwait is now blocking. ### Child process 33108 exited. ### Child process 33109 exited. ^Z [1]+ Stopped ./pthreadbug [root@vmware] ps -axwwg | grep pthreadbug 33107 p1 T 0:00.01 ./pthreadbug 33108 p1 Z 0:00.00 (pthreadbug) 33109 p1 Z 0:00.00 (pthreadbug) Compilation with the linux threads library: gcc -I/usr/local/include/pthread/linuxthreads -o pthreadbug pthreadbug.c -L/usr/local/lib -llthread In a very recent version of -CURRENT (two weeks ago) -lpthread works as expected, however -lc_r does not. This exact same code produces the expected output (no zombie procs) in Linux (RedHat 9.1 / SuSE 9.1), and Solaris 8, so I am fairly confident this code "should" work as I am expecting. Any thoughts?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040706093353.K13095>