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

The Open Brand -- Problem Reporting and Interpretations System


Problem Report 1561 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 1561.


Report 1561 Actions


    Problem Report Number 1561
    Submitter's Classification Test Suite problem
    State Resolved
    Resolution Test Suite Deficiency (TSD)
    Problem Resolution ID TSD.X.0843
    Raised 2001-09-24 08:00
    Updated 2003-03-13 08:00
    Published 2001-10-04 08:00
    Product Standard Internationalised System Calls and Libraries Extended V2 (UNIX 98)
    Certification Program The Open Brand certification program
    Test Suite VSU version 5.1.2
    Test Identification CAPI.hdr/misc/socket 80
    Problem Summary TSD4U.00304 The test fails on systems where CMSG_NXTHDR() does not align cmsghdr structures in the same way as the C compiler.
    Problem Text
    From L.socket the following is the definition of "testanc".

    struct test257 {
    struct cmsghdr cmsghdr;
    unsigned char data[257];
    };
    struct test10 {
    struct cmsghdr cmsghdr;
    unsigned char data[10];
    };
    struct test1 {
    struct cmsghdr cmsghdr;
    unsigned char data;
    };
    struct {
    struct test10 test10;
    struct test257 test257;
    struct test1 test1;
    } testanc;

    From test80A() the following is the code that fails:

    testanc.test10.cmsghdr.cmsg_len = sizeof(struct test10);
    testanc.test257.cmsghdr.cmsg_len = sizeof(struct test257);
    testanc.test1.cmsghdr.cmsg_len = sizeof(struct test1);
    testmsg.msg_control = &testanc;
    testmsg.msg_controllen = sizeof(testanc);

    if ((dummy = CMSG_NXTHDR(&testmsg, &testanc.test10.cmsghdr)) != &testanc.test257.cmsghdr) {
    sprintf((char *)&ebuf[0], "ERROR: For first cmsghdr expected %p, received %p", (void *)&testanc.test257.cmsghdr, (void *)dummy);
    puts(ebuf);
    result_flags |= 1; /* FAIL */
    }

    if ((dummy = CMSG_NXTHDR(&testmsg, &testanc.test257.cmsghdr)) !=
    &testanc.test1.cmsghdr) {
    sprintf((char *)&ebuf[0], "ERROR: For second cmsghdr expected %p, received %p", (void *)&testanc.test1.cmsghdr, (void *)dummy);
    puts(ebuf);
    result_flags |= 1; /* FAIL */
    }

    if ((dummy = CMSG_NXTHDR(&testmsg, &testanc.test1.cmsghdr)) != 0) {
    sprintf((char *)&ebuf[0], "ERROR: For third cmsghdr expected NULL, received %p", (void *)dummy);
    puts(ebuf);
    result_flags |= 1; /* FAIL */
    }
    /* PASS */;

    The failures occur because in 64-bit mode the CMSG_NXTHDR macro ensures that all
    ancillary data items start on a 64-bit boundary. The C compiler only does this
    if the structure contains an element that needs a 64-bit boundary which none of
    structs test1, test10 or test257 do. There is nothing in the standard that
    expresses or implies that the cmsg memory ordering is identical to the C
    compiler ordering. Here is the relevent text from the <sys/socket.h> page of
    XNS5.2.

    The <sys/socket.h> header defines the following macros to gain
    access to the data arrays in the ancillary data associated with a
    message header:

    CMSG_DATA(cmsg)
    If the argument is a pointer to a cmsghdr structure, this
    macro returns an unsigned character pointer to the data
    array associated with the cmsghdr structure.
    CMSG_NXTHDR(mhdr,cmsg)
    If the first argument is a pointer to a msghdr structure
    and the second argument is a pointer to a cmsghdr structure
    in the ancillary data, pointed to by the msg_control field
    of that msghdr structure, this macro returns a pointer to
    the next cmsghdr structure, or a null pointer if this
    structure is the last cmsghdr in the ancillary data.
    CMSG_FIRSTHDR(mhdr)
    If the argument is a pointer to a msghdr structure, this
    macro returns a pointer to the first cmsghdr structure in
    the ancillary data associated with this msghdr structure,
    or a null pointer if there is no ancillary data associated
    with the msghdr structure.

    Test Output
    ************************************************************************
    /tset/CAPI.hdr/misc/socket/T.socket 80 Failed

    Test Description:
    Base Required Conformance
    The macro CMSG_NXTHDR(mhdr, cmsg) shall be defined in sys/socket.h and
    evaluate to a pointer to the cmsghdr structure in the msg_control
    field of the msghdr structure pointed to by mhdr that follows the
    cmsghdr pointed to by cmsg or a NULL pointer if this is the last
    cmsghdr structure in the ancillary data.

    Test Information:
    Feature test macros: -D_XOPEN_SOURCE=500
    Compiler or run-time messages or results:
    ERROR: For first cmsghdr expected 20dcc, received 20dd0
    ERROR: For second cmsghdr expected 20edc, received 20ee0
    Feature test macros: -D_XOPEN_SOURCE=500 -D_POSIX_SOURCE
    Compiler or run-time messages or results:
    ERROR: For first cmsghdr expected 20dcc, received 20dd0
    ERROR: For second cmsghdr expected 20edc, received 20ee0
    Feature test macros: -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=1
    Compiler or run-time messages or results:
    ERROR: For first cmsghdr expected 20dcc, received 20dd0
    ERROR: For second cmsghdr expected 20edc, received 20ee0
    Feature test macros: -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=1
    -D_POSIX_SOURCE
    Compiler or run-time messages or results:
    ERROR: For first cmsghdr expected 20dcc, received 20dd0
    ERROR: For second cmsghdr expected 20edc, received 20ee0
    Feature test macros: -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=2
    Compiler or run-time messages or results:
    ERROR: For first cmsghdr expected 20dcc, received 20dd0
    ERROR: For second cmsghdr expected 20edc, received 20ee0
    Feature test macros: -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=2
    -D_POSIX_SOURCE
    Compiler or run-time messages or results:
    ERROR: For first cmsghdr expected 20dcc, received 20dd0
    ERROR: For second cmsghdr expected 20edc, received 20ee0
    Feature test macros: -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199309
    Compiler or run-time messages or results:
    ERROR: For first cmsghdr expected 20dcc, received 20dd0
    ERROR: For second cmsghdr expected 20edc, received 20ee0
    Feature test macros: -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199309
    -D_POSIX_SOURCE
    Compiler or run-time messages or results:
    ERROR: For first cmsghdr expected 20dcc, received 20dd0
    ERROR: For second cmsghdr expected 20edc, received 20ee0
    Feature test macros: -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506
    Compiler or run-time messages or results:
    ERROR: For first cmsghdr expected 20dcc, received 20dd0
    ERROR: For second cmsghdr expected 20edc, received 20ee0
    Feature test macros: -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506
    -D_POSIX_SOURCE
    Compiler or run-time messages or results:
    ERROR: For first cmsghdr expected 20dcc, received 20dd0
    ERROR: For second cmsghdr expected 20edc, received 20ee0

    ************************************************************************

    Review Information

    Review Type TSMA Review
    Start Date null
    Completed null
    Status Complete
    Review Recommendation No Resolution Given
    Review Response
    This is accepted as a fault in the test suite.

    Review Type SA Review
    Start Date null
    Completed null
    Status Complete
    Review Resolution Test Suite Deficiency (TSD)
    Review Conclusion
    This is an agreed Test Suite Deficiency.

    Problem Reporting System Options:

     

    Back   


Contact the Certification Authority