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
0000613 [1003.1(2008)/Issue 7] System Interfaces Editorial Omission 2012-09-24 21:41 2022-09-27 15:22
Reporter dalias View Status public  
Assigned To ajosey
Priority normal Resolution Accepted As Marked  
Status Applied  
Name Rich Felker
Organization musl libc
User Reference
Section pthread_cleanup_push
Page Number unknown
Line Number unknown
Interp Status ---
Final Accepted Text Note: 0005944
Summary 0000613: Relationship of automatic object lifetimes to cancellation cleanup functions is not specified
Description Purportedly it is the intent of the standard to allow implementation of thread cancellation and cleanup functions using language-level exception handling, such as the exception extensions to the C language offered by GCC. However, nowhere is it specified that acting on a cancellation request prematurely terminates execution of any block; thus, by a strict reading of the standard as written, cleanup handlers are permitted to access objects with automatic storage duration whose lifetimes have not ended at the point where cancellation is acted upon, but whose lifetimes would have ended if an otherwise-equivalent exception were thrown from that point.

A manifestation of this issue in the GNU C library can be seen in this issue report, which I filed:

http://sourceware.org/bugzilla/show_bug.cgi?id=14609 [^]

Also, the follow-up on the issue tracker cites language in the rationale for the original 1996 standard, which I cannot find in the current standard, clarifying that such exception-based implementations were intended to be permitted.
Desired Action Adding language to this effect in the specification of pthread_cleanup_push should be sufficient:

"Invoking a cancellation cleanup function may terminate the execution of any block being executed by the thread whose execution began began after the corresponding invocation of pthread_cleanup_push."
Tags tc3-2008
Attached Files

- Relationships

-  Notes
(0005944)
geoffclare (manager)
2022-08-25 15:15

After 2018 edition page 48 line 1520 section 3 Definitions, add a new definition:

3.xxx Code Block
In the context of the System Interfaces Volume of this standard, a block as defined in the ISO C standard.

After 2018 edition page 1605 line 52316 section pthread_cleanup_pop(), add a new paragraph:
Invoking a cancellation cleanup handler may terminate the execution of any code block being executed by the thread whose execution began after the corresponding invocation of pthread_cleanup_push().

- Issue History
Date Modified Username Field Change
2012-09-24 21:41 dalias New Issue
2012-09-24 21:41 dalias Status New => Under Review
2012-09-24 21:41 dalias Assigned To => ajosey
2012-09-24 21:41 dalias Name => Rich Felker
2012-09-24 21:41 dalias Organization => musl libc
2012-09-24 21:41 dalias Section => pthread_cleanup_push
2012-09-24 21:41 dalias Page Number => unknown
2012-09-24 21:41 dalias Line Number => unknown
2022-08-25 15:15 geoffclare Note Added: 0005944
2022-08-25 15:15 geoffclare Interp Status => ---
2022-08-25 15:15 geoffclare Final Accepted Text => Note: 0005944
2022-08-25 15:15 geoffclare Status Under Review => Resolved
2022-08-25 15:15 geoffclare Resolution Open => Accepted As Marked
2022-08-25 15:16 geoffclare Tag Attached: tc3-2008
2022-09-27 15:22 geoffclare Status Resolved => Applied


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