-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
TSAN Detected Data Race: Fix or Note as False Positive #71
Comments
sherry-yuan
added a commit
to sherry-yuan/fpga-runtime-for-opencl
that referenced
this issue
Feb 4, 2022
------------------------------------------------------ As found in intel#71, tsan reported several issues in the acl_test Currently when release command queue are called (which frees the memory) subsequent still checks the values at the same address which cause tsan to report heap-use-after-free. The test after_context_release are moved upward to be the first test because ctest execute the test in reverse order of how they appear in the cpp file. Given after_context_release will release the command queue, they should be run last, i.e place at the top in the test.cpp file
Merged
sherry-yuan
added a commit
to sherry-yuan/fpga-runtime-for-opencl
that referenced
this issue
Feb 7, 2022
------------------------------------------------------ As found in intel#71, tsan reported several issues in the acl_test Currently when release command queue are called (which frees the memory) subsequent still checks the values at the same address which cause tsan to report heap-use-after-free. The test after_context_release are moved upward to be the first test because ctest execute the test in reverse order of how they appear in the cpp file. Given after_context_release will release the command queue, they should be run last, i.e place at the top in the test.cpp file
sherry-yuan
added a commit
to sherry-yuan/fpga-runtime-for-opencl
that referenced
this issue
Feb 7, 2022
------------------------------------------------------ As found in intel#71, tsan reported several issues in the acl_test Currently when release command queue are called (which frees the memory) subsequent still checks the values at the same address which cause tsan to report heap-use-after-free.
sherry-yuan
added a commit
to sherry-yuan/fpga-runtime-for-opencl
that referenced
this issue
Feb 8, 2022
------------------------------------------------------ As found in intel#71, tsan reported several issues in the acl_test Currently when release command queue are called (which frees the memory) subsequent still checks the values at the same address which cause tsan to report heap-use-after-free.
sherry-yuan
added a commit
to sherry-yuan/fpga-runtime-for-opencl
that referenced
this issue
Feb 8, 2022
---------------------------------------------- Thread sanitizer (TSAN) is a tool that detect data races, deadlocks between threads. (it also sometimes report heap-use-after-free in same thread check intel#71 for issues reported in current repo) For more information, checkout https://clang.llvm.org/docs/ThreadSanitizer.html
pcolberg
pushed a commit
to sherry-yuan/fpga-runtime-for-opencl
that referenced
this issue
Feb 17, 2022
Thread sanitizer (TSAN) is a tool that detect data races and deadlocks between threads. (It also sometimes report heap-use-after-free in same thread check intel#71 for issues reported in current repo)
pcolberg
pushed a commit
that referenced
this issue
Feb 17, 2022
Thread sanitizer (TSAN) is a tool that detect data races and deadlocks between threads. (It also sometimes report heap-use-after-free in same thread check #71 for issues reported in current repo)
pcolberg
pushed a commit
to sherry-yuan/fpga-runtime-for-opencl
that referenced
this issue
Feb 17, 2022
As found in intel#71, tsan reported several issues in the acl_test Currently when release command queue are called (which frees the memory) subsequent still checks the values at the same address which cause tsan to report heap-use-after-free. 6: TEST(acl_command_queue, after_context_release)================== 6: WARNING: ThreadSanitizer: heap-use-after-free (pid=2499) 6: Read of size 4 at 0x7b3c000004c4 by main thread: 6: #0 acl_ref_count<_cl_command_queue*> ../include/acl_util.h:433 (acl_test+0x000000524583) 6: intel#1 acl_command_queue_after_context_release_Test::testBody() ../test/acl_command_queue_test.cpp:677 (acl_test+0x000000524583) 6: intel#2 Utest::executePlatformSpecificTestBody() ../lib/CppUTest/src/UtestPlatformGcc.cpp:82 (acl_test+0x0000009320a0) 6: intel#3 Utest::runInThread() ../lib/CppUTest/src/Utest.cpp:99 (acl_test+0x00000092fe78) 6: intel#4 acl_command_queue_after_context_release_Test::runInThreadOnCopy() ../test/acl_command_queue_test.cpp:622 (acl_test+0x000000538b4c) 6: intel#5 Utest::executePlatformSpecificRunInThreads() ../lib/CppUTest/src/UtestPlatformGcc.cpp:175 (acl_test+0x000000932582) 6: intel#6 Utest::run(TestResult&) ../lib/CppUTest/src/Utest.cpp:83 (acl_test+0x00000092fdd4) 6: intel#7 Utest::runOneTest(TestPlugin*, TestResult&) ../lib/CppUTest/src/Utest.cpp:69 (acl_test+0x00000092fcf2) 6: intel#8 Utest::executePlatformSpecificRunOneTest(TestPlugin*, TestResult&) ../lib/CppUTest/src/UtestPlatformGcc.cpp:100 (acl_test+0x0000009322be) 6: intel#9 Utest::runOneTestWithPlugins(TestPlugin*, TestResult&) ../lib/CppUTest/src/Utest.cpp:63 (acl_test+0x00000092fc77) 6: intel#10 TestRegistry::runAllTests(TestResult&) ../lib/CppUTest/src/TestRegistry.cpp:72 (acl_test+0x00000092f124) 6: intel#11 CommandLineTestRunner::runAllTests() ../lib/CppUTest/src/CommandLineTestRunner.cpp:105 (acl_test+0x00000092947d) 6: intel#12 CommandLineTestRunner::runAllTestsMain() ../lib/CppUTest/src/CommandLineTestRunner.cpp:81 (acl_test+0x0000009295bd) 6: intel#13 CommandLineTestRunner::RunAllTests(int, char const**) ../lib/CppUTest/src/CommandLineTestRunner.cpp:63 (acl_test+0x0000009296e4) 6: intel#14 main ../test/acl_test.cpp:90 (acl_test+0x00000090d2d4) 6: 6: Previous write of size 8 at 0x7b3c000004c0 by main thread (mutexes: write M41): 6: #0 operator delete(void*) /nfs/site/disks/swip_pr_1/kbrunham/p4root/depot/devenv/tools/gcc/7.4.0/work/src/libsanitizer/tsan/tsan_new_delete.cc:71 (libtsan.so.0+0x00000006af04) 6: intel#1 acl_delete<_cl_command_queue> ../include/acl_support.h:31 (acl_test+0x00000041118c) 6: intel#2 acl_free_cl_command_queue ../src/acl_command_queue.cpp:99 (acl_test+0x00000041118c) 6: intel#3 acl_delete_command_queue ../src/acl_command_queue.cpp:1005 (acl_test+0x000000411461) 6: intel#4 clReleaseCommandQueueIntelFPGA ../src/acl_command_queue.cpp:288 (acl_test+0x000000413a1e) 6: intel#5 clReleaseCommandQueue ../src/acl_command_queue.cpp:297 (acl_test+0x000000413a6e) 6: intel#6 acl_command_queue_after_context_release_Test::testBody() ../test/acl_command_queue_test.cpp:675 (acl_test+0x000000524379) 6: intel#7 Utest::executePlatformSpecificTestBody() ../lib/CppUTest/src/UtestPlatformGcc.cpp:82 (acl_test+0x0000009320a0) 6: intel#8 Utest::runInThread() ../lib/CppUTest/src/Utest.cpp:99 (acl_test+0x00000092fe78) 6: intel#9 acl_command_queue_after_context_release_Test::runInThreadOnCopy() ../test/acl_command_queue_test.cpp:622 (acl_test+0x000000538b4c) 6: intel#10 Utest::executePlatformSpecificRunInThreads() ../lib/CppUTest/src/UtestPlatformGcc.cpp:175 (acl_test+0x000000932582) 6: intel#11 Utest::run(TestResult&) ../lib/CppUTest/src/Utest.cpp:83 (acl_test+0x00000092fdd4) 6: intel#12 Utest::runOneTest(TestPlugin*, TestResult&) ../lib/CppUTest/src/Utest.cpp:69 (acl_test+0x00000092fcf2) 6: intel#13 Utest::executePlatformSpecificRunOneTest(TestPlugin*, TestResult&) ../lib/CppUTest/src/UtestPlatformGcc.cpp:100 (acl_test+0x0000009322be) 6: intel#14 Utest::runOneTestWithPlugins(TestPlugin*, TestResult&) ../lib/CppUTest/src/Utest.cpp:63 (acl_test+0x00000092fc77) 6: intel#15 TestRegistry::runAllTests(TestResult&) ../lib/CppUTest/src/TestRegistry.cpp:72 (acl_test+0x00000092f124) 6: intel#16 CommandLineTestRunner::runAllTests() ../lib/CppUTest/src/CommandLineTestRunner.cpp:105 (acl_test+0x00000092947d) 6: intel#17 CommandLineTestRunner::runAllTestsMain() ../lib/CppUTest/src/CommandLineTestRunner.cpp:81 (acl_test+0x0000009295bd) 6: intel#18 CommandLineTestRunner::RunAllTests(int, char const**) ../lib/CppUTest/src/CommandLineTestRunner.cpp:63 (acl_test+0x0000009296e4) 6: intel#19 main ../test/acl_test.cpp:90 (acl_test+0x00000090d2d4) 6: 6: Mutex M41 (0x000004dfc600) created at: 6: #0 pthread_mutex_init /nfs/site/disks/swip_pr_1/kbrunham/p4root/depot/devenv/tools/gcc/7.4.0/work/src/libsanitizer/tsan/tsan_interceptors.cc:1117 (libtsan.so.0+0x0000000291fe) 6: intel#1 acl_init_condvar ../lib/acl_threadsupport/src/acl_threadsupport.c:330 (acl_test+0x000000928951) 6: intel#2 l_global_lock_init ../src/acl_thread.cpp:102 (acl_test+0x0000004fe4eb) 6: intel#3 __libc_csu_init /home/abuild/rpmbuild/BUILD/glibc-2.22/csu/elf-init.c:88 (acl_test+0x00000093a06c) 6: 6: SUMMARY: ThreadSanitizer: heap-use-after-free ../include/acl_util.h:433 in acl_ref_count<_cl_command_queue*> 6: ================== 6: ================== 6: WARNING: ThreadSanitizer: heap-use-after-free (pid=2499) 6: Read of size 4 at 0x7b3c000003d4 by main thread: 6: #0 acl_ref_count<_cl_command_queue*> ../include/acl_util.h:433 (acl_test+0x000000524691) 6: intel#1 acl_command_queue_after_context_release_Test::testBody() ../test/acl_command_queue_test.cpp:678 (acl_test+0x000000524691) 6: intel#2 Utest::executePlatformSpecificTestBody() ../lib/CppUTest/src/UtestPlatformGcc.cpp:82 (acl_test+0x0000009320a0) 6: intel#3 Utest::runInThread() ../lib/CppUTest/src/Utest.cpp:99 (acl_test+0x00000092fe78) 6: intel#4 acl_command_queue_after_context_release_Test::runInThreadOnCopy() ../test/acl_command_queue_test.cpp:622 (acl_test+0x000000538b4c) 6: intel#5 Utest::executePlatformSpecificRunInThreads() ../lib/CppUTest/src/UtestPlatformGcc.cpp:175 (acl_test+0x000000932582) 6: intel#6 Utest::run(TestResult&) ../lib/CppUTest/src/Utest.cpp:83 (acl_test+0x00000092fdd4) 6: intel#7 Utest::runOneTest(TestPlugin*, TestResult&) ../lib/CppUTest/src/Utest.cpp:69 (acl_test+0x00000092fcf2) 6: intel#8 Utest::executePlatformSpecificRunOneTest(TestPlugin*, TestResult&) ../lib/CppUTest/src/UtestPlatformGcc.cpp:100 (acl_test+0x0000009322be) 6: intel#9 Utest::runOneTestWithPlugins(TestPlugin*, TestResult&) ../lib/CppUTest/src/Utest.cpp:63 (acl_test+0x00000092fc77) 6: intel#10 TestRegistry::runAllTests(TestResult&) ../lib/CppUTest/src/TestRegistry.cpp:72 (acl_test+0x00000092f124) 6: intel#11 CommandLineTestRunner::runAllTests() ../lib/CppUTest/src/CommandLineTestRunner.cpp:105 (acl_test+0x00000092947d) 6: intel#12 CommandLineTestRunner::runAllTestsMain() ../lib/CppUTest/src/CommandLineTestRunner.cpp:81 (acl_test+0x0000009295bd) 6: intel#13 CommandLineTestRunner::RunAllTests(int, char const**) ../lib/CppUTest/src/CommandLineTestRunner.cpp:63 (acl_test+0x0000009296e4) 6: intel#14 main ../test/acl_test.cpp:90 (acl_test+0x00000090d2d4) 6: 6: Previous write of size 8 at 0x7b3c000003d0 by main thread (mutexes: write M41): 6: #0 operator delete(void*) /nfs/site/disks/swip_pr_1/kbrunham/p4root/depot/devenv/tools/gcc/7.4.0/work/src/libsanitizer/tsan/tsan_new_delete.cc:71 (libtsan.so.0+0x00000006af04) 6: intel#1 acl_delete<_cl_command_queue> ../include/acl_support.h:31 (acl_test+0x00000041118c) 6: intel#2 acl_free_cl_command_queue ../src/acl_command_queue.cpp:99 (acl_test+0x00000041118c) 6: intel#3 acl_delete_command_queue ../src/acl_command_queue.cpp:1005 (acl_test+0x000000411461) 6: intel#4 clReleaseCommandQueueIntelFPGA ../src/acl_command_queue.cpp:288 (acl_test+0x000000413a1e) 6: intel#5 clReleaseCommandQueue ../src/acl_command_queue.cpp:297 (acl_test+0x000000413a6e) 6: intel#6 acl_command_queue_after_context_release_Test::testBody() ../test/acl_command_queue_test.cpp:676 (acl_test+0x00000052447d) 6: intel#7 Utest::executePlatformSpecificTestBody() ../lib/CppUTest/src/UtestPlatformGcc.cpp:82 (acl_test+0x0000009320a0) 6: intel#8 Utest::runInThread() ../lib/CppUTest/src/Utest.cpp:99 (acl_test+0x00000092fe78) 6: intel#9 acl_command_queue_after_context_release_Test::runInThreadOnCopy() ../test/acl_command_queue_test.cpp:622 (acl_test+0x000000538b4c) 6: intel#10 Utest::executePlatformSpecificRunInThreads() ../lib/CppUTest/src/UtestPlatformGcc.cpp:175 (acl_test+0x000000932582) 6: intel#11 Utest::run(TestResult&) ../lib/CppUTest/src/Utest.cpp:83 (acl_test+0x00000092fdd4) 6: intel#12 Utest::runOneTest(TestPlugin*, TestResult&) ../lib/CppUTest/src/Utest.cpp:69 (acl_test+0x00000092fcf2) 6: intel#13 Utest::executePlatformSpecificRunOneTest(TestPlugin*, TestResult&) ../lib/CppUTest/src/UtestPlatformGcc.cpp:100 (acl_test+0x0000009322be) 6: intel#14 Utest::runOneTestWithPlugins(TestPlugin*, TestResult&) ../lib/CppUTest/src/Utest.cpp:63 (acl_test+0x00000092fc77) 6: intel#15 TestRegistry::runAllTests(TestResult&) ../lib/CppUTest/src/TestRegistry.cpp:72 (acl_test+0x00000092f124) 6: intel#16 CommandLineTestRunner::runAllTests() ../lib/CppUTest/src/CommandLineTestRunner.cpp:105 (acl_test+0x00000092947d) 6: intel#17 CommandLineTestRunner::runAllTestsMain() ../lib/CppUTest/src/CommandLineTestRunner.cpp:81 (acl_test+0x0000009295bd) 6: intel#18 CommandLineTestRunner::RunAllTests(int, char const**) ../lib/CppUTest/src/CommandLineTestRunner.cpp:63 (acl_test+0x0000009296e4) 6: intel#19 main ../test/acl_test.cpp:90 (acl_test+0x00000090d2d4) 6: 6: Mutex M41 (0x000004dfc600) created at: 6: #0 pthread_mutex_init /nfs/site/disks/swip_pr_1/kbrunham/p4root/depot/devenv/tools/gcc/7.4.0/work/src/libsanitizer/tsan/tsan_interceptors.cc:1117 (libtsan.so.0+0x0000000291fe) 6: intel#1 acl_init_condvar ../lib/acl_threadsupport/src/acl_threadsupport.c:330 (acl_test+0x000000928951) 6: intel#2 l_global_lock_init ../src/acl_thread.cpp:102 (acl_test+0x0000004fe4eb) 6: intel#3 __libc_csu_init /home/abuild/rpmbuild/BUILD/glibc-2.22/csu/elf-init.c:88 (acl_test+0x00000093a06c) 6: 6: SUMMARY: ThreadSanitizer: heap-use-after-free ../include/acl_util.h:433 in acl_ref_count<_cl_command_queue*> 6: ================== 6: ================== 6: WARNING: ThreadSanitizer: heap-use-after-free (pid=2499) 6: Read of size 8 at 0x7b3c000004b8 by main thread (mutexes: write M41): 6: #0 int acl_is_valid_ptr<_cl_command_queue*>(_cl_command_queue* const&) ../include/acl_util.h:417 (acl_test+0x000000413780) 6: intel#1 acl_command_queue_is_valid(_cl_command_queue*) ../src/acl_command_queue.cpp:553 (acl_test+0x000000413780) 6: intel#2 acl_command_queue_after_context_release_Test::testBody() ../test/acl_command_queue_test.cpp:680 (acl_test+0x0000005247c5) 6: intel#3 Utest::executePlatformSpecificTestBody() ../lib/CppUTest/src/UtestPlatformGcc.cpp:82 (acl_test+0x0000009320a0) 6: intel#4 Utest::runInThread() ../lib/CppUTest/src/Utest.cpp:99 (acl_test+0x00000092fe78) 6: intel#5 acl_command_queue_after_context_release_Test::runInThreadOnCopy() ../test/acl_command_queue_test.cpp:622 (acl_test+0x000000538b4c) 6: intel#6 Utest::executePlatformSpecificRunInThreads() ../lib/CppUTest/src/UtestPlatformGcc.cpp:175 (acl_test+0x000000932582) 6: intel#7 Utest::run(TestResult&) ../lib/CppUTest/src/Utest.cpp:83 (acl_test+0x00000092fdd4) 6: intel#8 Utest::runOneTest(TestPlugin*, TestResult&) ../lib/CppUTest/src/Utest.cpp:69 (acl_test+0x00000092fcf2) 6: intel#9 Utest::executePlatformSpecificRunOneTest(TestPlugin*, TestResult&) ../lib/CppUTest/src/UtestPlatformGcc.cpp:100 (acl_test+0x0000009322be) 6: intel#10 Utest::runOneTestWithPlugins(TestPlugin*, TestResult&) ../lib/CppUTest/src/Utest.cpp:63 (acl_test+0x00000092fc77) 6: intel#11 TestRegistry::runAllTests(TestResult&) ../lib/CppUTest/src/TestRegistry.cpp:72 (acl_test+0x00000092f124) 6: intel#12 CommandLineTestRunner::runAllTests() ../lib/CppUTest/src/CommandLineTestRunner.cpp:105 (acl_test+0x00000092947d) 6: intel#13 CommandLineTestRunner::runAllTestsMain() ../lib/CppUTest/src/CommandLineTestRunner.cpp:81 (acl_test+0x0000009295bd) 6: intel#14 CommandLineTestRunner::RunAllTests(int, char const**) ../lib/CppUTest/src/CommandLineTestRunner.cpp:63 (acl_test+0x0000009296e4) 6: intel#15 main ../test/acl_test.cpp:90 (acl_test+0x00000090d2d4) 6: 6: Previous write of size 8 at 0x7b3c000004b8 by main thread (mutexes: write M41): 6: #0 operator delete(void*) /nfs/site/disks/swip_pr_1/kbrunham/p4root/depot/devenv/tools/gcc/7.4.0/work/src/libsanitizer/tsan/tsan_new_delete.cc:71 (libtsan.so.0+0x00000006af04) 6: intel#1 acl_delete<_cl_command_queue> ../include/acl_support.h:31 (acl_test+0x00000041118c) 6: intel#2 acl_free_cl_command_queue ../src/acl_command_queue.cpp:99 (acl_test+0x00000041118c) 6: intel#3 acl_delete_command_queue ../src/acl_command_queue.cpp:1005 (acl_test+0x000000411461) 6: intel#4 clReleaseCommandQueueIntelFPGA ../src/acl_command_queue.cpp:288 (acl_test+0x000000413a1e) 6: intel#5 clReleaseCommandQueue ../src/acl_command_queue.cpp:297 (acl_test+0x000000413a6e) 6: intel#6 acl_command_queue_after_context_release_Test::testBody() ../test/acl_command_queue_test.cpp:675 (acl_test+0x000000524379) 6: intel#7 Utest::executePlatformSpecificTestBody() ../lib/CppUTest/src/UtestPlatformGcc.cpp:82 (acl_test+0x0000009320a0) 6: intel#8 Utest::runInThread() ../lib/CppUTest/src/Utest.cpp:99 (acl_test+0x00000092fe78) 6: intel#9 acl_command_queue_after_context_release_Test::runInThreadOnCopy() ../test/acl_command_queue_test.cpp:622 (acl_test+0x000000538b4c) 6: intel#10 Utest::executePlatformSpecificRunInThreads() ../lib/CppUTest/src/UtestPlatformGcc.cpp:175 (acl_test+0x000000932582) 6: intel#11 Utest::run(TestResult&) ../lib/CppUTest/src/Utest.cpp:83 (acl_test+0x00000092fdd4) 6: intel#12 Utest::runOneTest(TestPlugin*, TestResult&) ../lib/CppUTest/src/Utest.cpp:69 (acl_test+0x00000092fcf2) 6: intel#13 Utest::executePlatformSpecificRunOneTest(TestPlugin*, TestResult&) ../lib/CppUTest/src/UtestPlatformGcc.cpp:100 (acl_test+0x0000009322be) 6: intel#14 Utest::runOneTestWithPlugins(TestPlugin*, TestResult&) ../lib/CppUTest/src/Utest.cpp:63 (acl_test+0x00000092fc77) 6: intel#15 TestRegistry::runAllTests(TestResult&) ../lib/CppUTest/src/TestRegistry.cpp:72 (acl_test+0x00000092f124) 6: intel#16 CommandLineTestRunner::runAllTests() ../lib/CppUTest/src/CommandLineTestRunner.cpp:105 (acl_test+0x00000092947d) 6: intel#17 CommandLineTestRunner::runAllTestsMain() ../lib/CppUTest/src/CommandLineTestRunner.cpp:81 (acl_test+0x0000009295bd) 6: intel#18 CommandLineTestRunner::RunAllTests(int, char const**) ../lib/CppUTest/src/CommandLineTestRunner.cpp:63 (acl_test+0x0000009296e4) 6: intel#19 main ../test/acl_test.cpp:90 (acl_test+0x00000090d2d4) 6: 6: Mutex M41 (0x000004dfc600) created at: 6: #0 pthread_mutex_init /nfs/site/disks/swip_pr_1/kbrunham/p4root/depot/devenv/tools/gcc/7.4.0/work/src/libsanitizer/tsan/tsan_interceptors.cc:1117 (libtsan.so.0+0x0000000291fe) 6: intel#1 acl_init_condvar ../lib/acl_threadsupport/src/acl_threadsupport.c:330 (acl_test+0x000000928951) 6: intel#2 l_global_lock_init ../src/acl_thread.cpp:102 (acl_test+0x0000004fe4eb) 6: intel#3 __libc_csu_init /home/abuild/rpmbuild/BUILD/glibc-2.22/csu/elf-init.c:88 (acl_test+0x00000093a06c) 6: 6: SUMMARY: ThreadSanitizer: heap-use-after-free ../include/acl_util.h:417 in int acl_is_valid_ptr<_cl_command_queue*>(_cl_command_queue* const&) 6: ================== 6: ================== 6: WARNING: ThreadSanitizer: heap-use-after-free (pid=2499) 6: Read of size 8 at 0x7b3c000003c8 by main thread (mutexes: write M41): 6: #0 int acl_is_valid_ptr<_cl_command_queue*>(_cl_command_queue* const&) ../include/acl_util.h:417 (acl_test+0x000000413780) 6: intel#1 acl_command_queue_is_valid(_cl_command_queue*) ../src/acl_command_queue.cpp:553 (acl_test+0x000000413780) 6: intel#2 acl_command_queue_after_context_release_Test::testBody() ../test/acl_command_queue_test.cpp:681 (acl_test+0x00000052482f) 6: intel#3 Utest::executePlatformSpecificTestBody() ../lib/CppUTest/src/UtestPlatformGcc.cpp:82 (acl_test+0x0000009320a0) 6: intel#4 Utest::runInThread() ../lib/CppUTest/src/Utest.cpp:99 (acl_test+0x00000092fe78) 6: intel#5 acl_command_queue_after_context_release_Test::runInThreadOnCopy() ../test/acl_command_queue_test.cpp:622 (acl_test+0x000000538b4c) 6: intel#6 Utest::executePlatformSpecificRunInThreads() ../lib/CppUTest/src/UtestPlatformGcc.cpp:175 (acl_test+0x000000932582) 6: intel#7 Utest::run(TestResult&) ../lib/CppUTest/src/Utest.cpp:83 (acl_test+0x00000092fdd4) 6: intel#8 Utest::runOneTest(TestPlugin*, TestResult&) ../lib/CppUTest/src/Utest.cpp:69 (acl_test+0x00000092fcf2) 6: intel#9 Utest::executePlatformSpecificRunOneTest(TestPlugin*, TestResult&) ../lib/CppUTest/src/UtestPlatformGcc.cpp:100 (acl_test+0x0000009322be) 6: intel#10 Utest::runOneTestWithPlugins(TestPlugin*, TestResult&) ../lib/CppUTest/src/Utest.cpp:63 (acl_test+0x00000092fc77) 6: intel#11 TestRegistry::runAllTests(TestResult&) ../lib/CppUTest/src/TestRegistry.cpp:72 (acl_test+0x00000092f124) 6: intel#12 CommandLineTestRunner::runAllTests() ../lib/CppUTest/src/CommandLineTestRunner.cpp:105 (acl_test+0x00000092947d) 6: intel#13 CommandLineTestRunner::runAllTestsMain() ../lib/CppUTest/src/CommandLineTestRunner.cpp:81 (acl_test+0x0000009295bd) 6: intel#14 CommandLineTestRunner::RunAllTests(int, char const**) ../lib/CppUTest/src/CommandLineTestRunner.cpp:63 (acl_test+0x0000009296e4) 6: intel#15 main ../test/acl_test.cpp:90 (acl_test+0x00000090d2d4) 6: 6: Previous write of size 8 at 0x7b3c000003c8 by main thread (mutexes: write M41): 6: #0 operator delete(void*) /nfs/site/disks/swip_pr_1/kbrunham/p4root/depot/devenv/tools/gcc/7.4.0/work/src/libsanitizer/tsan/tsan_new_delete.cc:71 (libtsan.so.0+0x00000006af04) 6: intel#1 acl_delete<_cl_command_queue> ../include/acl_support.h:31 (acl_test+0x00000041118c) 6: intel#2 acl_free_cl_command_queue ../src/acl_command_queue.cpp:99 (acl_test+0x00000041118c) 6: intel#3 acl_delete_command_queue ../src/acl_command_queue.cpp:1005 (acl_test+0x000000411461) 6: intel#4 clReleaseCommandQueueIntelFPGA ../src/acl_command_queue.cpp:288 (acl_test+0x000000413a1e) 6: intel#5 clReleaseCommandQueue ../src/acl_command_queue.cpp:297 (acl_test+0x000000413a6e) 6: intel#6 acl_command_queue_after_context_release_Test::testBody() ../test/acl_command_queue_test.cpp:676 (acl_test+0x00000052447d) 6: intel#7 Utest::executePlatformSpecificTestBody() ../lib/CppUTest/src/UtestPlatformGcc.cpp:82 (acl_test+0x0000009320a0) 6: intel#8 Utest::runInThread() ../lib/CppUTest/src/Utest.cpp:99 (acl_test+0x00000092fe78) 6: intel#9 acl_command_queue_after_context_release_Test::runInThreadOnCopy() ../test/acl_command_queue_test.cpp:622 (acl_test+0x000000538b4c) 6: intel#10 Utest::executePlatformSpecificRunInThreads() ../lib/CppUTest/src/UtestPlatformGcc.cpp:175 (acl_test+0x000000932582) 6: intel#11 Utest::run(TestResult&) ../lib/CppUTest/src/Utest.cpp:83 (acl_test+0x00000092fdd4) 6: intel#12 Utest::runOneTest(TestPlugin*, TestResult&) ../lib/CppUTest/src/Utest.cpp:69 (acl_test+0x00000092fcf2) 6: intel#13 Utest::executePlatformSpecificRunOneTest(TestPlugin*, TestResult&) ../lib/CppUTest/src/UtestPlatformGcc.cpp:100 (acl_test+0x0000009322be) 6: intel#14 Utest::runOneTestWithPlugins(TestPlugin*, TestResult&) ../lib/CppUTest/src/Utest.cpp:63 (acl_test+0x00000092fc77) 6: intel#15 TestRegistry::runAllTests(TestResult&) ../lib/CppUTest/src/TestRegistry.cpp:72 (acl_test+0x00000092f124) 6: intel#16 CommandLineTestRunner::runAllTests() ../lib/CppUTest/src/CommandLineTestRunner.cpp:105 (acl_test+0x00000092947d) 6: intel#17 CommandLineTestRunner::runAllTestsMain() ../lib/CppUTest/src/CommandLineTestRunner.cpp:81 (acl_test+0x0000009295bd) 6: intel#18 CommandLineTestRunner::RunAllTests(int, char const**) ../lib/CppUTest/src/CommandLineTestRunner.cpp:63 (acl_test+0x0000009296e4) 6: intel#19 main ../test/acl_test.cpp:90 (acl_test+0x00000090d2d4) 6: 6: Mutex M41 (0x000004dfc600) created at: 6: #0 pthread_mutex_init /nfs/site/disks/swip_pr_1/kbrunham/p4root/depot/devenv/tools/gcc/7.4.0/work/src/libsanitizer/tsan/tsan_interceptors.cc:1117 (libtsan.so.0+0x0000000291fe) 6: intel#1 acl_init_condvar ../lib/acl_threadsupport/src/acl_threadsupport.c:330 (acl_test+0x000000928951) 6: intel#2 l_global_lock_init ../src/acl_thread.cpp:102 (acl_test+0x0000004fe4eb) 6: intel#3 __libc_csu_init /home/abuild/rpmbuild/BUILD/glibc-2.22/csu/elf-init.c:88 (acl_test+0x00000093a06c) 6: 6: SUMMARY: ThreadSanitizer: heap-use-after-free ../include/acl_util.h:417 in int acl_is_valid_ptr<_cl_command_queue*>(_cl_command_queue* const&) 6: ================== 6: - 227 ms
pcolberg
pushed a commit
to sherry-yuan/fpga-runtime-for-opencl
that referenced
this issue
Feb 18, 2022
As found in intel#71, tsan reported several issues in the acl_test Currently when release command queue are called (which frees the memory) subsequent still checks the values at the same address which cause tsan to report heap-use-after-free.
pcolberg
pushed a commit
that referenced
this issue
Feb 18, 2022
------------------------------------------------------ As found in #71, tsan reported several issues in the acl_test Currently when release command queue are called (which frees the memory) subsequent still checks the values at the same address which cause tsan to report heap-use-after-free.
Reopening since the issues in acl_threadsupport_test still need to be resolved as a prerequisite for #63. This is not a third-party library and can be modified. Even if it were a third-party library, the issue would need to be resolved, ideally upstream 🙂 |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
The following are list of tsan detected data races
The following happened in threadsupport package (which we should note as false positive, given we don't want to change these third party libraries.
The following are found in our source code which is what we should care about
The text was updated successfully, but these errors were encountered: