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

The Open Brand -- Problem Reporting and Interpretations System


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


Report 0332 Actions


    Problem Report Number 0332
    Submitter's Classification Specification problem
    State Resolved
    Resolution Permanent Interpretation (PIN)
    Problem Resolution ID PIN.X.0048
    Raised 1995-08-18 08:00
    Updated 2003-03-13 08:00
    Published 1995-09-23 08:00
    Product Standard Internationalised System Calls and Libraries (XPG4)
    Certification Program The Open Brand certification program
    Test Suite VSX4 version 4.3.5
    Test Identification XPG4.os/ipc/shmat 2
    Specification System Interfaces and Headers Issue 4
    Location in Spec See Problem Text
    Problem Summary PIN4.048 As is stated in the VSX 4.3.5 Release Notes, the XPG is unclear on the behavior of shmat(shmid, shmaddr, SHM_RND) on implementations with pointer formats such that ((ptrdiff_t)shmaddr % SHMLBA) is not...
    Problem Text
    As is stated in the VSX 4.3.5 Release Notes, the XPG is unclear on
    the behavior of shmat(shmid, shmaddr, SHM_RND) on implementations
    with pointer formats such that ((ptrdiff_t)shmaddr % SHMLBA) is not
    not a byte count. This value is suppose to be subtracted from shmaddr
    which is of type void * but since this is not a valid C operation,
    shmaddr is cast to char * before the subtraction. This is failing
    on our (64-bit) word system.

    I wrote a similar test to the one in the test suite which verifies
    that shmat() called with the SHM_RND flag set, does indeed round
    the address to the proper SHMLBA aligned boundary.
    Test Output

    ************************************************************************
    /tset/XPG4.os/ipc/shmat/T.shmat 2 Failed

    Test Description:
    When the calling process has read and write permission on the shared
    memory segment, the value of the SHM_RND bit is set in shmflg and the
    value of shmaddr is not zero, then a call to
    shmat(shmid,shmaddr,shmflg) attaches the segment for reading and
    writing at the address given by (shmaddr - (shmaddr modulus SHMLBA))
    and returns the segment start address.

    Test Strategy:
    OBTAIN a valid key for a shared memory segment using ftok()
    CREATE a shared memory segment of size 2*SHMLBA using shmget() with
    IPC_CREAT set
    OBTAIN a second valid key for a shared memory segment using ftok()
    CREATE a second shared memory segment using shmget() with IPC_CREAT set
    ATTACH first segment at an address chosen by the system, using
    shmat(shmid1, NULL, 0)
    DETACH from that address using shmdt()
    CALCULATE new address from old address at which shmid1 was attached,
    ensuring new address is not a multiple of SHMLBA and is >=
    (old_address + SHMLBA)
    ATTACH second segment, using shmat(shmid2, new_address, SHM_RND)
    VERIFY that shmat() returned (new_address - (new_address modulus SHMLBA))

    Test Information:
    shmat(shmid2, addr, 0666 | SHM_RND) returned address 0xffffc000,
    expected address 0xffff8800 with errno 0 (NO ERROR)
    ************************************************************************

    Review Information

    Review Type TSMA Review
    Start Date null
    Completed null
    Status Complete
    Review Recommendation No Resolution Given
    Review Response
    The XPG does not make clear the behaviour of shmat(shmid,shmaddr,SHM_RND)
    on implementations with pointer formats such that ((ptrdiff_t) shmaddr%SHMLBA)
    does not yield a byte count. It simply indicates that this value is
    to be subtracted from shmaddr. However, since shmaddr is of type void *,
    this is not a valid C operation. Test 2 in XPG2.os/ipc/shmat assumes that
    shmaddr should be converted to char * before the subtraction, which allows it
    to work on most systems, but may cause the test to fail on systems where
    the value to be subtracted is not a byte count.

    It is recognised that the system under test is such a system and it is
    recommended that, subject to review by the working group, this is accepted
    as a permanent interpretation of the XPG.

    Review Type SA Review
    Start Date null
    Completed null
    Status Complete
    Review Resolution Permanent Interpretation (PIN)
    Review Conclusion

    Problem Reporting System Options:

     

    Back   


Contact the Certification Authority