|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 1141 Details
Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges
This page provides all information on Problem Report 1141.
Report 1141 Actions
Problem Report Number 1141 Submitter's Classification Test Suite problem State Resolved Resolution Rejected (REJ) Problem Resolution ID REJ.X.0343 Raised 1970-01-01 08:00 Updated 2003-03-13 08:00 Published null Product Standard Internationalised System Calls and Libraries Extended (UNIX 95) Certification Program The Open Brand certification program Test Suite VSU version 4.1.1 Test Identification base/atexit 1 Problem Summary PG4U.00129 This IR claims that the operating system may use up some of the allowed ATEXIT_MAX slots. Problem Text
The API
int atexit(void (*func)(void))
registers the function pointed to by func to be called without arguments
at normal process termination (defined as either a call to exit() or a
return from main().
The VSU4 test tries to test the assertion that at least ATEXIT_MAX
functions can be registered for an application with atexit(). The
VSU4 test code attempts to test this assertion by trying to explicitly
register functions ATEXIT_MAX times.
We believe that the test is defective for the following reasons:
- The specifications say that "There is no way for an application to tell
how many functions have already been registered with atexit()."
- The test assumes that ATEXIT_MAX is the number of functions that
a application can register with atexit().
- The specifications state that ATEXIT_MAX is the total number of
functions that can be registered with atexit(). This includes
functions that may be registered by the operating system on
behalf of the application.
- Therefore, the test makes assumptions that are unsupported by the
specifications. When the operating system registers functions for
the application, the number of additional functions that the
application can register will be less than ATEXIT_MAX. Since there
is no way for an application to tell how many functions have
already been registered with atexit(), the assertion that
the ATEXIT_MAX functions can be registered for the application is
untestable.Test Output
TEST CASE: atexit
TEST PURPOSE #1
An implementation shall support the registration of
ATEXIT_MAX functions using calls to int atexit(void
(*func)(void)).
PREP: Obtain value returned by sysconf(_SC_ATEXIT_MAX)
INFO: sysconf(_SC_ATEXIT_MAX) = 32
PREP: Allocate space for internal buffer
PREP: Create a temporary file
PREP: Fork a child
PREP: Wait for child
PREP: Open the temporary file
TEST: ATEXIT_MAX functions were invoked and wrote to the file
ERROR: Expected ATEXIT_MAX(32) functions to have been invoked, found 30
CLEANUP: Free the internal buffer
CLEANUP: Close and remove the temporary file
TEST: atexit() can be called ATEXIT_MAX times
ERROR: Atexit failed on call number 31, ATEXIT_MAX is 32, returned = 32
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
PREP: Open the temporary file
PREP: Write to the temp file
CLEANUP: Close the temporary file
1 FAILReview Information
Review Type TSMA Review Start Date null Completed null Status Complete Review Recommendation No Resolution Given Review Response
We recommend this request be refused.
While an application cannot determine how many functions have already
been registered for atexit(), an application must be able to define
ATEXIT_MAX functions to be called at exit so long as it keeps track of
how many functions have been defined.
The standard defines limits on applications not on the operating system.
The <limits.h> description describes the symbolic names such as ATEXIT_MAX
as follows:
The names represent limits on resources the system imposes on
applications.
This provides limits for applications only. It does not include those
resources used by the operating system.
In <limits.h>, ATEXIT_MAX is defined as follows:
Maximum number of functions that may be registered with atexit().
This implementation is imposing a more restrictive limit on the
application than its ATEXIT_MAX value, which is non conforming.
The operating system cannot define functions to be used with atexit()
on behalf of the application because doing so destroys the value and
portability of ATEXIT_MAX. A portable application would not be able
to reliably allocate ATEXIT_MAX functions as allowed by the standard.
Since no errors are defined for the atexit(), there would be no
reliable indication that the operating system failed to assign the
requested functions.
If the operating system wants functions to be executed at process
termination it needs to use other mechanisms to effect this, and not
using up atexit() slots which the spec defines for application use.
Review Type SA Review Start Date null Completed null Status Complete Review Resolution Rejected (REJ) Review Conclusion
This request is refused.
Problem Reporting System Options:
- View Report 1141
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority