2017-08-30 30 views
0

根據helgrind文檔,比賽報告有兩個堆棧跟蹤 - 一個是檢測到比賽的地方,另一個是在另一個線程中讀取/寫入同一位置的地點,沒有前/後關係。helgrind報告沒有衝突的比賽 - 這是什麼意思?

我有一種情況(下面的完整錯誤)helgrind只報告比賽位置,但沒有衝突的位置。那是什麼意思?這是一個複雜的代碼庫,我不知道如何在更簡單的代碼上進行重現。通常情況下,我會按預期看到2個堆棧軌跡。

==10720== Possible data race during read of size 4 at 0x89886CC by thread #2 
==10720== Locks held: none 
==10720== at 0x5111BDA: proactor_do_epoll (epoll.c:1816) 
==10720== by 0x5111AD9: pn_proactor_wait (epoll.c:1842) 
==10720== by 0x4EB8CF1: proton::container::impl::thread() (proactor_container_impl.cpp:467) 
==10720== by 0x4EB949B: proton::container::impl::run(int) (proactor_container_impl.cpp:509) 
==10720== by 0x4EB5D51: proton::container::run() (container.cpp:83) 
==10720== by 0x40D2F7: main::$_0::operator()() const (multithreaded_client_flow_control.cpp:267) 
==10720== by 0x40D2B4: void std::_Bind_simple<main::$_0()>::_M_invoke<>(std::_Index_tuple<>) (functional:1390) 
==10720== by 0x40D284: std::_Bind_simple<main::$_0()>::operator()() (functional:1380) 
==10720== by 0x40D178: std::thread::_State_impl<std::_Bind_simple<main::$_0()> >::_M_run() (thread:197) 
==10720== by 0x613776E: execute_native_thread_routine (thread.cc:83) 
==10720== by 0x4C34A14: mythread_wrapper (hg_intercepts.c:389) 
==10720== by 0x5E65739: start_thread (pthread_create.c:333) 
==10720== Address 0x89886cc is 44 bytes inside a block of size 1,728 alloc'd 
==10720== at 0x4C30E70: calloc (vg_replace_malloc.c:711) 
==10720== by 0x5329B1E: pn_object_new (object.c:202) 
==10720== by 0x5329E30: pn_class_new (object.c:61) 
==10720== by 0x510F844: new_pconnection_t (epoll.c:697) 
==10720== by 0x510F668: pn_proactor_connect (epoll.c:1217) 
==10720== by 0x4EB742B: proton::container::impl::start_connection(proton::url const&, pn_connection_t*) (proactor_container_impl.cpp:196) 
==10720== by 0x4EB7708: proton::container::impl::open_sender(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, proton::sender_options const&, proton::connection_options const&) (proactor_container_impl.cpp:226) 
==10720== by 0x4EB57F6: proton::container::open_sender(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, proton::sender_options const&, proton::connection_options const&) (container.cpp:97) 
==10720== by 0x4EB58FA: proton::container::open_sender(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, proton::connection_options const&) (container.cpp:52) 
==10720== by 0x40E3C0: sender::sender(proton::container&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (multithreaded_client_flow_control.cpp:80) 
==10720== by 0x40C6DD: main (multithreaded_client_flow_control.cpp:270) 
==10720== Block was alloc'd by thread #1 

回答

0

您可以指定3個級別,在這helgrind會記住比賽的 '過去' 訪問:

- 歷史級=無|約|全[全文]

缺省值已滿,這表示記錄每個過去訪問的堆棧跟蹤。但是,這種記錄的過去堆棧軌跡的數量是有限的。在你的情況下,可能是衝突訪問太舊了,它的堆棧跟蹤被「清理」了。

您可以通過使用

--conflict緩存大小增加過往的堆棧跟蹤量獲得過去的堆棧跟蹤=的「完整」的歷史緩存大小ň[2000000]

如果您有足夠的內存,您可以嘗試使用允許的最大值 (150000000)。