Austin Group Defect Tracker

Aardvark Mark III


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0001237 [1003.1(2016)/Issue7+TC2] System Interfaces Objection Error 2019-03-16 09:45 2019-03-18 10:39
Reporter kre View Status public  
Assigned To
Priority normal Resolution Open  
Status New  
Name Robert Elz
Organization
User Reference
Section shmat
Page Number 1940
Line Number 62494
Interp Status ---
Final Accepted Text
Summary 0001237: shmat() specifies use of an undefined operation
Description The parameter shmaddr to the shmat() function is of type void *
and the standard specifies:


  • If shmaddr is not a null pointer and (shmflg &SHM_RND) is non-zero, the segment
    is attached at the address given by (shmaddr -((uintptr_t)shmaddr %SHMLBA)). The
     character '%' is the C-language remainder operator.


Arithmetic on (void *) pointers is undefined,
so no address can be calculated as specified.
Desired Action


Three possible solutions appear reasonable.



Pick one:



  1. In line 62494 in page 1940 change the wording
    from:

    at the address given by (shmaddr -((uintptr_t)shmaddr %SHMLBA)).

    to:

    at the address given by (void *)((uintptr_t)shmaddr -((uintptr_t)shmaddr %SHMLBA
    )).

  2. In line 62494 in page 1940 change the wording
    from:

    at the address given by (shmaddr -((uintptr_t)shmaddr %SHMLBA)).

    to:

    at the address given by (void *)((char *)shmaddr -((uintptr_t)shmaddr %SHMLBA)).

  3. Delete all of pages 1940 to 1947 (inclusive).


Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0004328)
geoffclare (manager)
2019-03-18 09:57

In XPG3 shmaddr had type char *, so adding a (char *) cast as in option 2 is the change that should have been made when shmaddr was changed to void * in XPG4.

The additional (void *) cast is unnecessary, as there is no problem with "the address given by" being followed by an expression of type char *.
(0004329)
kre (reporter)
2019-03-18 10:39

That(Note: 0004328) is fine.

- Issue History
Date Modified Username Field Change
2019-03-16 09:45 kre New Issue
2019-03-16 09:45 kre Name => Robert Elz
2019-03-16 09:45 kre Section => shmat
2019-03-16 09:45 kre Page Number => 1940
2019-03-16 09:45 kre Line Number => 62494
2019-03-18 09:57 geoffclare Note Added: 0004328
2019-03-18 10:39 kre Note Added: 0004329


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker