Austin Group Defect Tracker

Aardvark Mark III


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0000692 [1003.1(2013)/Issue7+TC1] System Interfaces Editorial Enhancement Request 2013-05-07 17:57 2019-06-10 08:55
Reporter mdempsky View Status public  
Assigned To
Priority normal Resolution Accepted As Marked  
Status Closed  
Name Matthew Dempsky
Organization OpenBSD
User Reference
Section XSI 2.4.3 Signal Actions
Page Number 494
Line Number 16845
Interp Status Approved
Final Accepted Text see Note: 0001609
Summary 0000692: More async-signal-safe functions
Description It's very tedious to not have access to functions like memcpy() and strlen() in an async signal handler. It would ease application developers if they didn't have to reimplement these functions themselves.
Desired Action Add the following functions to the table of async-signal-safe functions:

memccpy, memchr, memcmp, memcpy, memmove, memset, stpcpy, stpncpy, strcat, strchr, strcmp, strcpy, strcspn, strlen, strncat, strncmp, strncpy, strnlen, strpbrk, strrchr, strspn, strstr, strtok_r


Alternatively, add a note explaining why these functions aren't async-signal-safe.
Tags tc2-2008
Attached Files

- Relationships
related to 0000162Resolvedajosey 1003.1(2008)/Issue 7 Determining System Endianess during Preprocessing 

-  Notes
(0001592)
mdempsky (reporter)
2013-05-07 18:05

Oops, Eric Blake points out the second "strchr" in the list should actually be "strrchr".
(0001593)
Don Cragun (manager)
2013-05-07 18:26

The Desired Action has been updated as suggested in Note: 0001592.
(0001594)
eblake (manager)
2013-05-07 19:15

It might be worth scrubbing for other functions which don't alter errno, and don't depend on or alter global state, where the result is always determined solely by the parameters. For example, <strings.h> ffs() seems like something useful to declare async-signal safe, and is the sort of bit-twiddling operation that might actually be useful in a signal handler. Likewise for <arpa/inet.h> with ntohl, ntohs, htonl, htons.

The proposal of <endian.h> in 0000162 would add another set of candidates.
(0001609)
eblake (manager)
2013-05-16 16:30
edited on: 2013-05-16 16:35

Interpretation response
------------------------
The standard states that various string functions are not async-signal-safe, and therefore must not be used in signal handlers or between fork and exec in a multithreaded program, and conforming applications must conform to this. However, concerns have been raised about this which are being referred to the sponsor.

Rationale:
----------
Since these functions do not modify or depend on global state, there are no known implementations where these functions cannot be safely used in aysnc-signal-safe code.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------
At page 494 line 16845-16879 [XSH 2.4.3 table of async-signal-safe functions], add the following in proper sorted order:

ffs, htonl, htons, memccpy, memchr, memcmp, memcpy, memmove, memset, ntohl, ntohs, stpcpy, stpncpy, strcat, strchr, strcmp, strcpy, strcspn, strlen, strncat, strncmp, strncpy, strnlen, strpbrk, strrchr, strspn, strstr, strtok_r, wcpcpy, wcpncpy, wcscat, wcschr, wcscmp, wcscpy, wcscspn, wcslen, wcsncat, wcsncmp, wcsncpy, wcsnlen, wcspbrk, wcsrchr, wcsspn, wcsstr, wcstok, wmemchr, wmemcmp, wmemcpy, wmemmove, wmemset

(0001811)
ajosey (manager)
2013-09-06 04:56

Interpretation Proposed 6 Sep 2013
(0001890)
ajosey (manager)
2013-10-14 13:06

Interpretation approved 14 October 2013

- Issue History
Date Modified Username Field Change
2013-05-07 17:57 mdempsky New Issue
2013-05-07 17:57 mdempsky Name => Matthew Dempsky
2013-05-07 17:57 mdempsky Organization => OpenBSD
2013-05-07 17:57 mdempsky Section => XSI 2.4.3 Signal Actions
2013-05-07 18:05 mdempsky Note Added: 0001592
2013-05-07 18:25 Don Cragun Interp Status => ---
2013-05-07 18:25 Don Cragun Desired Action Updated
2013-05-07 18:26 Don Cragun Note Added: 0001593
2013-05-07 19:15 eblake Note Added: 0001594
2013-05-16 16:30 eblake Note Added: 0001609
2013-05-16 16:34 eblake Note Edited: 0001609
2013-05-16 16:35 eblake Note Edited: 0001609
2013-05-16 16:36 eblake Page Number => 494
2013-05-16 16:36 eblake Line Number => 16845
2013-05-16 16:36 eblake Interp Status --- => Pending
2013-05-16 16:36 eblake Final Accepted Text => see Note: 0001609
2013-05-16 16:36 eblake Status New => Interpretation Required
2013-05-16 16:36 eblake Resolution Open => Accepted As Marked
2013-05-16 16:36 eblake Tag Attached: tc2-2008
2013-05-16 16:36 eblake Relationship added related to 0000162
2013-09-06 04:56 ajosey Interp Status Pending => Proposed
2013-09-06 04:56 ajosey Note Added: 0001811
2013-10-14 13:06 ajosey Interp Status Proposed => Approved
2013-10-14 13:06 ajosey Note Added: 0001890
2019-06-10 08:55 agadmin Status Interpretation Required => Closed


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