bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems with signal delivery


From: Jeremie Koenig
Subject: Problems with signal delivery
Date: Thu, 2 Sep 2010 17:15:04 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

Hi,

I have been investigating why 'ant' hangs under GIJ when running
external commands. The problem is in Process.waitFor(), which hangs
because libgcj's ProcessManager thread never gets SIGCHLD. This can be
reproduced with the attached Test.java.

It turns out it is a bug in the way glibc handles signal delivery.
Apparently process-wide signals are only ever delivered to the main
thread, regardless of the block masks.

Furthermore, there seem to be another problem with delayed delivery,
when a thread temporarily blocks a signal. Glibc waits until another
signal is received before delivering the first one.

I'm going to look into this further, but I wanted to report it and ask
whether you have any advice as to how this should be fixed.

The attached testsigthread.c can be used to reproduce these problem:

Works as expected:
$ ./testsigthread
Unblocking now.
*kill*
Got it!

Needs a second signal:
$ ./testsigthread
*kill*
Unblocking now.
*nothing happens, re-kill*
Got it!
Got it!

Separate thread:
$ ./testsigthread x
Unblocking now.
*kill*
(hangs forever)
$ ./testsigthread x
*kill*
Unblocking now.
(hangs forever)

-- 
Jeremie Koenig <jk@jk.fr.eu.org>
http://jk.fr.eu.org

Attachment: Test.java
Description: Text Data

Attachment: testsigthread.c
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]