$ valgrind --tool=helgrind --ignore-thread-creation=yes ./a.out
==6316== Helgrind, a thread error detector
==6316== Copyright (C) 2007-2015, and GNU GPL'd, by OpenWorks LLP et al.
==6316== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==6316== Command: ./a.out
==6316==
<<snipped noise>>
==6316== Possible data race during read of size 4 at 0x6051A8 by thread #3
==6316== Locks held: none
==6316== at 0x400E45: hello(int, int*) (in /home/sc/Documents/a.out)
==6316== by 0x4028E3: void std::_Bind_simple<void (*(int, int*))(int, int*)>::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) (in /home/sc/Documents/a.out)
==6316== by 0x40279F: std::_Bind_simple<void (*(int, int*))(int, int*)>::operator()() (in /home/sc/Documents/a.out)
==6316== by 0x40272F: std::thread::_Impl<std::_Bind_simple<void (*(int, int*))(int, int*)> >::_M_run() (in /home/sc/Documents/a.out)
==6316== by 0x4EF8C7F: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==6316== by 0x4C34DB6: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==6316== by 0x53DF6B9: start_thread (pthread_create.c:333)
==6316== by 0x56FC41C: clone (clone.S:109)
==6316==
==6316== This conflicts with a previous write of size 4 by thread #2
==6316== Locks held: none
==6316== at 0x400E50: hello(int, int*) (in /home/sc/Documents/a.out)
==6316== by 0x4028E3: void std::_Bind_simple<void (*(int, int*))(int, int*)>::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) (in /home/sc/Documents/a.out)
==6316== by 0x40279F: std::_Bind_simple<void (*(int, int*))(int, int*)>::operator()() (in /home/sc/Documents/a.out)
==6316== by 0x40272F: std::thread::_Impl<std::_Bind_simple<void (*(int, int*))(int, int*)> >::_M_run() (in /home/sc/Documents/a.out)
==6316== by 0x4EF8C7F: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==6316== by 0x4C34DB6: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==6316== by 0x53DF6B9: start_thread (pthread_create.c:333)
==6316== by 0x56FC41C: clone (clone.S:109)
==6316== Address 0x6051a8 is 0 bytes inside data symbol "sum"
==6316==
==6316== ----------------------------------------------------------------
==6316==
==6316== Possible data race during write of size 4 at 0x6051A8 by thread #3
==6316== Locks held: none
==6316== at 0x400E50: hello(int, int*) (in /home/sc/Documents/a.out)
==6316== by 0x4028E3: void std::_Bind_simple<void (*(int, int*))(int, int*)>::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) (in /home/sc/Documents/a.out)
==6316== by 0x40279F: std::_Bind_simple<void (*(int, int*))(int, int*)>::operator()() (in /home/sc/Documents/a.out)
==6316== by 0x40272F: std::thread::_Impl<std::_Bind_simple<void (*(int, int*))(int, int*)> >::_M_run() (in /home/sc/Documents/a.out)
==6316== by 0x4EF8C7F: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==6316== by 0x4C34DB6: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==6316== by 0x53DF6B9: start_thread (pthread_create.c:333)
==6316== by 0x56FC41C: clone (clone.S:109)
==6316==
==6316== This conflicts with a previous write of size 4 by thread #2
==6316== Locks held: none
==6316== at 0x400E50: hello(int, int*) (in /home/sc/Documents/a.out)
==6316== by 0x4028E3: void std::_Bind_simple<void (*(int, int*))(int, int*)>::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) (in /home/sc/Documents/a.out)
==6316== by 0x40279F: std::_Bind_simple<void (*(int, int*))(int, int*)>::operator()() (in /home/sc/Documents/a.out)
==6316== by 0x40272F: std::thread::_Impl<std::_Bind_simple<void (*(int, int*))(int, int*)> >::_M_run() (in /home/sc/Documents/a.out)
==6316== by 0x4EF8C7F: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==6316== by 0x4C34DB6: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==6316== by 0x53DF6B9: start_thread (pthread_create.c:333)
==6316== by 0x56FC41C: clone (clone.S:109)
==6316== Address 0x6051a8 is 0 bytes inside data symbol "sum"
|