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

The Open Brand -- Problem Reporting and Interpretations System


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


Report 2337 Actions


    Problem Report Number 2337
    Submitter's Classification Test Suite problem
    State Resolved
    Resolution Rejected (REJ)
    Problem Resolution ID REJ.X.0647
    Raised 2004-02-16 22:59
    Updated 2004-03-05 23:42
    Published 2004-03-05 23:42
    Product Standard Internationalised System Calls and Libraries Extended V3 (UNIX 03)
    Certification Program The Open Brand certification program
    Test Suite VSRT version 5.2.5
    Test Identification rt.os/mfiles/mmap tests 11, 14
    Specification Base Definitions Issue 6
    Location in Spec PDF XSH line 25478
    Problem Summary tests attempts mmap() past end of address space
    Problem Text Tests 11 and 14 both have similar problems. both call vsrt_get_shm_name()
    which does the following:

    return vsrt_open_shm_np(s, flag, mode, 2);

    vsrt_open_shm_np(s, flag, mode, npages) does the following:

    if ((fd = shm_open(s, (O_RDWR|O_CREAT|O_TRUNC), (mode_t)(S_IRWXU|S_IRWXG
    |S_IRWXO))) == -1)
    ...
    if (ftruncate(fd, vsrt_pgsz*npages) == -1) {
    ...
    if ((buf = (int *)mmap(0, vsrt_pgsz*npages,PROT_READ|PROT_WRITE,
    MAP_SHARED, fd, 0)) == (int *)MAP_FAILED)
    ...
    for (j = 0; j < npages*vsrt_ipgsz; j++)
    buf[j] = j;
    ...
    (void)msync((void *)buf, vsrt_pgsz, MS_SYNC);
    ...
    if (fchmod(fd, mode) == -1)
    ...
    if (munmap((void *)buf, vsrt_pgsz) == -1)
    ...
    (void) close(fd);
    ...
    if ((fd = shm_open(s, flag, mode)) == -1)
    ...
    return (fd);

    As can be seen msync writes 2 pages to the shared memory object. but
    back in test11:

    if ((ask_addr = (int *)tb_mmap((void *)0, (size_t)(3*vsrt_pgsz),
    PROT_NONE, MAP_SHARED, fd1, 0)) == (int *)MAP_FAILED)

    A mmap() of 3 pages is attempted. This violates the SUSv3 requirements;

    [ENOMEM] MAP_FIXED was specified, and the range [addr,addr+len)
    exceeds that allowed for the address space of a process; or, if
    MAP_FIXED was not specified and there is insufficient room in the
    address space to effect the mapping.


    in test14:

    if ((fd1 = shm_open(shbuf,O_RDWR|O_CREAT|O_TRUNC,VSRT_PROT_ALL))
    == -1)
    ...
    if (ftruncate(fd1, vsrt_pgsz) == -1) {
    ...
    if ((addr = (int *)tb_mmap(0,2*vsrt_pgsz, PROT_READ|PROT_WRITE,
    MAP_SHARED, fd1, 0)) == (int *)MAP_FAILED)

    The shm object is reopened, then truncated to 1 page. Then a mmap() of 2
    pages is attempted. This violates the above SUSv3 requirements too.
    Test Output
    ************************************************************************
    /tset/rt.os/mfiles/mmap/T.mmap 11 Failed

    Test Description:
    If _POSIX_SHARED_MEMORY_OBJECTS is defined or the implementation
    supports the mmap() function as defined in System Interfaces and
    Headers, Issue 5 and the implementation supports MAP_FIXED:
    A call to mmap() when fildes is associated with a shared memory
    object and the MAP_FIXED flag is set in flags shall cause the file
    associated with fildes to be mapped at an address exactly matching
    addr.

    Test Information:
    mmap failed, errno = 12 (ENOMEM)


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

    ************************************************************************
    /tset/rt.os/mfiles/mmap/T.mmap 14 Failed
    Test Description:
    If _POSIX_SHARED_MEMORY_OBJECTS is defined or the implementation
    supports the mmap() function as defined in System Interfaces and
    Headers, Issue 5:
    References to mapped pages beyond the page containing the last
    byte
    of a shared memory object mapped by a call to mmap() shall
    result in
    the delivery of a SIGBUS signal.

    Test Information:
    mmap failed, errno = 12 (ENOMEM)


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

    Review Information

    Review Type TSMA Review
    Start Date 2004-02-16 22:59
    Last Updated 2004-02-17 01:31
    Completed 2004-02-17 01:31
    Status Complete
    Review Recommendation Rejected (REJ)
    Review Response This implementation of mmap() is returning an ENOMEM error incorrectly
    in these tests. The quoted text refers to the address space of the
    process. It does not relate to the size of the object being mapped.
    The specification states the requirements on the object as:

    "The range of bytes starting at off and continuing for len bytes shall
    be legitimate for the possible (not necessarily current) offsets in the
    file, shared memory object, or typed memory object represented by fildes."

    Since the size of the shared memory object could be increased using
    ftruncate() after the mapping is established, the mapping requested is
    legitimate for the _possible_ offsets in the object, as required. Note
    also that the rationale for mmap() states:

    "The mmap() function can be used to map a region of memory that is
    larger than the current size of the object. Memory access within the
    mapping but beyond the current end of the underlying objects may result
    in SIGBUS signals being sent to the process."

    The purpose of test 14 is to verify the system's behaviour when the
    region of the mapping beyond the end of the shared memory object is
    accessed.

    Review Type SA Review
    Start Date 2004-02-17 01:31
    Last Updated 2004-02-19 00:32
    Completed 2004-02-19 00:32
    Status Complete
    Review Resolution Rejected (REJ)
    Review Conclusion This PR is rejected as a TSD based on the TSMA analysis.

    Problem Reporting System Options:

     

    Back   


Contact the Certification Authority