Subject: Re: -current and libpthread and signals
To: Stephan Thesing <email@example.com>
From: Bill Studenmund <firstname.lastname@example.org>
Date: 05/10/2004 15:37:10
Content-Type: text/plain; charset=us-ascii
On Thu, May 06, 2004 at 11:29:35PM +0200, Stephan Thesing wrote:
> I noticed that signal delivery has problems with a Qt application that us=
> QProcess class and thus creates and destroys threads and receives SIGCHLD=
> a child _process_ has exited (internally in Qt the QProcess class install=
> signal handler for SIGCHLD and from the handler triggers the Qt notificat=
> The symptoms are either
> - the signal is never delivered to a thread, as all living threads have =
> blocked in their signal masks
> - with PTHREAD_CONCURRENCY=3D2, an assertion in libpthreads triggers whe=
> signal is tried to be delivered to a running thread:
> assertion "target->pt_state !=3D PT_STATE_RUNNING || target->pt_blockg=
> target->pt_unblockgen" failed: file "/usr/src/lib/libpthread/pthread_s=
> line 794, function "pthread__kill"
> [ The first case may be because at the time the signal is delivered, it is
> blocked in all but one thread. Unfortunately, the thread that has the s=
> pending, exits before the signal handler can be taken. As the signal re=
> blocked in all other threads, the handler is never invoked.
> (Which is just my impression after ooking at some debug output of libpt=
> without pretending I understand the code and interna of the pthread lib=
This issue, if correct, seems like a library bug. If you are going to ask=
for SIGCHLD, you should have something to receive it.
I'm not sure what the right behavior is if you get a signal (that you=20
requested) and nothing can receive it.
> I am just curious if this behavior is known and on somebodys TODO list....
> If more input is needed to fix this behavior I can try to construct a sma=
> example program that triggers it (the original application is quite large=
> propietary source code..)....
Unfortunately I am not a person to work on this. However if you could make=
a simpler test, that would be great. It could even be added as a=20
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)
-----END PGP SIGNATURE-----