View Issue Details

IDProjectCategoryView StatusLast Update
00007111003.1(2013)/Issue7+TC1System Interfacespublic2024-06-11 09:02
Reporterdalias Assigned To 
PrioritynormalSeverityEditorialTypeClarification Requested
Status ClosedResolutionAccepted As Marked 
NameRich Felker
Organizationmusl libc
User Reference
SectionXSH 2.4.3 Signal Actions
Page Number494
Line Number16876
Interp StatusApproved
Final Accepted TextSee 0000711:0001655
Summary0000711: Are the stdarg.h macros async-signal-safe?
DescriptionXSH 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 ActionClarify whether va_* are async-signal-safe, preferably in the affirmative unless there is a significant historical reason for allowing them to be unsafe.
Tagsissue8

Relationships

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

Activities

nick

2013-06-20 16:29

manager   bugnote:0001655

Last edited: 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."

dalias

2013-06-20 19:36

reporter   bugnote:0001656

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.

Don Cragun

2013-06-27 16:03

manager   bugnote:0001659

We discussed 0000711: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.

ajosey

2013-09-06 04:54

manager   bugnote:0001806

Interpretation Proposed 6 Sep 2013

ajosey

2013-10-14 13:07

manager   bugnote:0001894

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 0000711: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