Report 1615 Actions
Problem Report Number |
1615 |
Submitter's Classification |
Specification problem |
State |
Resolved |
Resolution |
Permanent Interpretation (PIN) |
Problem Resolution ID |
PIN.X.0172 |
Raised |
1996-10-29 08:00 |
Updated |
2003-03-13 08:00 |
Published |
1996-11-14 08:00 |
Product Standard |
Internationalised System Calls and Libraries Extended (UNIX 95) |
Certification Program |
The Open Brand certification program |
Test Suite |
VSU version 4.1.0 |
Test Identification |
CAPI.os/procprim/sigaction 13,25,26,27,39 |
Specification |
System Interfaces and Libraries Issue 4 Version 2 |
Location in Spec |
See Problem Text |
Problem Summary |
PIN4U.00038 This request claims SIGCHLD need not be generated when SA_NOCLDWAIT is used. |
Problem Text |
The question of if a SIGCHLD should be generated when the parent sets up a signal handler with SA_NOCLDWAIT set is unspecified in the X/Open specification.
All of the failed tests setup a handler to catch SIGCHLD, similar to:
struct sigaction act; act.sa_flags |= SA_NOCLDWAIT; act.sa_sigaction = test_sig_handler; sigaction(SIGCHLD, &act, 0);
These tests all fork a child, and the child process terminates, either by calling exit() or sending itself a signal via kill(). The parent then expects to see the handler called for SIGCHLD.
The XSH4v2 specification does not specify when a SIGCHLD signal is to be generated. Our implementation generates a SIGCHLD when a process becomes a zombie. The sigaction() description of the SA_NOCLDWAIT flag says that zombies will not be formed. We therefore believe these tests are testing beyond the specification.
Further comment appealing against initial refusal ------------------------------------------------ We would like to appeal against the decision to refuse req.4.U.00331 against VSU CAPIbase/sigaction tests 13, 25-27, and 39.
The consultant claims that the specification states that a SIGCHLD is generated whenever a child process is terminated or stopped and that the discussion of the SA_NOCLDWAIT flag is solely in terms of whether or not zombie processes are generated. We disagree based on the following additional information contained in the XSH4.2 specification for exit():
"If the parent process has set its SA_NOCLDWAIT flag, or set SIGCHLD to SIG_IGN, the status will be discarded, and the lifetime of the calling process will end immediately."
Given this, we would not expect a SIGCHLD to be generated when the SA_NOCLDWAIT flag is set as it is for the tests in question.
Can you please give this waiver further consideration?
|
Test Output |
TEST CASE: sigaction
TEST PURPOSE #13 After a call to int sigaction(int sig, const struct sigaction *act, struct sigaction *oact) when SA_NOCLDWAIT is set in the sa_flags member of the structure pointed to by act and sig is SIGCHLD, child processes of the calling process shall not be transformed into zombie processes when they terminate. PREP: Set up action for SIGCHLD PREP: fork() a child that does nothing but exit ERROR: Timed out waiting for signal 13 FAIL
TEST PURPOSE #25 After a call to int sigaction(int sig, const struct sigaction *act, struct sigaction *oact) with SA_SIGINFO set in the sa_flags member of the sigaction structure pointed to by act and sig equal to SIGCHLD, on entry to the signal catching function specified by the sa_sigaction member when the child exited the si_code member of the structure pointed to by the siginfo argument shall contain CLD_EXITED, the si_pid member shall contain the child process ID, the si_status member shall contain the child's exit value and the si_uid member shall contain the real user ID of the process that sent the signal. PREP: Set up action for SIGCHLD PREP: fork() a child that exits normally ERROR: Timed out waiting for signal 25 FAIL TEST PURPOSE #26 After a call to int sigaction(int sig, const struct sigaction *act, struct sigaction *oact) with SA_SIGINFO set in the sa_flags member of the sigaction structure pointed to by act and sig equal to SIGCHLD, on entry to the signal catching function specified by the sa_sigaction member when the child was killed the si_code member of the structure pointed to by the siginfo argument shall contain CLD_KILLED, the si_pid member shall contain the child process ID, the si_status member shall contain the child's signal, the si_uid member shall contain the real user ID of the process that sent the signal and no core file shall be present. PREP: Set up action for SIGCHLD PREP: fork() a child that kills itself PREP: Generate SIGUSR1 from child ERROR: Timed out waiting for signal 26 FAIL
TEST PURPOSE #27 If the implementation supports a signal which causes abnormal process termination and the generation of a core file: After a call to int sigaction(int sig, const struct sigaction *act, struct sigaction *oact) with SA_SIGINFO set in the sa_flags member of the sigaction structure pointed to by act and sig equal to SIGCHLD, on entry to the signal catching function specified by the sa_sigaction member when the child terminated abnormally with a signal that causes generation of a core file the si_code member of the structure pointed to by the siginfo argument shall contain CLD_DUMPED, the si_pid member shall contain the child process ID, the si_status member shall contain the child's signal, the si_uid member shall contain the real user ID of the process that sent the signal and a core file shall be present. PREP: Obtain the configuration parameter VSU_SIGNAL_GENERATING_CORE PREP: Set up action for SIGCHLD PREP: fork() a child that dumps itself PREP: generate SIGILL from child ERROR: Timed out waiting for signal 27 FAIL
TEST PURPOSE #39 If the implementation supports a signal which causes abnormal process termination but does not cause the generation of a core file: After a call to int sigaction(int sig, const struct sigaction *act, struct sigaction *oact) with SA_SIGINFO set in the sa_flags member of the sigaction structure pointed to by act and sig equal to SIGCHLD, on entry to the signal catching function specified by the sa_sigaction member when the child terminated abnormally with a signal does not cause generation of a core file the si_code member of the structure pointed to by the siginfo argument shall contain CLD_KILLED, the si_pid member shall contain the child process ID, the si_status member shall contain the child's signal, the si_uid member shall contain the real user ID of the process that sent the signal and a core file shall not be present. PREP: Set up action for SIGCHLD PREP: fork() a child that ends abnormally PREP: generate SIGALRM from child ERROR: Timed out waiting for signal 39 FAIL
|
Review 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.
We believe these tests are correct as written.
The specification states that a SIGCHLD is generated when a child process is terminated or stopped. We believe the spec's discussion of SA_NOCLDWAIT is solely in terms of whether zombie processes are generated, with no mention of any delta to the need to generate the signal.
Further response ---------------- As written the spec defines two separate mechanisms for controlling the consequences of child termination:
SIGCHLD set to SIG_IGN - do not create zombies, do not signal
SA_NOCLDWAIT - do not create zombies, do signal
To our understanding it is existing practice that these mechanisms are used by applications to achieve one of these effects and changing the semantics of SA_NOCLDWAIT will thus break application portability. An application programmer would set SIGCHLD to SIG_IGN if they did not wish to receive a signal, and would be rather surprised if SA_NOCLDWAIT suddenly starts having that consequence.
We also don't see the exit() specification text quoted says anything about not signalling. From the other bullets in the list that discuss SA_NOCLDWAIT what is being referred to here is the impact on wait() and its friends, with SIGCHLD generation mentioned. Further, the bullet in that same list vis SIGCHLD generation contains no caveat about SA_NOCLDWAIT,
o If the implementation supports the SIGCHLD signal, a SIGCHLD will be sent to the parent process.
And one final citation, the spec defines SA_NOCLDWAIT (in signal.h) as:
SA_NOCLDWAIT Causes implementations not to create zombie processes on child death.
Again there is no discussion of SIGCHLD here. All in all we see a clear black and white distinction between the two mechanisms, and application portability significance, and thus no basis for a grey area waiver.
|
Review Type |
Expert Group Review |
Start Date |
null |
Completed |
null |
Status |
Complete |
Review Resolution |
No Resolution Given |
Review Conclusion |
We agree with the originator that it is a grey area. Two statements are in conflict on the exit() page. In a future direction these two statements will be moved together, and a note added about the generation of SIGCHLD being implementation defined.
o If the implementation supports the SIGCHLD signal, a SIGCHLD will be sent to the parent process. o If the parent process has set its SA_NOCLDWAIT flag, or set SIGCHLD to SIG_IGN, the status will be discarded and the lifetime of the calling process will end immediately. If SA_NOCLDWAIT is set, it is implementation defined whether a SIGCHLD signal will be sent to the parent process.
|
Review Type |
SA Review |
Start Date |
null |
Completed |
null |
Status |
Complete |
Review Resolution |
Permanent Interpretation (PIN) |
Review Conclusion |
A Permanent Interpretation is granted.
|
Problem Reporting System Options:
|