Fix signal handler
SF Markus Elfring
elfring at users.sourceforge.net
Sun Sep 23 15:51:36 CEST 2012
Hello,
I suggest to look at the implementation of the function "ev_sighandler" again.
http://cvs.schmorp.de/libev/ev.c?revision=1.448&view=markup#l2029
It calls the function "ev_feed_signal" which works with the global array
"signals". I find that the use of this data type is not async-signal-safe for a
strictly conforming program.
https://www.securecoding.cert.org/confluence/display/seccode/SIG31-C.+Do+not+access+or+modify+shared+objects+in+signal+handlers
Does it cause a race condition eventually?
http://cwe.mitre.org/data/definitions/364.html
Would you like to look for alternative interfaces which will enable the desired
data exchange in a safe and robust way?
Regards,
Markus
More information about the libev
mailing list