Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004127OCamlOCaml generalpublic2006-10-02 16:012012-09-06 19:23
ReporterClaudio Sacerdoti Coen 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusconfirmedResolutionopen 
PlatformOSOS Version
Product Version3.09.2 
Target VersionlaterFixed in Version 
Summary0004127: Thread.sigmask not working under pthreads
DescriptionThread.sigmask seems to be ignored.
I attach an ocaml program and the "equivalent" C code.
The two programs set a signal handler for SIGINT and then create two more
threads. Each thread uses sigmask to block SIGINT. SIGINT should now be received
only from the parent thread. In Ocaml any thread can still receive the SIGINT,
as if Thread.sigmask behaves as the identity function.
TagsNo tags attached.
Attached Filesc file icon thread_mask.c [^] (636 bytes) 2006-10-02 16:01 [Show Content]
? file icon a.ml [^] (867 bytes) 2006-10-02 16:02 [Show Content]

- Relationships

-  Notes
(0003932)
xleroy (administrator)
2007-02-22 11:12

I confirm the problem. It comes from the fact that the set of pending signals is global rather than per-thread. There is no easy fix, but I keep that in my to do list.
(0006351)
xleroy (administrator)
2011-12-17 09:49

I've been sleeping on this PR for way too long, so I'm un-assigning it from me.

Here is my analysis. The kernel delivers the signal to one of the threads that doesn't block it. However, if this thread is outside a blocking section, it cannot act on it immediately and instead records the signal as pending in a *global* data structure. Other threads poll this data structure periodically and can decide to handle the signal even if they block it themselves (or, more exactly, blocked it at the time the signal was received). In effect, Thread.sigmask is useless.

- Issue History
Date Modified Username Field Change
2006-10-02 16:01 Claudio Sacerdoti Coen New Issue
2006-10-02 16:01 Claudio Sacerdoti Coen File Added: thread_mask.c
2006-10-02 16:02 Claudio Sacerdoti Coen File Added: a.ml
2006-11-15 16:13 doligez Status new => acknowledged
2007-02-22 11:12 xleroy Note Added: 0003932
2007-02-22 11:12 xleroy Assigned To => xleroy
2007-02-22 11:12 xleroy Status acknowledged => confirmed
2011-12-17 09:49 xleroy Note Added: 0006351
2011-12-17 09:49 xleroy Assigned To xleroy =>
2012-07-06 16:41 doligez Target Version => 4.01.0+dev
2012-07-31 13:37 doligez Target Version 4.01.0+dev => 4.00.1+dev
2012-09-06 19:23 frisch Target Version 4.00.1+dev => later


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker