WG15 Defect Report Ref: 13210-15
Topic: abort() and SIGABRT ignore/block/caught


This is an approved interpretation of 13210:1994.

.

Last update: 1997-05-20


								13210-92  #15

	Class: Defect situation

This has identified a difference between 13210 and 9945-1.

The 13210 standard clearly states that a conforming test suite
must test abort() as stated in the document, but the base standard (9945-1)
indicates that such a test reflects a non-conforming implementation.
This is being referred to the sponsor for consideration as
a future amendment.

 _____________________________________________________________________________


	Topic:			abort() and SIGABRT ignore/block/caught
	Relevant Sections:	8.2.3


Defect Report:
-----------------------
  Does a call to abort() for the cases:
     (1) SIGABRT signal is being ignored,
     (2) SIGABRT signal is being blocked,
     (3) SIGABRT signal is being caught and catching function returns
  ALWAYS terminate the calling process with SIGABRT?

Discussion:
The following assertions are those of Subclause 8.1.49, abort():

 03(A) A call to abort() which terminates the process with SIGABRT has the
       effect of a call to fclose() on every open stream.
         
 04(A) When the SIGABRT signal is being ignored or blocked, or is being caught
       and the catching function returns, then a call to abort() which
       terminates the process with SIGABRT has the effect of a call to
       fclose() on every open stream.

The text "which terminates" of Assertion "04" specifies, for the cases
stated, that a SIGABRT may not result in the termination of the process.

This is contrary to the text of ISO/IEC 9945-1:1990:
  Subclause B8.2.3.12:
    POSIX.1 intends that processing related to the abort() function
    will occur unless "the signal SIGABRT is being caught, and the signal
    handler does not return," as defined by the C standard. This processing
    includes at least the effect of fclose() on all open streams and the
    default actions defined for SIGABRT.

    The abort() function will override blocking or ignoring the SIGABRT
    signal. Catching the signal is intended to provide the application
    writer with a portable means to abort processing, free from possible
    interference from any implementation-provided library functions.

  Subclause 8.2.3.12:
    ... The C Standard {2} specifies the conditions where abort() does
    or does not cause process termination. ...

  C Standard, Subclause 4.10.4:
    The abort function causes abnormal program termination to occur, unless
    the signal SIGABRT is being caught and the signal handler does not return.
    ... An implementation-defined form of the status unsuccessful termination
    is returned to the host environment by means of the function call 
    raise(SIGABRT).

    ... The abort function cannot return to its caller.

The above quoted text is clear that for the cases cited in "04":
   (1) SIGABRT signal is being ignored,
   (2) SIGABRT signal is being blocked,
   (3) SIGABRT signal is being caught and the catching function returns.
The call to abort() is required to raise the SIGABRT signal and the calling
process is required to terminate.

Therefore, "04" must be corrected to properly state the requirements of POSIX.1
in the format of POSIX.3.1.
 04(A) When the SIGABRT signal is being ignored or blocked, or is being caught
       and the catching function returns, then a call to abort() 
       terminates the process with SIGABRT and has the effect of a call to
       fclose() on every open stream.

       Testing Requirements:
         Test for SIGABRT signal being ignored, blocked, and being caught
         with the catching function returning.

Assertion "03" is a restatement of the updated assertion "04" without 
particulars.  This should now be treated as a reference assertion.

 R01  A call to abort() which terminates the process with SIGABRT has the
      effect of a call to fclose() on every open stream.  [See Assertion(s) 
      4 in 8.1.49.2]

WG15 response for 13210:1994
-----------------------------------

The test method standard clearly states that a conforming test suite
must test abort() as stated in the document, but the base standard
indicates that such a test reflects a non-conforming implementation.

This is being referred to the
sponsor for clarifying wording in the next amendment, with the suggested
action being the action stated in the original text above.

Rationale for Interpretation:
-----------------------------
None.

Editorial note for future revision of standard (not part of the interpretation)
-------------------------------------------------------------------------------
The correction  should be made as stated in the original request above.
 _____________________________________________________________________________