This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/63736] gcc generated program with segfault on atomic exchange when the atomic variable is a member of a struct allocated with make_shared
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 08 Nov 2014 16:13:07 +0000
- Subject: [Bug c++/63736] gcc generated program with segfault on atomic exchange when the atomic variable is a member of a struct allocated with make_shared
- Auto-submitted: auto-generated
- References: <bug-63736-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63736
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |4.9.2, 5.0
Known to fail| |4.8.2
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I can reproduce it with 4.8.2 and can confirm it seems to be fixed in 4.9.0
(even when linking to the libatomic.so from 4.8.2)
#0 0x00007ffff7dcc898 in libat_exchange_16_i1 (mptr=0x604028,
newval=<optimized out>, smodel=<optimized out>) at
../../../libatomic/exch_n.c:54
#1 0x00000000004011b4 in std::atomic<TwoFieldStruct>::exchange (this=0x604028,
__i=..., _m=std::memory_order_seq_cst) at /usr/include/c++/4.8.3/atomic:225
#2 0x0000000000401111 in PStruct::setMs (this=0x604028, ms=...) at
/var/tmp/atomic_of_struct_test.cpp:18
#3 0x0000000000400fb1 in main () at /var/tmp/atomic_of_struct_test.cpp:39