https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60078
--- Comment #14 from Bernd Edlinger <bernd.edlinger at hotmail dot de> --- Well, that happened only once. and the problem did never ever repeat. But my gut feeling is still that there is a race conditition. However I have been recently working on TSAN a bit, and I have an experimental tsan version that I played with. Initially it ICE'd on Ada's VIEW_CONVERT_EXPRs, but when I fixed that I got: gnatmake -g -fsanitize=thread c761007 ./c761007 ,.,. C761007 ACATS 2.5 15-01-01 15:29:05 ---- C761007 Check that if a finalize procedure invoked by a transfer of control or selection of a terminate alternative attempts to propagate an exception, the exception is ignored, but any other finalizations due to be performed are performed. ================== WARNING: ThreadSanitizer: data race (pid=27044) Read of size 4 at 0x000000657764 by thread T5: #0 c761007_1__finalize /home/ed/gnu/gcc-test/c761007_1.adb:10 (c761007+0x00000040c749) #1 c761007_1__containerDF <null> (c761007+0x00000040bc3b) #2 c761007_2__prot_w_fin_objVDF <null> (c761007+0x000000404364) #3 c761007__subtest_3__check_atc_operation___finalizer.5515 <null> (c761007+0x00000040efd2) #4 c761007__subtest_3__check_atc_operation.5508 <null> (c761007+0x00000040f1ec) #5 c761007__subtest_3__subtest_3_taskTKB.5506 <null> (c761007+0x00000040f5de) #6 system__tasking__stages__task_wrapper /home/ed/gnu/gcc-build/gcc/ada/rts/s-tassta.adb:1262 (c761007+0x000000418800) Previous write of size 4 at 0x000000657764 by thread T6: #0 c761007_1__finalize /home/ed/gnu/gcc-test/c761007_1.adb:17 (c761007+0x00000040c859) #1 c761007_1__containerDF <null> (c761007+0x00000040bc3b) #2 c761007_2__prot_w_fin_objVDF <null> (c761007+0x000000404364) #3 c761007__subtest_3__subtest_3_taskTK__nestingTK___finalizer.5573 <null> (c761007+0x00000040f854) #4 c761007__subtest_3__subtest_3_taskTK__nestingTKB.5565 <null> (c761007+0x00000040fa2a) #5 system__tasking__stages__task_wrapper /home/ed/gnu/gcc-build/gcc/ada/rts/s-tassta.adb:1262 (c761007+0x000000418800) Location is global 'c761007_1__side_effect_finger' of size 4 at 0x000000657764 (c761007+0x000000657764) Thread T5 'subtest_3_task' (tid=27050, running) created by main thread at: #0 pthread_create ../../../../gcc-trunk/libsanitizer/tsan/tsan_interceptors.cc:895 (libtsan.so.0+0x0000000272f4) #1 system__task_primitives__operations__create_task /home/ed/gnu/gcc-build/gcc/ada/rts/s-taprop.adb:1016 (c761007+0x000000411d72) #2 _ada_c761007 /home/ed/gnu/gcc-test/c761007.adb:228 (c761007+0x00000040d551) #3 main /home/ed/gnu/gcc-test/b~c761007.adb:331 (c761007+0x0000004042e4) Thread T6 'nesting' (tid=27051, running) created by thread T5 at: #0 pthread_create ../../../../gcc-trunk/libsanitizer/tsan/tsan_interceptors.cc:895 (libtsan.so.0+0x0000000272f4) #1 system__task_primitives__operations__create_task /home/ed/gnu/gcc-build/gcc/ada/rts/s-taprop.adb:1016 (c761007+0x000000411d72) #2 system__tasking__stages__task_wrapper /home/ed/gnu/gcc-build/gcc/ada/rts/s-tassta.adb:1262 (c761007+0x000000418800) SUMMARY: ThreadSanitizer: data race /home/ed/gnu/gcc-test/c761007_1.adb:10 c761007_1__finalize ================== ================== WARNING: ThreadSanitizer: data race (pid=27044) Read of size 1 at 0x00000065a343 by thread T5: #0 c761007_1__finalize /home/ed/gnu/gcc-test/c761007_1.adb:12 (c761007+0x00000040c7d4) #1 c761007_1__containerDF <null> (c761007+0x00000040bc3b) #2 c761007_2__prot_w_fin_objVDF <null> (c761007+0x000000404364) #3 c761007__subtest_3__check_atc_operation___finalizer.5515 <null> (c761007+0x00000040efd2) #4 c761007__subtest_3__check_atc_operation.5508 <null> (c761007+0x00000040f1ec) #5 c761007__subtest_3__subtest_3_taskTKB.5506 <null> (c761007+0x00000040f5de) #6 system__tasking__stages__task_wrapper /home/ed/gnu/gcc-build/gcc/ada/rts/s-tassta.adb:1262 (c761007+0x000000418800) Previous write of size 1 at 0x00000065a343 by thread T6: #0 c761007_1__finalize /home/ed/gnu/gcc-test/c761007_1.adb:18 (c761007+0x00000040c902) #1 c761007_1__containerDF <null> (c761007+0x00000040bc3b) #2 c761007_2__prot_w_fin_objVDF <null> (c761007+0x000000404364) #3 c761007__subtest_3__subtest_3_taskTK__nestingTK___finalizer.5573 <null> (c761007+0x00000040f854) #4 c761007__subtest_3__subtest_3_taskTK__nestingTKB.5565 <null> (c761007+0x00000040fa2a) #5 system__tasking__stages__task_wrapper /home/ed/gnu/gcc-build/gcc/ada/rts/s-tassta.adb:1262 (c761007+0x000000418800) Location is global 'c761007_1__side_effect' of size 80 at 0x00000065a340 (c761007+0x00000065a343) Thread T5 'subtest_3_task' (tid=27050, running) created by main thread at: #0 pthread_create ../../../../gcc-trunk/libsanitizer/tsan/tsan_interceptors.cc:895 (libtsan.so.0+0x0000000272f4) #1 system__task_primitives__operations__create_task /home/ed/gnu/gcc-build/gcc/ada/rts/s-taprop.adb:1016 (c761007+0x000000411d72) #2 _ada_c761007 /home/ed/gnu/gcc-test/c761007.adb:228 (c761007+0x00000040d551) #3 main /home/ed/gnu/gcc-test/b~c761007.adb:331 (c761007+0x0000004042e4) Thread T6 'nesting' (tid=27051, running) created by thread T5 at: #0 pthread_create ../../../../gcc-trunk/libsanitizer/tsan/tsan_interceptors.cc:895 (libtsan.so.0+0x0000000272f4) #1 system__task_primitives__operations__create_task /home/ed/gnu/gcc-build/gcc/ada/rts/s-taprop.adb:1016 (c761007+0x000000411d72) #2 system__tasking__stages__task_wrapper /home/ed/gnu/gcc-build/gcc/ada/rts/s-tassta.adb:1262 (c761007+0x000000418800) SUMMARY: ThreadSanitizer: data race /home/ed/gnu/gcc-test/c761007_1.adb:12 c761007_1__finalize ================== ==== C761007 PASSED ============================. ThreadSanitizer: reported 2 warnings