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
0000711 [1003.1(2013)/Issue7+TC1] System Interfaces Editorial Clarification Requested 2013-06-16 22:46 2024-06-11 09:02
Reporter dalias View Status public  
Assigned To
Priority normal Resolution Accepted As Marked  
Status Closed  
Name Rich Felker
Organization musl libc
User Reference
Section XSH 2.4.3 Signal Actions
Page Number 494
Line Number 16876
Interp Status Approved
Final Accepted Text See Note: 0001655
Summary 0000711: Are the stdarg.h macros async-signal-safe?
Description XSH 2.4.3 lists functions which are async-signal-safe and does not include va_* in its list; however, va_* are specified to be macros and functions are not required to exist. Thus, it seems unclear to me whether variadic functions may access their arguments from an async-signal context.
Desired Action Clarify whether va_* are async-signal-safe, preferably in the affirmative unless there is a significant historical reason for allowing them to be unsafe.
Tags issue8
Attached Files

- Relationships
related to 0001302Closed 1003.1(2016/18)/Issue7+TC2 Alignment with C17 

-  Notes
(0001655)
nick (manager)
2013-06-20 16:29
edited on: 2013-06-27 15:45

Interpretation response
------------------------

The standard does not speak to this issue, and as such no conformance distinction can be made between alternative implementations based on this. This is being referred to the sponsor.

Rationale:
-------------
None

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

At line 16841, change "or if the signal handler calls any function defined in this standard other than one of the functions listed in the following table" to
"or if the signal handler calls any function or function-like macro defined in this standard other than one of the functions and macros listed in the following table"


At line 16843, change "a set of functions" to "a set of functions and function-like macros" and add

va_arg
va_copy
va_end
va_start

to the list in proper alphabetical order.

At line 16880, change "All functions" to "All functions or function-like macros"

At line 16883, change "signal interrupts an unsafe function and the signal-catching function calls an unsafe function,
the behavior is undefined." to "signal interrupts an unsafe function or function-like macro and the signal-catching function calls an unsafe function or function-like macro, the behavior is undefined."

(0001656)
dalias (reporter)
2013-06-20 19:36

It's come to my attention that there are a number of other function-like macros such as FD_* (used with select) which may need to be added to this list.

It may also be important to review whether there are historic implementations where said macros are not async-signal-safe, and whether requiring them to be safe is an omission that can be added in TC2 or a new requirement for the next issue. I seem to recall there being some ancient systems, albeit possibly only theoretical ones, where va_start involved allocation; otherwise, there would have been no motivation for va_end to exist.
(0001659)
Don Cragun (manager)
2013-06-27 16:03

We discussed Note: 0001656 during the June 27, 2013 conference call.
If additional function-like macros need to be added to the table, please submit a bug report (or reports) with the additional macros that need to be addressed.

This bug is going through the interpretations track, so if some implementations have a problem with making va_* macros async-signal safe, they can note the issue during the interpretation review process.
(0001806)
ajosey (manager)
2013-09-06 04:54

Interpretation Proposed 6 Sep 2013
(0001894)
ajosey (manager)
2013-10-14 13:07

Interpretation approved 14 October 2013

- Issue History
Date Modified Username Field Change
2013-06-16 22:46 dalias New Issue
2013-06-16 22:46 dalias Name => Rich Felker
2013-06-16 22:46 dalias Organization => musl libc
2013-06-16 22:46 dalias Section => XSH 2.4.3 Signal Actions
2013-06-16 22:46 dalias Page Number => unknown
2013-06-16 22:46 dalias Line Number => unknown
2013-06-20 15:58 Don Cragun Page Number unknown => 494
2013-06-20 15:58 Don Cragun Line Number unknown => 16876
2013-06-20 15:58 Don Cragun Interp Status => ---
2013-06-20 16:29 nick Note Added: 0001655
2013-06-20 16:30 nick Tag Attached: issue8
2013-06-20 19:36 dalias Note Added: 0001656
2013-06-27 15:35 nick Note Edited: 0001655
2013-06-27 15:37 nick Interp Status --- => Pending
2013-06-27 15:37 nick Final Accepted Text => See Note: 0001655
2013-06-27 15:37 nick Status New => Interpretation Required
2013-06-27 15:37 nick Resolution Open => Accepted As Marked
2013-06-27 15:38 nick Note Edited: 0001655
2013-06-27 15:38 nick Tag Attached: tc2-2008
2013-06-27 15:38 nick Tag Detached: tc2-2008
2013-06-27 15:40 nick Note Edited: 0001655
2013-06-27 15:41 nick Note Edited: 0001655
2013-06-27 15:43 nick Note Edited: 0001655
2013-06-27 15:45 nick Note Edited: 0001655
2013-06-27 16:03 Don Cragun Note Added: 0001659
2013-09-06 04:54 ajosey Interp Status Pending => Proposed
2013-09-06 04:54 ajosey Note Added: 0001806
2013-10-14 13:07 ajosey Interp Status Proposed => Approved
2013-10-14 13:07 ajosey Note Added: 0001894
2019-11-20 15:42 geoffclare Relationship added related to 0001302
2020-03-24 15:58 geoffclare Status Interpretation Required => Applied
2024-06-11 09:02 agadmin Status Applied => Closed


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