[OLSR-users] Spurios crashes (SIGSEGV) on exit in 0.5.0 (and earlier)

Joerg Pommnitz (spam-protected)
Tue May 8 15:34:10 CEST 2007


Hello all,
I just bothered to look at spurious crashes I have observed with olsrd for a long time.

It turns out that olsr_shutdown gets called from signal context and uses
forbidden library calls. The crash I observed was in vsyslog, but I'm sure
other things could go wrong as well. In Unix only a very limited subset of
C library functions is signal safe and may be used from signal handlers (see http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html
for the full list).

Looking at olsr_shutdown gave me a creepy feeling. This function must never
be called from a signal context. The right way would be to handle this signal
synchronous.

In Unix you can turn an asynchronous signal into a synchronous notification by
opening a pipe and writing the signal number in the write end and poll the read end
for activity (write is signal safe).
 
--  
Regards
 
       Joerg
 






      Heute schon einen Blick in die Zukunft von E-Mails wagen? Versuchen SieĀ“s mit dem neuen Yahoo! Mail. www.yahoo.de/mail




More information about the Olsr-users mailing list