Discussion:
[1003.1(2008)/Issue 7 0000841]: pthread_setcancelstate should be async-signal-safe
Austin Group Bug Tracker
2014-05-29 16:25:45 UTC
Permalink
The following issue has been SUBMITTED.
======================================================================
http://austingroupbugs.net/view.php?id=841
======================================================================
Reported By: nick
Assigned To: ajosey
======================================================================
Project: 1003.1(2008)/Issue 7
Issue ID: 841
Category: System Interfaces
Type: Enhancement Request
Severity: Objection
Priority: normal
Status: Under Review
Name: Rich Felker
Organization: musl libc
User Reference:
Section: XSH 2.4.3 Signal Actions
Page Number: 489
Line Number: 16722-16755
Interp Status: ---
Final Accepted Text:
======================================================================
Date Submitted: 2014-05-29 16:25 UTC
Last Modified: 2014-05-29 16:25 UTC
======================================================================
Summary: pthread_setcancelstate should be async-signal-safe
Description:
ISSUE 8 CHANGES, cloned from http://austingroupbugs.net/view.php?id=615

In order to write a signal handler for an asynchronous signal which can run
safely in a cancellable thread, pthread_setcancelstate must be used to
disable cancellation for the duration of the signal handler. This is
because acting on cancellation at a cancellation point that occurs during a
signal handler is, from the perspective of the asynchronously interrupted
code, asynchronous cancellation.

Consider for example the case where the main flow of execution of the
thread is in malloc at the time a signal arrives, and the signal handler
calls an async-signal-safe function which is also a cancellation point
(such as open/close).

Desired Action:
At page 489 lines 16722-16755 (XSH 2.4.3) insert:
pthread_setcancelstate()

After applying the changes from http://austingroupbugs.net/view.php?id=615, at
page 489 line 16756 (XSH
2.4.3 Signal Actions), change:
Implementations may make other interfaces async-signal-safe.
to:
It is implementation-defined which additional interfaces, if any, are also
async-signal-safe.

At page 520 line 17972 section 2.9.5.4 Async-Cancel Safety add two
paragraphs:

If a thread has asynchronous cancellation enabled and is cancelled during
execution of a function that is not async-cancel-safe, the behavior is
undefined.

If a thread has deferred cancellation enabled, a signal catching function
is called in that thread during execution of a function that is not
async-cancel-safe, and the signal catching function calls any function that
is a cancellation point while a cancellation is pending for the thread,
without first disabling cancellation, the behavior is undefined.

At page 1694 after line 54312 (XSH pthread_setcancelstate() description)
insert a new paragraph:
The pthread_setcancelstate() function shall be async-signal-safe.

After applying the changes in bug 615, at page 1695 line 54349 (XSH
pthread_setcancelstate() future directions), change:
The pthread_setcancelstate() function may be added to the table of
async-signal-safe functions in section 2.4.3 on page 489.
to:
None.
======================================================================
Relationships ID Summary
----------------------------------------------------------------------
child of 0000615 pthread_setcancelstate should be async-...
======================================================================

Issue History
Date Modified Username Field Change
======================================================================
2014-05-29 16:25 nick New Issue
2014-05-29 16:25 nick Status New => Under Review
2014-05-29 16:25 nick Assigned To => ajosey
2014-05-29 16:25 nick Name => Rich Felker
2014-05-29 16:25 nick Organization => musl libc
2014-05-29 16:25 nick Section => XSH 2.4.3 Signal
Actions
2014-05-29 16:25 nick Page Number => 489
2014-05-29 16:25 nick Line Number => 16722-16755
2014-05-29 16:25 nick Interp Status => ---
2014-05-29 16:25 nick Issue generated from 0000615
2014-05-29 16:25 nick Relationship added child of 0000615
======================================================================
Austin Group Bug Tracker
2014-05-29 16:27:43 UTC
Permalink
The following issue has been UPDATED.
======================================================================
http://austingroupbugs.net/view.php?id=841
======================================================================
Reported By: nick
Assigned To: ajosey
======================================================================
Project: 1003.1(2008)/Issue 7
Issue ID: 841
Category: System Interfaces
Type: Enhancement Request
Severity: Objection
Priority: normal
Status: Under Review
Name: Rich Felker
Organization: musl libc
User Reference:
Section: XSH 2.4.3 Signal Actions
Page Number: 489
Line Number: 16722-16755
Interp Status: ---
Final Accepted Text:
======================================================================
Date Submitted: 2014-05-29 16:25 UTC
Last Modified: 2014-05-29 16:27 UTC
======================================================================
Summary: pthread_setcancelstate should be async-signal-safe
======================================================================
Relationships ID Summary
----------------------------------------------------------------------
child of 0000615 pthread_setcancelstate should be async-...
======================================================================

