View Issue Details

IDProjectCategoryView StatusLast Update
00008581003.1(2013)/Issue7+TC1System Interfacespublic2019-06-10 08:54
Reportergeoffclare Assigned To 
PrioritynormalSeverityCommentTypeClarification Requested
Status ClosedResolutionAccepted 
NameGeoff Clare
OrganizationThe Open Group
User Reference
Sectionpthread_atfork()
Page Number1543
Line Number50230,50244
Interp Status---
Final Accepted Text
Summary0000858: highlight the dangers of using pthread_atfork()
DescriptionA separate bug is needed for the changes proposed in 0000851:0002287
since these are suitable for TC2 but the changes to address 0000851 will
need to wait for Issue 8.

The aim here is make the warnings of the dangers of using pthread_atfork()
(which are currently buried in the RATIONALE) more prominent for the
benefit of application writers.
Desired ActionAfter page 1543 line 50230 add a new paragraph:

If a fork() call in a multi-threaded process leads to a child fork handler calling any function that is not async-signal-safe, the behavior is undefined.

On page 1543 line 50244 change the APPLICATION USAGE section from:

None.

to:

The original usage pattern envisaged for pthread_atfork() was for the prepare fork handler to lock mutexes and other locks, and for the parent and child handlers to unlock them. However, since all of the relevant unlocking functions, except sem_post(), are not async-signal-safe this usage results in undefined behavior in the child process unless the only such unlocking function it calls is sem_post().

On page 1545 line 50308 change the FUTURE DIRECTIONS section from:

None.

to:

The pthread_atfork() function may be formally deprecated (for example by shading it OB) in a future revision of this standard.

On page 889 line 29741 section fork() delete:

Fork handlers may be established by means of the pthread_atfork() function in order to maintain application invariants across fork() calls.
Tagstc2-2008

Relationships

related to 0000851 Closed pthread_atfork orphans handlers in unloaded shared libraries 

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2014-07-11 14:31 geoffclare New Issue
2014-07-11 14:31 geoffclare Name => Geoff Clare
2014-07-11 14:31 geoffclare Organization => The Open Group
2014-07-11 14:31 geoffclare Section => pthread_atfork()
2014-07-11 14:31 geoffclare Page Number => 1543
2014-07-11 14:31 geoffclare Line Number => 50230,50244
2014-07-11 14:31 geoffclare Interp Status => ---
2014-07-17 16:27 Don Cragun Status New => Resolved
2014-07-17 16:27 Don Cragun Resolution Open => Accepted
2014-07-17 16:27 Don Cragun Tag Attached: tc2-2008
2019-06-10 08:54 agadmin Status Resolved => Closed
2022-07-28 15:54 eblake Relationship added related to 0000851