home *** CD-ROM | disk | FTP | other *** search
- Submitted-by: wulkan@vnet.IBM.COM (Mike Wulkan)
-
- Let me set the stage:
-
- 1) ANSI C Standard Section 4.10.4.1 abort():
- "...causes abnormal program termination to occur, unless the signal
- SIGABRT is being caught and the signal handler does not return. ...
- is returned to the host environment by means of the function call
- raise(SIGABRT)."
-
- 2) Posix .4a Section 2.2.1.136:
- "Asynchronously generated signal: A signal which is not
- attributable to a specific thread. Examples are signals sent via
- kill(), ..."
-
- 3) Posix .4a Section 8.4.6.2:
- "The C standard raise() function... The effect of this function in
- a POSIX.4a process shall be equivalent to calling
- kill(getpid(),sig). The signal specified shall be asynchronously
- generated, regardless of the signal number, providing the signal
- number is valid."
-
- I think that it is pretty clear from the above that abort() causes an
- asynchronous SIGABRT signal to be generated. So how do you achieve the
- semantics required by (1) if the SIGABRT signal is delivered to a thread
- other than the one that issued the abort() call? What you end up with
- is a race condition between the thread that is executing the SIGABRT
- signal handler and the thread that issued the abort() function call
- terminating the program! AND the method of exiting the signal handling
- function has NO influence on whether the program will be terminated.
- This is a direct violation of ANSI C.
-
- Even in the case where the SIGABRT signal is delivered to the same
- thread that issued the abort() function call, since the signal is
- asynchronous, there is NO guarantee that it will be delivered before the
- abort() function initiates termination of the program.
-
- Can someone please point out something in the ANSI, POSIX.1 and/or
- POSIX.4a that gets me out of this quandary?
-
- Thanks,
-
- Mike Wulkan
-
-
- Volume-Number: Volume 31, Number 53
-
-