Issue History
Date Modified Username Field Change
======================================================================
2014-05-29 16:25 nick New Issue
2014-05-29 16:25 nick Status New => Under Review
2014-05-29 16:25 nick Assigned To => ajosey
2014-05-29 16:25 nick Name => Rich Felker
2014-05-29 16:25 nick Organization => musl libc
2014-05-29 16:25 nick Section => XSH 2.4.3 Signal
Actions
2014-05-29 16:25 nick Page Number => 489
2014-05-29 16:25 nick Line Number => 16722-16755
2014-05-29 16:25 nick Interp Status => ---
2014-05-29 16:25 nick Issue generated from 0000615
2014-05-29 16:25 nick Relationship added child of 0000615
2014-05-29 16:27 nick Tag Attached: issue8
2014-05-29 16:27 nick Resolution Open => Accepted
======================================================================
Austin Group Bug Tracker
2014-05-29 16:28:10 UTC
Permalink
The following issue has been RESOLVED.
======================================================================
http://austingroupbugs.net/view.php?id=841
======================================================================
Reported By: nick
Assigned To: ajosey
======================================================================
Project: 1003.1(2008)/Issue 7
Issue ID: 841
Category: System Interfaces
Type: Enhancement Request
Severity: Objection
Priority: normal
Status: Resolved
Name: Rich Felker
Organization: musl libc
User Reference:
Section: XSH 2.4.3 Signal Actions
Page Number: 489
Line Number: 16722-16755
Interp Status: ---
Final Accepted Text:
Resolution: Accepted
Fixed in Version:
======================================================================
Date Submitted: 2014-05-29 16:25 UTC
Last Modified: 2014-05-29 16:28 UTC
======================================================================
Summary: pthread_setcancelstate should be async-signal-safe
======================================================================
Relationships ID Summary
----------------------------------------------------------------------
child of 0000615 pthread_setcancelstate should be async-...
======================================================================

Issue History
Date Modified Username Field Change
======================================================================
2014-05-29 16:25 nick New Issue
2014-05-29 16:25 nick Status New => Under Review
2014-05-29 16:25 nick Assigned To => ajosey
2014-05-29 16:25 nick Name => Rich Felker
2014-05-29 16:25 nick Organization => musl libc
2014-05-29 16:25 nick Section => XSH 2.4.3 Signal
Actions
2014-05-29 16:25 nick Page Number => 489
2014-05-29 16:25 nick Line Number => 16722-16755
2014-05-29 16:25 nick Interp Status => ---
2014-05-29 16:25 nick Issue generated from 0000615
2014-05-29 16:25 nick Relationship added child of 0000615
2014-05-29 16:27 nick Tag Attached: issue8
2014-05-29 16:27 nick Resolution Open => Accepted
2014-05-29 16:28 nick Status Under Review =>
Resolved
======================================================================
Austin Group Bug Tracker
2014-05-29 16:31:12 UTC
Permalink
The following issue has been UPDATED.
======================================================================
http://austingroupbugs.net/view.php?id=841
======================================================================
Reported By: nick
Assigned To: ajosey
======================================================================
Project: 1003.1(2008)/Issue 7
Issue ID: 841
Category: System Interfaces
Type: Enhancement Request
Severity: Objection
Priority: normal
Status: Resolved
Name: Rich Felker
Organization: musl libc
User Reference:
Section: XSH 2.4.3 Signal Actions
Page Number: 489
Line Number: 16722-16755
Interp Status: ---
Final Accepted Text:
Resolution: Accepted
Fixed in Version:
======================================================================
Date Submitted: 2014-05-29 16:25 UTC
Last Modified: 2014-05-29 16:31 UTC
======================================================================
Summary: pthread_setcancelstate should be async-signal-safe
======================================================================
Relationships ID Summary
----------------------------------------------------------------------
child of 0000615 pthread_setcancelstate should be async-...
======================================================================

