View Issue Details

IDProjectCategoryView StatusLast Update
00019011003.1(2024)/Issue8System Interfacespublic2025-01-16 16:47
Reporterdancross Assigned To 
PrioritynormalSeverityEditorialTypeClarification Requested
Status ResolvedResolutionAccepted As Marked 
NameDan Cross
Organization
User Reference
Sectionsigaction
Page Number2046
Line Number67134-67135
Interp Status---
Final Accepted Text0001901:0007052
Summary0001901: sigaction() incorrectly states (sig)longjmp are not in the list of async-signal-safe functions
DescriptionThe description of sigaction() currently reads, in part,

"Note that longjmp() and siglongjmp() are not in the list of async-signal-safe functions."

However, XSH 2.4.3 includes both longjmp() and siglongjmp() in the list of async-signal-safe functions (page 519, lines 18385 and 18367, respectively). Moreover, the description of longjmp() on page 1372 line 46093 explicitly states that longjmp is async-signal-safe; the paragraph started on that line goes on to discuss caveats around its use in signal handlers. Presumably this applies to siglongjmp() as well, as it is described as being equivalent to longjmp() in all respects other than those specifically documented in its description.
Desired ActionThe text in sigaction() should be updated to reflect that longmp() and siglongjmp() are both async-signal-safe, but must be used with caution when called from a signal handler.
Tagstc1-2024

Relationships

related to 0000516 Closedajosey 1003.1(2008)/Issue 7 Calling longjmp() from a signal handler 

Activities

geoffclare

2025-01-16 15:05

manager   bugnote:0007044

Looks like we missed this sigaction() APPLICATION USAGE text in bug 0000516 when we made [sig]longjmp() async-signal-safe.

Rather than updating the text with full details, it may be preferable to avoid duplication by keeping it short and having it reference the longjmp() page for the details.

geoffclare

2025-01-16 16:45

manager   bugnote:0007052

On page 2046 line 67134 section sigaction(), change:
Note that longjmp() and siglongjmp() are not in the list of async-signal-safe functions. This is because the code executing after longjmp() and siglongjmp() can call any unsafe functions with the same danger as calling those unsafe functions directly from the signal handler. Applications that use longjmp() and siglongjmp() from within signal handlers require rigorous protection in order to be portable.

to:
Note that although longjmp() and siglongjmp() are in the list of async-signal-safe functions, it is recommended that applications do not call them from signal handlers. See the DESCRIPTION and APPLICATION USAGE for [xref to longjmp()].

Issue History

Date Modified Username Field Change
2025-01-09 16:43 dancross New Issue
2025-01-09 16:43 dancross Name => Dan Cross
2025-01-09 16:43 dancross Section => sigaction
2025-01-09 16:43 dancross Page Number => 2046
2025-01-09 16:43 dancross Line Number => 67134-67135
2025-01-16 15:05 geoffclare Note Added: 0007044
2025-01-16 15:06 geoffclare Relationship added related to 0000516
2025-01-16 16:45 geoffclare Note Added: 0007052
2025-01-16 16:47 geoffclare Interp Status => ---
2025-01-16 16:47 geoffclare Final Accepted Text => 0001901:0007052
2025-01-16 16:47 geoffclare Status New => Resolved
2025-01-16 16:47 geoffclare Resolution Open => Accepted As Marked
2025-01-16 16:47 geoffclare Tag Attached: tc1-2024