gcc/libstdc++-v3
Thomas Rodgers 4cf3c33981 libstdc++: Fix deadlock in atomic wait [PR104442]
This issue was observed as a deadlock in
29_atomics/atomic/wait_notify/100334.cc on vxworks. When a wait is
"laundered" (e.g. type T* does not suffice as a waitable address for the
platform's native waiting primitive), the address waited is that of the
_M_ver member of __waiter_pool_base, so several threads may wait on the
same address for unrelated atomic<T> objects. As noted in the PR, the
implementation correctly exits the wait for the thread whose data
changed, but not for any other threads waiting on the same address.

As noted in the PR the __waiter::_M_do_wait_v member was correctly exiting
but the other waiters were not reloading the value of _M_ver before
re-entering the wait.

Moving the spin call inside the loop accomplishes this, and is
consistent with the predicate accepting version of __waiter::_M_do_wait.

libstdc++-v3/ChangeLog:

	PR libstdc++/104442
	* include/bits/atomic_wait.h (__waiter::_M_do_wait_v): Move spin
	 loop inside do loop so that threads failing the wait, reload
	 _M_ver.
2022-02-09 12:30:51 -08:00
..
config libstdc++: Add %j, %U, %w, %W time_get support, fix %y, %Y, %C, %p [PR77760] 2022-01-10 15:38:47 +01:00
doc libstdc++: Update documentation for C++17 deprecations 2022-01-19 00:58:26 +00:00
include libstdc++: Fix deadlock in atomic wait [PR104442] 2022-02-09 12:30:51 -08:00
libsupc++ libstdc++: Add suggestion to std::uncaught_exception() warning 2022-02-04 15:26:59 +00:00
po libstdc++: Define <stacktrace> header for C++23 2022-01-17 12:13:02 +00:00
python libstdc++: Define <stacktrace> header for C++23 2022-01-17 12:13:02 +00:00
scripts libstdc++: Only add valid -L paths to testsuite linker options 2022-01-20 12:29:29 +00:00
src libstdc++: Simplify resource management in directory iterators 2022-02-08 21:04:14 +00:00
testsuite libstdc++: Adjust Filesystem TS test for Windows 2022-02-08 13:31:09 +00:00
acinclude.m4 libstdc++: Add comment to acinclude.m4 2022-02-08 14:15:38 +00:00
aclocal.m4
ChangeLog Daily bump. 2022-02-09 00:16:24 +00:00
ChangeLog-1998
ChangeLog-1999
ChangeLog-2000
ChangeLog-2001
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
ChangeLog-2019
ChangeLog-2020 libstdc++: Fix typo in ChangeLog-2020 2021-01-13 11:02:13 +00:00
ChangeLog-2021 Rotate ChangeLog files - part 1 - add ChangeLog-2021. 2022-01-03 10:18:16 +01:00
config.h.in libstdc++: Fix filesystem::remove_all races [PR104161] 2022-02-04 19:51:26 +00:00
configure libstdc++: Fix filesystem::remove_all races [PR104161] 2022-02-04 19:51:26 +00:00
configure.ac libstdc++: Remove -gdwarf-4 from flags for debug library 2022-01-19 19:31:00 +00:00
configure.host
crossconfig.m4 libstdc++: Check for TLS support on mingw cross-compilers 2021-09-15 09:49:33 +01:00
fragment.am libstdc++: Add C++ runtime support for new 128-bit long double format 2020-12-16 23:25:01 +00:00
linkage.m4
Makefile.am Update copyright years. 2022-01-03 10:42:10 +01:00
Makefile.in libstdc++: Define <stacktrace> header for C++23 2022-01-17 12:13:02 +00:00
README

file: libstdc++-v3/README

New users may wish to point their web browsers to the file
index.html in the 'doc/html' subdirectory.  It contains brief
building instructions and notes on how to configure the library in
interesting ways.