Joe VanAndel
2015-02-19 00:14:49 UTC
Iâm using valgrind 3.10.1 to look for races in my Wt application.
When I run valgrindâs helgrind thread tool on the Wt example âblogâ
application, it warns me of several races.
/usr/local/bin/valgrind --tool=helgrind --verbose \
--suppressions=/home/vanandel/valgrind/wt_valgrind_suppressions \
--suppressions=/home/vanandel/valgrind/boost_thread.sup \
--gen-suppressions=yes \
--vgdb=yes --vgdb-error=0 \
../../build_boost_1_57_0/examples/blog/blog.wt --docroot . --http-address
0.0.0.0 --http-port 8081
FYI: I get similar warnings from helgrind if I compile against boost
1_56_0.
Iâve attached two of the races the helgrind detects.
wt_boost_race1 <http://pastebin.com/831vMuK5>
The following race condition is quite interesting:
It appears that a http::server::TcpConnection object is being destroyed as
a result of a boost:shared_ptr() being destroyed, while another thread is
still using the TcpConnection object.
Since boost::shared_ptr is supposed to be thread safe, it isnât obvious how
this could happen.
wt_boost_TcpConnec⊠<http://pastebin.com/zErMzYvL>
Iâd be happy to post more examples of race conditions detected by helgrind.
Joe VanAndel
NCAR/EOL
When I run valgrindâs helgrind thread tool on the Wt example âblogâ
application, it warns me of several races.
/usr/local/bin/valgrind --tool=helgrind --verbose \
--suppressions=/home/vanandel/valgrind/wt_valgrind_suppressions \
--suppressions=/home/vanandel/valgrind/boost_thread.sup \
--gen-suppressions=yes \
--vgdb=yes --vgdb-error=0 \
../../build_boost_1_57_0/examples/blog/blog.wt --docroot . --http-address
0.0.0.0 --http-port 8081
FYI: I get similar warnings from helgrind if I compile against boost
1_56_0.
Iâve attached two of the races the helgrind detects.
wt_boost_race1 <http://pastebin.com/831vMuK5>
The following race condition is quite interesting:
It appears that a http::server::TcpConnection object is being destroyed as
a result of a boost:shared_ptr() being destroyed, while another thread is
still using the TcpConnection object.
Since boost::shared_ptr is supposed to be thread safe, it isnât obvious how
this could happen.
wt_boost_TcpConnec⊠<http://pastebin.com/zErMzYvL>
Iâd be happy to post more examples of race conditions detected by helgrind.
Joe VanAndel
NCAR/EOL