Mercury Bugs - mercury
View Issue Details
0000008mercuryBugpublic2007-09-27 23:552022-02-09 12:38
Assigned To 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000008: code hanging in
DescriptionFrom Tue Sep 4 12:07:44 2007
Date: Tue, 04 Sep 2007 12:07:43 +1000
From: Ondrej Bojar <>
Subject: [Fwd: "hang-up in C-code in" - possible solution]

Hi, all.

I've received this suggestion from Krzysztof Foltman some while ago and now I
tested it. Indeed, if I use sigprocmask to block SIGPROF just before
io.call_system_return_signal and unblock it afterwards, my program does not hang
up in as it would without any treatment.

I'm using rotd-2007-08-13, so I assume this issue was not fixed yet.

Could you please add the temporary blocking of SIGPROF around every system() or
fork() calls in the standard library, if compiled in profiling grade?

Thanks, Ondrej.

-------- Original Message --------
Subject: "hang-up in C-code in" - possible solution
Date: Wed, 15 Aug 2007 16:36:58 +0100
From: Krzysztof Foltman <>

It's probably too late for this, but I think I've found the reason your
code hangs under profiler.

You need to temporarily block the SIGPROF signal with pthread_sigmask or
sigprocmask for the time of system() or fork(), otherwise the profiler
causes those functions to hang indefinitely.


Ondrej Bojar ( /
TagsNo tags attached.
Attached Files

2022-02-09 12:38   
This appears to affect stage 2 compilers when bootchecking in .prof grades.

Issue History
2007-09-27 23:55anonymousNew Issue
2009-12-11 06:51juliensfSummarycode haning in => code hanging in
2022-02-09 12:38juliensfNote Added: 0001172