This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 118. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-09-13


2970. Races with volatile sig_atomic_t bit-fields

Section: 6.10.2.2  [intro.races]     Status: CD7     Submitter: Hubert Tong     Date: 2024-12-17

[Accepted as a DR at the February, 2025 meeting.]

(From submission #654.)

Subclause 6.10.2.2 [intro.races] paragraph 22 specifies:

Two accesses to the same object of type volatile std::sig_atomic_t do not result in a data race if both occur in the same thread, even if one or more occurs in a signal handler. ...

This provision applies to bit-fields as well, because bit-fields are objects (6.9.1 [basic.types.general] paragraph 4). However, in practice bit-fields are not updated atomically and are subject to tearing.

Proposed resolution (2025-01-20, approved by CWG 2025-02-14):

Change in 6.10.2.2 [intro.races] paragraph 22 as follows:

Two accesses to the same non-bit-field object of type volatile std::sig_atomic_t do not result in a data race if both occur in the same thread, even if one or more occurs in a signal handler. ...