Advertisement
Guest User

ThreadSanitizer result for std::atomic

a guest
Jun 30th, 2014
400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. $ make
  2. clang++ main.cpp -pthread -fsanitize=thread -O0 -g -ggdb3 -fPIE -pie -fPIC -std=c++11
  3.  
  4. $ ./a.out
  5. ==================
  6. WARNING: ThreadSanitizer: data race (pid=11469)
  7. Write of size 1 at 0x7d040000f7f0 by thread T2:
  8. #0 operator delete(void*) ??:0 (exe+0x0000000425bb)
  9. #1 ReferenceCounted::release() /home/A.Romanek/tmp/tsan/main.cpp:16 (exe+0x0000000a08d2)
  10. #2 Thread2(void*) /home/A.Romanek/tmp/tsan/main.cpp:30 (exe+0x0000000a0663)
  11.  
  12. Previous atomic write of size 4 at 0x7d040000f7f0 by thread T1:
  13. #0 __tsan_atomic32_fetch_sub ??:0 (exe+0x00000008528a)
  14. #1 std::__atomic_base<int>::fetch_sub(int, std::memory_order) /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/atomic_base.h:624 (exe+0x0000000a0e1f)
  15. #2 ReferenceCounted::release() /home/A.Romanek/tmp/tsan/main.cpp:13 (exe+0x0000000a08a1)
  16. #3 Thread1(void*) /home/A.Romanek/tmp/tsan/main.cpp:25 (exe+0x0000000a0603)
  17.  
  18. Location is heap block of size 4 at 0x7d040000f7f0 allocated by main thread:
  19. #0 operator new(unsigned long) ??:0 (exe+0x000000041f49)
  20. #1 main /home/A.Romanek/tmp/tsan/main.cpp:35 (exe+0x0000000a069f)
  21.  
  22. Thread T2 (tid=11472, running) created by main thread at:
  23. #0 pthread_create ??:0 (exe+0x000000045bfb)
  24. #1 main /home/A.Romanek/tmp/tsan/main.cpp:41 (exe+0x0000000a077e)
  25.  
  26. Thread T1 (tid=11471, finished) created by main thread at:
  27. #0 pthread_create ??:0 (exe+0x000000045bfb)
  28. #1 main /home/A.Romanek/tmp/tsan/main.cpp:40 (exe+0x0000000a0742)
  29.  
  30. SUMMARY: ThreadSanitizer: data race ??:0 operator delete(void*)
  31. ==================
  32. ThreadSanitizer: reported 1 warnings
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement