Austin Group Defect Tracker

Aardvark Mark IV


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0001239 [1003.1(2016/18)/Issue7+TC2] System Interfaces Objection Error 2019-03-16 09:55 2020-04-29 15:10
Reporter kre View Status public  
Assigned To
Priority normal Resolution Accepted As Marked  
Status Applied  
Name Robert Elz
Organization
User Reference
Section shmat
Page Number 1940-1, 384
Line Number 62506, 62529, 13051-2
Interp Status ---
Final Accepted Text See Note: 0004441.
Summary 0001239: shmat() specifies non-portable return value
Description The standard specifies:
<blTockquote>
Otherwise, the shared memory segment shall not be attached, shmat( ) shall retur
n (void *)-1, and errno shall be set to indicate the error.

As was done with other similar operations (mmap, sem_open, ...) a new
symbol should be defined to replace the non-portable use of (void *)-1.
Desired Action Two possible solutions appear reasonable.




Pick one:


  1. In line 62506 in page 1940, change the words:
    shmat( ) shall return (void *)-1,

    to:
    shmat( ) shall return SHM_FAILED,

    In line 62529 in page 1941, change the word:
    None.

    to:

    Previous versions required an error return value of -1 with the type void * for
    the shmat( ) function, which is not guaranteed to be portable across implementat
    ions. The revised text provides the symbolic error code SHM_FAILED to eliminate
    the type conflict.

    In XBD section 13, in the page for the <sys/shm.h> header,
    add a new paragraph between lines 13051 and 13052:

    The <sys/shm.h> header shall define the symbolic constant SHM_FAILED which shall
     have type void *.


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


Tags issue8
Attached Files

- Relationships
related to 0001240Applied shmctl(IPC_RMID) relationship with attached shared memory segments is not specified 
related to 0001237Applied shmat() specifies use of an undefined operation 
related to 0001238Applied shmat() used the word "it" with an ambiguous antecedent 

-  Notes
(0004441)
Don Cragun (manager)
2019-06-20 16:41
edited on: 2019-06-20 16:42

In line 62506 in page 1940, change the words:

    
shmat() shall return (void *)-1,

to:
    
shmat() shall return SHM_FAILED,



In line 62529 in page 1941, change the word:
    
    
None.

to:
    
The symbol SHM_FAILED is used for the failure return of shmat() for consistency with MAP_FAILED for mmap(). However, SHM_FAILED is required to have the same value as ((void *)(intptr_t)-1) to provide backwards compatibility for applications written to earlier versions of this standard, where the failure return was specified as (void *)-1. This means that implementations need to ensure that shmat() cannot return ((void *)(intptr_t)-1) on a successful call.



In XBD section 13, in the page for the <sys/shm.h> header, add two new paragraphs between lines 13051 and 13052:

The <sys/shm.h> header shall define the symbolic constant SHM_FAILED which shall evaluate to the same value as ((void *)(intptr_t)-1).


The <sys/shm.h> header shall define the type intptr_t as described in <stdint.h>.



- Issue History
Date Modified Username Field Change
2019-03-16 09:55 kre New Issue
2019-03-16 09:55 kre Name => Robert Elz
2019-03-16 09:55 kre Section => shmat
2019-03-16 09:55 kre Page Number => 1940-1, 384
2019-03-16 09:55 kre Line Number => 62506, 62529, 13051-2
2019-06-20 16:34 Don Cragun Tag Attached: issue8
2019-06-20 16:41 Don Cragun Note Added: 0004441
2019-06-20 16:42 Don Cragun Note Edited: 0004441
2019-06-20 16:44 Don Cragun Interp Status => ---
2019-06-20 16:44 Don Cragun Final Accepted Text => See Note: 0004441.
2019-06-20 16:44 Don Cragun Status New => Resolved
2019-06-20 16:44 Don Cragun Resolution Open => Accepted As Marked
2019-06-24 15:38 eblake Relationship added related to 0001240
2019-06-24 15:38 eblake Relationship added related to 0001237
2019-06-24 15:39 eblake Relationship added related to 0001238
2020-04-29 15:10 geoffclare Status Resolved => Applied


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