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
0001240 [1003.1(2016/18)/Issue7+TC2] System Interfaces Objection Omission 2019-03-16 09:58 2019-11-14 14:37
Reporter kre View Status public  
Assigned To
Priority normal Resolution Accepted As Marked  
Status Applied  
Name Robert Elz
Organization
User Reference
Section shmctl
Page Number 1942
Line Number 62578
Interp Status ---
Final Accepted Text Note: 0004450
Summary 0001240: shmctl(IPC_RMID) relationship with attached shared memory segments is not specified
Description The standard specifies (lines 62573-5):

Remove the shared memory identifier specified by shmid from the system and destroy the shared memory segment and shmid_ds data structure associated with it.

There is no mention, here or elsewhere, of the effects upon the
address space of a process which has performed a shmat( ) function
on the specified shared memory identifier.
Desired Action Four possible solutions appear reasonable, though the second is
not currently known (by me) to have an existing implementation.




Pick one:


  1. At the end of line 62578 in page 1942, add a new sentence:

    If any process currently has the shared memory segment attached to its address space by use of the shmat( ) function [Xref shmat on page 1940] the effect on that process, or of any attempt by that process to access the memory attached to the shared memory segment that has been removed is unspecified.



  2. At the end of line 62578 in page 1942, add a new sentence:

    If any process currently has the shared memory segment attached to its address space by use of the shmat( ) function [Xref shmat on page 1940] the IPC_RMID operation shall fail.

    Between lines 62585 and 62586 correctly format, and add a new error code:

    [EBUSY] The argument cmd is IPC_RMID and shmid specifies a shared memory segment that is currently mapped into the address space of one or more processes.



  3. At the end of line 62578 in page 1942, add new sentences:
    If any process currently has the shared memory segment attached to its address space by use of the shmat( ) function [Xref shmat on page 1940] that attachment shall be converted to appear as if it had attached a segment created by the shmget( ) function [Xref shmget on page 1946] with a key of IPC_PRIVATE, where the shared memory identified returned (the shmid) is no longer valid for any future use. The process shall otherwise be unaffected. Where multiple processes had attached to the shared memory segment being removed, the IPC_PRIVATE segment they each now have access to shall be shared between them.


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



Tags tc3-2008
Attached Files

- Relationships
related to 0001237Applied shmat() specifies use of an undefined operation 
related to 0001238Applied shmat() used the word "it" with an ambiguous antecedent 
related to 0001239Applied shmat() specifies non-portable return value 

-  Notes
(0004326)
kre (reporter)
2019-03-16 10:09
edited on: 2019-03-16 10:10

Sorry, typos...

In choice 1, "that that process" should be "by that process"
In choice 3, <\i> should be < / i > (obviously...)

And mantis did a lousy job of formatting the text, the blockquotes
were entered as one long line, and have been formatted with that
line split in the middle of a word! Who would ever do that?
That applies to all of my recent 4 bug reports 0001237 0001238 0001239 and this one 0001240

(0004327)
geoffclare (manager)
2019-03-18 09:45

The desired action has been updated to fix the problems (with this bug) noted in Note: 0004326.

The line breaks were in the submitted source text; we can speculate as to how they got there, but Mantis is not to blame for the way it was rendered.
(0004330)
Konrad_Schwarz (reporter)
2019-03-18 11:47

I vote for 3.

Orginally, I tended to 1., as this gives the OS implementor the most freedom.

From an OS standpoint however, I think the IPC object needs to be reference-counted in any case, so garbage collection is appropriate.

More pertinently, the ipcrm utility states that:
> The shared memory segment and data structure associated with it shall be
> destroyed after the last detach.
This is consistent with alternative 3.
(0004450)
geoffclare (manager)
2019-06-24 15:38

On page 1942 line 62573 section shmctl(), change:
Remove the shared memory identifier specified by shmid from the system and destroy the shared memory segment and shmid_ds data structure associated with it.
to:
Remove the shared memory identifier specified by shmid from the system. The shared memory segment and shmid_ds data structure associated with it shall be destroyed when all processes with the segment attached have either detached the segment or terminated. If the segment is not attached to any process, it shall be destroyed immediately.

On page 2861 line 94250 section ipcrm, change:
shall be destroyed after the last detach.
to:
shall be destroyed when all processes with the segment attached have either detached the segment or terminated. If the segment is not attached to any process, it shall be destroyed immediately.

- Issue History
Date Modified Username Field Change
2019-03-16 09:58 kre New Issue
2019-03-16 09:58 kre Name => Robert Elz
2019-03-16 09:58 kre Section => shmctl
2019-03-16 09:58 kre Page Number => 1942
2019-03-16 09:58 kre Line Number => 62578
2019-03-16 10:09 kre Note Added: 0004326
2019-03-16 10:10 kre Note Edited: 0004326
2019-03-18 09:39 geoffclare Interp Status => ---
2019-03-18 09:39 geoffclare Description Updated
2019-03-18 09:39 geoffclare Desired Action Updated
2019-03-18 09:41 geoffclare Desired Action Updated
2019-03-18 09:45 geoffclare Note Added: 0004327
2019-03-18 11:47 Konrad_Schwarz Note Added: 0004330
2019-03-28 17:28 Don Cragun Summary shctl(IPC_RMID) relationship with attached shared memory segments is not specified => shmctl(IPC_RMID) relationship with attached shared memory segments is not specified
2019-06-24 15:37 eblake Relationship added related to 0001237
2019-06-24 15:37 eblake Relationship added related to 0001238
2019-06-24 15:38 eblake Relationship added related to 0001239
2019-06-24 15:38 geoffclare Note Added: 0004450
2019-06-24 15:39 geoffclare Final Accepted Text => Note: 0004450
2019-06-24 15:39 geoffclare Status New => Resolved
2019-06-24 15:39 geoffclare Resolution Open => Accepted As Marked
2019-06-24 15:39 geoffclare Tag Attached: tc3-2008
2019-11-14 14:37 geoffclare Status Resolved => Applied


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