Issue History
Date Modified Username Field Change
======================================================================
2014-05-29 16:25 nick New Issue
2014-05-29 16:25 nick Status New => Under Review
2014-05-29 16:25 nick Assigned To => ajosey
2014-05-29 16:25 nick Name => Rich Felker
2014-05-29 16:25 nick Organization => musl libc
2014-05-29 16:25 nick Section => XSH 2.4.3 Signal
Actions
2014-05-29 16:25 nick Page Number => 489
2014-05-29 16:25 nick Line Number => 16722-16755
2014-05-29 16:25 nick Interp Status => ---
2014-05-29 16:25 nick Issue generated from 0000615
2014-05-29 16:25 nick Relationship added child of 0000615
2014-05-29 16:27 nick Tag Attached: issue8
2014-05-29 16:27 nick Resolution Open => Accepted
2014-05-29 16:28 nick Status Under Review =>
Resolved
2014-05-29 16:31 nick Desired Action Updated
======================================================================
Austin Group Bug Tracker
2014-05-29 16:32:06 UTC
Permalink
The following issue has been UPDATED.
======================================================================
http://austingroupbugs.net/view.php?id=841
======================================================================
Reported By: nick
Assigned To: ajosey
======================================================================
Project: 1003.1(2008)/Issue 7
Issue ID: 841
Category: System Interfaces
Type: Enhancement Request
Severity: Objection
Priority: normal
Status: Resolved
Name: Rich Felker
Organization: musl libc
User Reference:
Section: XSH 2.4.3 Signal Actions
Page Number: 489
Line Number: 16722-16755
Interp Status: ---
Final Accepted Text:
Resolution: Accepted
Fixed in Version:
======================================================================
Date Submitted: 2014-05-29 16:25 UTC
Last Modified: 2014-05-29 16:32 UTC
======================================================================
Summary: pthread_setcancelstate should be async-signal-safe
======================================================================
Relationships ID Summary
----------------------------------------------------------------------
child of 0000615 pthread_setcancelstate should be async-...
======================================================================

Issue History
Date Modified Username Field Change
======================================================================
2014-05-29 16:25 nick New Issue
2014-05-29 16:25 nick Status New => Under Review
2014-05-29 16:25 nick Assigned To => ajosey
2014-05-29 16:25 nick Name => Rich Felker
2014-05-29 16:25 nick Organization => musl libc
2014-05-29 16:25 nick Section => XSH 2.4.3 Signal
Actions
2014-05-29 16:25 nick Page Number => 489
2014-05-29 16:25 nick Line Number => 16722-16755
2014-05-29 16:25 nick Interp Status => ---
2014-05-29 16:25 nick Issue generated from 0000615
2014-05-29 16:25 nick Relationship added child of 0000615
2014-05-29 16:27 nick Tag Attached: issue8
2014-05-29 16:27 nick Resolution Open => Accepted
2014-05-29 16:28 nick Status Under Review =>
Resolved
2014-05-29 16:31 nick Desired Action Updated
2014-05-29 16:32 nick Desired Action Updated
======================================================================
Austin Group Bug Tracker
2014-05-30 08:36:49 UTC
Permalink
The following issue has been UPDATED.
======================================================================
http://austingroupbugs.net/view.php?id=841
======================================================================
Reported By: nick
Assigned To: ajosey
======================================================================
Project: 1003.1(2008)/Issue 7
Issue ID: 841
Category: System Interfaces
Type: Enhancement Request
Severity: Objection
Priority: normal
Status: Resolved
Name: Rich Felker
Organization: musl libc
User Reference:
Section: XSH 2.4.3 Signal Actions
Page Number: 489
Line Number: 16722-16755
Interp Status: ---
Final Accepted Text:
Resolution: Accepted
Fixed in Version:
======================================================================
Date Submitted: 2014-05-29 16:25 UTC
Last Modified: 2014-05-30 08:36 UTC
======================================================================
Summary: pthread_setcancelstate should be async-signal-safe
======================================================================
Relationships ID Summary
----------------------------------------------------------------------
child of 0000615 pthread_setcancelstate should be async-...
======================================================================

----------------------------------------------------------------------
(0002255) geoffclare (manager) - 2014-05-30 08:36
http://austingroupbugs.net/view.php?id=841#c2255
----------------------------------------------------------------------
I have edited the desired action to correct the page and line number for
section 2.9.5.4.

Issue History
Date Modified Username Field Change
======================================================================
2014-05-29 16:25 nick New Issue
2014-05-29 16:25 nick Status New => Under Review
2014-05-29 16:25 nick Assigned To => ajosey
2014-05-29 16:25 nick Name => Rich Felker
2014-05-29 16:25 nick Organization => musl libc
2014-05-29 16:25 nick Section => XSH 2.4.3 Signal
Actions
2014-05-29 16:25 nick Page Number => 489
2014-05-29 16:25 nick Line Number => 16722-16755
2014-05-29 16:25 nick Interp Status => ---
2014-05-29 16:25 nick Issue generated from 0000615
2014-05-29 16:25 nick Relationship added child of 0000615
2014-05-29 16:27 nick Tag Attached: issue8
2014-05-29 16:27 nick Resolution Open => Accepted
2014-05-29 16:28 nick Status Under Review =>
Resolved
2014-05-29 16:31 nick Desired Action Updated
2014-05-29 16:32 nick Desired Action Updated
2014-05-30 08:36 geoffclare Note Added: 0002255
2014-05-30 08:36 geoffclare Desired Action Updated
======================================================================
Loading...