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
0000345 [1003.1(2008)/Issue 7] System Interfaces Objection Omission 2010-10-28 23:31 2013-04-16 13:06
Reporter eblake View Status public  
Assigned To ajosey
Priority normal Resolution Accepted As Marked  
Status Closed  
Name Eric Blake
Organization Red Hat
User Reference ebb.semop
Section semop
Page Number 1840
Line Number 58792
Interp Status Approved
Final Accepted Text Note: 0000615
Summary 0000345: semop must update sem_otime
Description Historically, the sem_otime field associated with a semaphore tracks semop()
actions, and the sem_ctime field tracks particular semctl() actions. The
standard implies this is the case on lines 12708-12709 [XBD <sem.h>], but does
not actually require it.

In particular, this behavior must be enforced to avoid a data race, where
one process creates a semaphore set and another obtains and acts on the set
before the first can initialize the semaphore values.
Desired Action At both line 58514 [XSH semctl SETVAL] and line 58526 [SETALL], add a sentence
before "Requires alter permission":

Also, the sem_ctime variable of the semid_ds structure associated with semid
shall be set to the current time.

After line 58541 [semctl IPC_SET], add a sentence:

The sem_ctime variable shall be set to the current time.

At line 58796 [semop DESCRIPTION], add a sentence:

Also, the sem_otime variable of the semid_ds structure associated with semid
shall be set to the current time.
Tags tc1-2008
Attached Files

- Relationships
related to 0000335Closedajosey semget() and semop() examples do not initialize semval 

-  Notes
(0000615)
eblake (manager)
2010-11-11 16:14
edited on: 2010-11-11 17:10

Interpretation response
-----------------------
The standard clearly states that timestamps shall be updated, and conforming implementations must conform to this.

Rationale:

The description of IPC_STAT says:

    Place the current value of each member of the semid_ds data
    structure associated with semid into the structure pointed to by
    arg.buf, where arg is the fourth argument to semctl(). The
    contents of this structure are defined in <sys/sem.h>.

and the definition of semid_ds in <sys/sem.h> includes these
members:

    time_t sem_otime Last semop() time.
    time_t sem_ctime Last time changed by semctl().

Together these constitute a clear requirement for semctl() IPC_STAT
to set the sem_otime member of arg.buf to the last time a semop()
operation was performed on the semaphore, and to set the sem_ctime
member of arg.buf to the last time the semaphore was changed by a
semctl() call.

However, the following edits will make it clear to the reader, as
well as clarify that timestamps are truncated rather than rounded
if the current time has more precision than time_t.

Notes to the Editor (not part of this interpretation)
-------------------

At line 17067 (XSH 2.7.1 IPC General Description), add a new
paragraph:

In addition to the ipc_perm structure, each associated data structure
includes several time_t fields for recording timestamps of particular
operations. When an operation is described as setting a timestamp to
the current time, that particular timestamp member of the associated
data structure shall be set to the largest time_t value which is not
greater than the current time.

At line 44077 [XSH msgctl IPC_SET], add:

Also, the msg_ctime timestamp shall be set to the current time, as
described in <ref to XSH 2.7.1>.

At line 44145 [XSH msgget], change "set equal to the current time" to
"set to the current time, as described in <ref to XSH 2.7.1>".

At line 44230 [XSH msgrcv], change "set equal to the current time" to
"set to the current time, as described in <ref to XSH 2.7.1>".

At line 44329 [XSH msgsnd], change "set equal to the current time" to
"set to the current time, as described in <ref to XSH 2.7.1>".

At both line 58514 [XSH semctl SETVAL] and line 58526 [SETALL], add a
sentence before "Requires alter permission":

Also, the sem_ctime timestamp shall be set to the current time, as
described in <ref to XSH 2.7.1>.

After line 58541 [semctl IPC_SET], add a sentence:

The sem_ctime timestamp shall be set to the current time, as described
in <ref to XSH 2.7.1>.

At line 58796 [semop DESCRIPTION], add a sentence:

Also, the sem_otime timestamp shall be set to the current time, as
described in <ref to XSH 2.7.1>.

At line 60590 [shmat RETURN VALUE], add a sentence:

Also, the shm_atime timestamp shall be set to the current time, as
described in <ref to XSH 2.7.1>.

At line 60648 [shmctl IPC_SET], add:

Also, the shm_ctime timestamp shall be set to the current time, as
described in <ref to XSH 2.7.1>.

At line 60710 [shmdt RETURN VALUE], add a sentence:

Also, the shm_dtime timestamp shall be set to the current time, as
described in <ref to XSH 2.7.1>.

At line 60760 [shmget], change "set equal to the current time" to
"set to the current time, as described in <ref to XSH 2.7.1>".

(0000637)
ajosey (manager)
2010-12-16 16:13

Comments are due on this interpretation by January 16 2011

- Issue History
Date Modified Username Field Change
2010-10-28 23:31 eblake New Issue
2010-10-28 23:32 eblake Status New => Under Review
2010-10-28 23:32 eblake Assigned To => ajosey
2010-10-28 23:32 eblake Name => Eric Blake
2010-10-28 23:32 eblake Organization => Red Hat
2010-10-28 23:32 eblake User Reference => ebb.semop
2010-10-28 23:32 eblake Section => semop
2010-10-28 23:32 eblake Page Number => 1840
2010-10-28 23:33 eblake Line Number => 58792
2010-10-28 23:33 eblake Interp Status => ---
2010-10-28 23:41 eblake Relationship added related to 0000335
2010-11-11 16:14 eblake Note Added: 0000615
2010-11-11 16:57 eblake Note Edited: 0000615
2010-11-11 17:01 eblake Note Edited: 0000615
2010-11-11 17:09 eblake Note Edited: 0000615
2010-11-11 17:10 eblake Note Edited: 0000615
2010-11-11 17:13 geoffclare Interp Status --- => Pending
2010-11-11 17:13 geoffclare Final Accepted Text => Note: 0000615
2010-11-11 17:13 geoffclare Status Under Review => Interpretation Required
2010-11-11 17:13 geoffclare Resolution Open => Accepted As Marked
2010-11-11 17:17 geoffclare Tag Attached: tc1-2008
2010-12-16 16:13 ajosey Interp Status Pending => Proposed
2010-12-16 16:13 ajosey Note Added: 0000637
2011-01-18 12:30 ajosey Interp Status Proposed => Approved
2013-04-16 13:06 ajosey Status Interpretation Required => Closed


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