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

The Open Brand -- Problem Reporting and Interpretations System


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


Report 0075 Actions


    Problem Report Number 0075
    Submitter's Classification Test Suite problem
    State Resolved
    Resolution Test Suite Deficiency (TSD)
    Problem Resolution ID TSD.X.0075
    Raised 1993-06-14 08:00
    Updated 2003-03-13 08:00
    Published 1993-06-29 08:00
    Product Standard Internationalised System Calls and Libraries (XPG4)
    Certification Program The Open Brand certification program
    Test Suite VSX4 version 4.2.4
    Test Identification XPG4.os/ipc/shmat 2
    Problem Summary TSD4.075 (UniSoft Reference : err.4.2.4.028) This is a bug in the VSX test. I have discussed this with X/Open Support and they agree the test is wrong. There are two problems with the test XPG4.os/ipc/shmat 2....
    Problem Text
    (UniSoft Reference : err.4.2.4.028)

    This is a bug in the VSX test. I have discussed
    this with X/Open Support and they agree the test is wrong.

    There are two problems with the test XPG4.os/ipc/shmat 2.

    Both problems occus in the function test2() in shmat.c.

    The first simple problem is the calculation attempting to round down the
    addr pointer :

    addrmod = ((int) addr - ((int) addr % SHMLBA));

    addr is a pointer and not be cast to int for this calculation. On the
    failing machine (int)addr becomes a negative integer and the calculation
    round up the address instead of rounding it down. The cast should be changed
    to use unsigned long.

    The second problem affects the whole strategy for test2. Currently the test
    does the following :

    calls shmget to get a 512 byte chunk
    calls semat to get an address for this chunk
    call shmdt to detach the above
    call shmat to attach again, but to the previous address rounded down

    The problem is that on the first shmat call the kernel may return any
    address it chooses (not rounded to any specific boundary). The second shmat
    may fail if the rounded down address is not valid or already in use. (on the
    failing machine the first shmat will return an address on an 8K boundary and
    the second call will round it down to a 64K boundary, which is often already
    in use (e.g. by a shared library).

    I suggest the test is modified to call shmget with asking for a chunk of
    2*SHMLBA bytes and then call shmat to get an address for this chunk.
    Then call shmget to get the 512 byte chunk, call shmdt to detach the first
    chunk. Finally call shmat to map the second small chunk at the address
    allocated for the first big chunk + SHMLBA/2 asking for SHM_RND to rown down
    this address.

    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 id associated using shmget() with IPC_CREAT set
    OBTAIN a valid shared memory address using shmat()
    DETACH from that address using shmdt()
    ATTACH to the address previously obtained, using shmat() with the
    SHM_RND flag set
    VERIFY that the attach returned address - (address modulus SHMLBA)

    Test Information:
    shmat(shmid2, addr, 0666 | SHM_RND) returned address 0x800c0000,
    expected address 0x800d0000 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
    This is accepted as a fault in the test suite and a test suite deficiency
    waiver is recommended.

    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