Menu

#1 Fix signal handler

open-later
nobody
None
1
2007-07-03
2007-02-22
No

The function "exit()" does not belong to the list of async-signal-safe functions.
See section "2.4.3 Signal Actions" from the document "2.4 Signal Concepts".
http://opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04_03
http://opengroup.org/onlinepubs/009695399/functions/_Exit.html

Should this call be replaced by a safe alternative in your function "hupHandler"?
http://mstone.svn.sourceforge.net/viewvc/mstone/trunk/mstone/src/sysdep.c?revision=7&view=markup

Discussion

  • Dan Christian

    Dan Christian - 2007-07-03

    Logged In: YES
    user_id=865423
    Originator: NO

    This could only be a problem if a protocol registers an atexit callback (none do this currently), and signals arrive too fast for the process to finish exiting. Our current signaling code leaves more than a second between signal attempts.

    This has never shown up as a problem in practice (give me an example if you've seen it).

    I'm going to leave the code as-is.

     
  • Dan Christian

    Dan Christian - 2007-07-03
    • status: open --> open-wont-fix
     
  • Dan Christian

    Dan Christian - 2007-07-03
    • status: open-wont-fix --> closed-wont-fix
     
  • Markus Elfring

    Markus Elfring - 2007-07-03
    • status: closed-wont-fix --> open-later
     
  • Markus Elfring

    Markus Elfring - 2007-07-03

    Logged In: YES
    user_id=572001
    Originator: YES

    I suggest to develop POSIX compliant source code. Would you like to avoid undefined behaviour?

     
  • Dan Christian

    Dan Christian - 2007-07-03

    Logged In: YES
    user_id=865423
    Originator: NO

    I can't look into this bug without information on how to reproduce it.

     
  • Dan Christian

    Dan Christian - 2007-07-03
    • priority: 5 --> 1
     
  • Markus Elfring

    Markus Elfring - 2007-07-03

    Logged In: YES
    user_id=572001
    Originator: YES

    The mistake is that the function "exit()" is called by a signal handler at the moment. "_Exit()" must be used instead.

     

Log in to post a comment.