bug-make
[Top][All Lists]
Advanced

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

RE: Deadlock in signal handler


From: Martin Dorey
Subject: RE: Deadlock in signal handler
Date: Wed, 15 Mar 2017 22:22:25 +0000

> What do you think about this issue? How can I fix it?

Well titled, precise, concise and horribly plausible.  A great write up then.  
One that I think deserves a bug report at 
https://savannah.gnu.org/bugs/?group=make, if you wouldn't mind.  That 
fatal_error_signal handler looks repeatedly and hopelessly in violation of the 
signal-safe function list at eg 
http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04_03.
  Perhaps there's somewhere in the foreground code that make visits regularly 
and often, which could test a flag set by the signal handler.  But I doubt it.  
Make is such a portable program that the idea of having a thread lying around 
to service such things isn't, I imagine, going to fly.  The only plausible idea 
I've thought of is using alarm(), a signal-safe function, as a dead man's 
handle: if the fatal_error_signal handler deadlocks, SIGALRM could be used to 
suicide within a bounded time.  Your children wouldn't have been terminated and 
intermediate targets wouldn't have been removed, but who really relies on eg 
half-written .o files being automatically deleted?  Surely such people 
eventually get bitten by fail-stops like power outages.  I note that SIGALRM is 
conditionally used elsewhere in the code, but not, I think, on my platform, 
which I suspect is roughly the same as yours.  Perhaps this Morton's Gambit 
will provoke a response from someone more clueful.



reply via email to

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