HomeAbout Us A-Z IndexSearch * Contact Us Register LoginPress Shop

The Open Brand -- Problem Reporting and Interpretations System


Problem Report 1597 Details

Help Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges

This page provides all information on Problem Report 1597.


Report 1597 Actions


    Problem Report Number 1597
    Submitter's Classification Specification problem
    State Resolved
    Resolution Permanent Interpretation (PIN)
    Problem Resolution ID PIN.X.0154
    Raised 1996-03-12 08:00
    Updated 2003-03-13 08:00
    Published 1996-03-18 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 3, 4, 5, 25, 26, 27, 29, 30, 31, 32, 35, 36
    Specification System Interfaces and Libraries Issue 4 Version 2
    Location in Spec See Problem Text
    Problem Summary PIN4U.00020 This test may fail on implementations because of a gray area in the specification as to whether siginfo_t can be null or not.
    Problem Text
    This test may fail on implementations because of a gray area
    in the specification as to whether siginfo_t can be null or not.

    These tests are failing because they assume after a call to
    sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
    the argument act cannot be set to a null pointer. Setting act to
    a null pointer is supported by the XPG4 V2 XSH specification, on
    page 546 it states

    "... If the second argument is not a null pointer, it will point to
    an object of type siginfo_t explaining the the reason why the signal
    was generated...."

    This was further clarified in the Interpretation Request included
    below.

    ______________________________________________________________________
    +Resolution Request ref : 1170/147
    Publication : XSH4 V2
    Interface : SA_SIGINFO
    Date requested : 29.10.95
    Status : Open
    _______________________________________________________________________
    [Request text starts]
    In the description of the sigaction() function flag SA_SIGINFO [XSH.
    page 546] is the specification for the signal handling function and its
    second argument:

    If SA_SIGINFO is set and the signal is caught, the signal
    catching function will be entered as

    void func(int signo, siginfo_t *info, void *context);

    where two additional arguments are passed to the signal catching
    function. If the second argument is not a null pointer, it will
    point to an object of type siginfo_t explaining the reason why
    the signal was generated; the third argument....

    Further into the document, [page 549] under the "pointer to a function"
    subsection of "Signal Actions":

    If SA_SIGINFO is set, the signal catching function will be
    entered as:

    void func(int signo, siginfo_t *info, void *ucontextptr);

    where func is the signal catching function, signo is the signal
    number of the signal being delivered, siginfo points to an
    object of type siginfo_t associated with the signal being
    delivered, and ucontextptr points to a ucontext_t.

    In the signal.h section [page 799] it mentions:

    In addition, the following signal-specific information will be
    available:

    SIGILL void *si_addr address of faulting instr.
    SIGFPE

    SIGSEGV void *si_addr address of faulting refer.
    SIGBUS

    SIGCHLD pid_t si_pid child process ID
    int si_status exit value or signal
    uid_t si_uid real UID of process sending sig

    SIGPOLL long si_band band event


    In light of these three references:

    Can the pointer of the second argument returned by func() be null?

    It is our belief that it can indeed be null (and our vague recollection
    that this was also the intent of the COSE working group); depending upon
    the pipeline length of instructions before the signal was delivered
    (among other possibilities, depending upon system architecture) the
    information may no longer be available. These references, however,
    suggest a formal interpretation be made.

    Our suggested interpretation is that the first reference stands, the
    third reference means "will be available if the pointer is non-null",
    and the second reference merely restates the function prototype.

    [Request text ends]

    [Resolution response]

    1003.1b-1993 implies it cannot be non-null and this should be fixed
    for XPGNEXT.
    For the current specification the proposed resolution is acceptable.

    Test Output
    TEST CASE: sigaction

    TEST PURPOSE #3
    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 the signal catching
    function specified by the sa_handler member of the
    structure shall be entered as follows:
    void func(int signo, siginfo_t *info, void
    *ucontextptr);
    where func is the specified signal-catching routine,
    signo is the number of the signal being delivered,
    info points to an object of type siginfo_t whose
    si_signo member contains the signal number, and
    ucontextptr points to a ucontext_t
    PREP: Fork child to test sig=30 (SIGUSR1)
    PREP: Child: Set signal handler for 'SIGUSR1'
    PREP: Child: pause to wait for signal
    TEST: Sh_SIGINFO: test the 3 args passed to the signal handler
    ERROR: Second argument to signal handler was unexpectedly NULL
    TEST: Parent: send 'SIGUSR1' to child
    3 FAIL

    TEST PURPOSE #4
    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 on entry to the signal
    catching function specified by the sa_handler member
    of the structure the si_code member of the siginfo_t
    pointed to be info passed to the function shall
    contain a code indicating the cause of the signal.
    PREP: Set up action for SIGCHLD
    PREP: fork a child that does nothing but exit
    TEST: signal = SIGCHLD
    ERROR: Second argument to signal handler was unexpectedly NULL
    4 UNRESOLVED

    TEST PURPOSE #5
    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 on entry to the signal
    catching function specified by the sa_handler member
    of the structure when the signal was generated by a
    process the si_code member of the siginfo_t pointed to
    by info passed to the function shall be less than or
    equal to 0 and the si_pid and si_uid members shall
    contain the process ID and real user ID, respectively,
    of the sender.
    PREP: Fork child to test sig=30 (SIGUSR1)
    PREP: Child: Set signal handler for SIGUSR1 and block
    TEST: signal = SIGUSR1
    ERROR: Second argument to signal handler was unexpectedly NULL
    5 UNRESOLVED

    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_handler 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
    TEST: signal = SIGCHLD
    ERROR: Second argument to signal handler was unexpectedly NULL
    25 UNRESOLVED

    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_handler 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
    TEST: signal = SIGCHLD
    ERROR: Second argument to signal handler was unexpectedly NULL
    26 UNRESOLVED

    TEST PURPOSE #27
    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_handler member when the child terminated
    abnormally 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: Set up action for SIGCHLD
    PREP: fork() a child that dumps itself
    PREP: generate SIGSEGV from child
    TEST: signal = SIGCHLD
    ERROR: Second argument to signal handler was unexpectedly NULL
    27 UNRESOLVED

    TEST PURPOSE #29
    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_handler member when the child has stopped the
    si_code member of the structure pointed to by the
    siginfo argument shall contain CLD_STOPPED, the si_pid
    member shall contain the child process ID, the
    si_status member shall contain the child's
    signal 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 stops itself
    PREP: Generate SIGSTOP from child
    TEST: signal = SIGCHLD
    ERROR: Second argument to signal handler was unexpectedly NULL
    CLEANUP: Set up SIG_IGN for SIGCHLD
    CLEANUP: Send SIGUSR1 to child
    29 UNRESOLVED

    TEST PURPOSE #30
    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_handler member when the stopped child has
    continued the si_code member of the structure pointed
    to by the siginfo argument shall contain
    CLD_CONTINUED, the si_pid member shall contain the
    child process ID, the si_status member shall contain
    the child's signal 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 stops itself
    PREP: Set up action for SIGCHLD
    TEST: Send SIGCONT to child
    TEST: signal = SIGCHLD
    ERROR: Second argument to signal handler was unexpectedly NULL
    30 UNRESOLVED

    TEST PURPOSE #31
    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 SIGPOLL,
    on entry to the signal catching function specified by
    the sa_handler member when data input is available the
    si_code member of the structure pointed to by the
    siginfo argument shall contain POLL_IN and the si_band
    member shall contain the band event.
    PREP: Create a pipe
    PREP: Determine if pipe is a stream
    INFO: Pipes are not STREAMs on this implementation
    PREP: Open 2 spx drivers and create pipe
    PREP: Set up action for SIGPOLL
    PREP: Register for SIGPOLL
    PREP: Generate SIGPOLL
    TEST: si_code field correct
    ERROR: si_code incorrect
    Expected 40
    Received 0
    31 FAIL

    TEST PURPOSE #32
    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 SIGPOLL,
    on entry to the signal catching function specified by
    the sa_handler member when output buffers are
    available the si_code member of the structure pointed
    to by the siginfo argument shall contain POLL_OUT and
    the si_band member shall contain the band event.
    PREP: Create a pipe
    PREP: Determine if pipe is a stream
    INFO: Pipes are not STREAMs on this implementation
    PREP: Open 2 spx drivers and create pipe
    PREP: Set up action for SIGPOLL
    PREP: Register for SIGPOLL
    PREP: Set O_NONBLOCK on read and write end of STREAM
    PREP: Generate SIGPOLL
    TEST: si_code field correct
    ERROR: si_code incorrect
    Expected 41
    Received 0
    32 FAIL

    TEST PURPOSE #35
    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 SIGPOLL,
    on entry to the signal catching function specified by
    the sa_handler member when high priority input is
    available the si_code member of the structure pointed
    to by the siginfo argument shall contain POLL_PRI.
    PREP: Create a pipe
    PREP: Determine if pipe is a stream
    INFO: Pipes are not STREAMs on this implementation
    PREP: Open 2 spx drivers and create pipe
    PREP: Set up action for SIGPOLL
    TEST: ioctl returns other than -1
    PREP: Generate S_HIPRI SIGPOLL signal
    TEST: si_code field correct
    ERROR: si_code incorrect
    Expected 44
    Received 0
    35 FAIL

    TEST PURPOSE #36
    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 SIGPOLL,
    on entry to the signal catching function specified by
    the sa_handler member when a device has disconnected
    the si_code member of the structure pointed to by the
    siginfo argument shall contain POLL_HUP.
    PREP: Create a pipe
    PREP: Determine if pipe is a stream
    INFO: Pipes are not STREAMs on this implementation
    PREP: Open 2 spx drivers and create pipe
    PREP: Set up action for SIGPOLL
    PREP: Register for SIGPOLL
    PREP: Generate S_HANGUP SIGPOLL signal
    TEST: si_code field correct
    ERROR: si_code incorrect
    Expected 45
    Received 0
    36 FAIL

    Review Information

    Review Type TSMA Review
    Start Date null
    Completed null
    Status Complete
    Review Recommendation No Resolution Given
    Review Response
    A permanent interpretation is recommended.

    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:

     

    Back   


Contact the Certification Authority