Bug: deadlock from msyslog

Hal Murray hmurray at megapathdsl.net
Tue Mar 22 06:25:00 UTC 2016

gem at rellim.com said:
> Check out "man 7 signal", almost nothing is legal to call from within a
> signal.  You can't even open() of fopen() anything.  About the best you can
> do is write(STDERR,) and exit(). 

Right.  I was wondering if there was any software that would check that.

For ntpd, writing to STDERR doesn't work since it's a daemon and has nuked 
STDOUT and STDERR.  syslog(3) isn't on the approved list.

The call restrictions mean that you can't longjmp out of a signal unless you 
know you were't doing anything dangerous when the signal went off.  After the 
jump, you are still in the signal handler.  On the other hand, it mostly 
works so all sorts of web pages show you how to do it without mentioning the 
restrictions.  In the case of ntpq, it's likely to be doing a DNS lookup.

These are my opinions.  I hate spam.

More information about the devel mailing list