C++ Drd-如何解释这一点;“其他部分”;调用堆栈?

C++ Drd-如何解释这一点;“其他部分”;调用堆栈?,c++,valgrind,race-condition,C++,Valgrind,Race Condition,我正在运行drd来捕获一些遗留代码中的数据竞争。我知道drd在段上工作,而不是在单个指令上,我希望在其他段开始和其他段结束的调用堆栈之间找到一个共同点,但事实并非如此 ==12982== Thread 5: ==12982== Conflicting load by thread 5 at 0x0060e6b0 size 8 ==12982== at 0x4F2CBEB: std::_Rb_tree<int, std::pair<int const, CMNSSrvNestin

我正在运行drd来捕获一些遗留代码中的数据竞争。我知道drd在段上工作,而不是在单个指令上,我希望在其他段开始其他段结束的调用堆栈之间找到一个共同点,但事实并非如此

==12982== Thread 5:
==12982== Conflicting load by thread 5 at 0x0060e6b0 size 8
==12982==    at 0x4F2CBEB: std::_Rb_tree<int, std::pair<int const, CMNSSrvNesting*>, std::_Select1st<std::pair<int const, CMNSSrvNesting*> >, std::less<int>, std::allocator<std::pair<int const, CMNSSrvNesting*> > >::find(int const&) (stl_tree.h:502)
==12982==    by 0x4F27FBE: CMetiMNSSrv::GetSockDataPtr(int, int) (stl_map.h:822)
==12982==    by 0x4F2A8E2: CMetiMNSSrv::ServerMessagesHandler(t_blkLx, unsigned char*, CAsyncSocketL*, void*) (MetiMNSSrv.cpp:957)
==12982==    by 0x507A705: CAsyncSocketL::SockHandlerCallback(void*, t_blkLx*, unsigned char*) (TWSocketLinux.cpp:417)
==12982==    by 0x518F2D1: _SK_Connection_handler (twlsocket.c:434)
==12982==    by 0x4C30E7B: ??? (in /usr/lib/valgrind/vgpreload_drd-amd64-linux.so)
==12982==    by 0x685F181: start_thread (pthread_create.c:312)
==12982==    by 0x6B6F47C: clone (clone.S:111)
==12982== Allocation context: BSS section of /home/teseo/bin/LiMNEGUI/LiMNEGUI
==12982== Other segment start (thread 4)
==12982==    at 0x4C34544: pthread_mutex_unlock (in /usr/lib/valgrind/vgpreload_drd-amd64-linux.so)
==12982==    by 0x5135589: pthreadMutexLeave (sqlite3.c:18998)
==12982==    by 0x5122E3F: sqlite3_mutex_leave (sqlite3.c:18451)
==12982==    by 0x5123321: sqlite3_free (sqlite3.c:19929)
==12982==    by 0x5168349: sqlite3LeaveMutexAndCloseZombie (sqlite3.c:122082)
==12982==    by 0x51685A4: sqlite3Close (sqlite3.c:121948)
==12982==    by 0x51685C5: sqlite3_close (sqlite3.c:121961)
==12982==    by 0x518FA7F: Sqlite3Db::~Sqlite3Db() (twnestshared.cpp:89)
==12982==    by 0x519A346: CIniFile::SetValue(std::string const&, std::string const&, std::string const&, std::string const&) (twnestshared.cpp:1264)
==12982==    by 0x519B148: CMetiReg::SerialItem(char const*, unsigned int*, unsigned int, char const*) (twnestshared.cpp:1431)
==12982==    by 0x4F22D6F: CMetiMNSSrv::SetRegistryVal(char const*, char const*, unsigned int, bool) (MetiMNSSrv.cpp:72)
==12982==    by 0x4F24BAE: CMNSSrvNesting::SetLastOperationTime(bool, unsigned int, unsigned long long, unsigned long long) (MetiMNSSrv.cpp:616)
==12982== Other segment end (thread 4)
==12982==    at 0x68667EB: recv (recv.c:33)
==12982==    by 0x518E736: SK_GetBytes (socket2.h:44)
==12982==    by 0x518E8D6: SK_GetBlock (twlsocket.c:858)
==12982==    by 0x518F19D: _SK_Connection_handler (twlsocket.c:407)
==12982==    by 0x4C30E7B: ??? (in /usr/lib/valgrind/vgpreload_drd-amd64-linux.so)
==12982==    by 0x685F181: start_thread (pthread_create.c:312)
==12982==    by 0x6B6F47C: clone (clone.S:111)
==12982==线程5:
==12982==0x0060e6b0大小为8时线程5的负载冲突
==12982==at 0x4F2CBEB:std:_Rb_tree::find(int const&)(stl_tree.h:502)
==12982==0x4F27FBE:CMetiMNSSrv::GetSockDataPtr(int,int)(stl_map.h:822)
==12982==0x4F2A8E2:CMetiMNSSrv::ServerMessagesHandler(t_blkLx,unsigned char*,CAsyncSocketL*,void*)(MetiMNSSrv.cpp:957)
==12982==by 0x507A705:CAsyncSocketL::SockHandlerCallback(void*,t_blkLx*,unsigned char*)(TWSocketLinux.cpp:417)
==12982==0x518F2D1:_SK_Connection_处理程序(twlsocket.c:434)
==12982==0x4C30E7B:???(在/usr/lib/valgrind/vgpreload_drd-amd64-linux.so中)
==12982==by 0x685F181:start_线程(pthread_create.c:312)
==12982==by0x6b6f47c:clone(clone.S:111)
==12982==分配上下文:BSS节/home/teseo/bin/LiMNEGUI/LiMNEGUI
==12982==其他段开始(线程4)
==12982==0x4C34544:pthread_mutex_unlock(在/usr/lib/valgrind/vgpreload_drd-amd64-linux.so中)
==12982==by0x5135589:pthreadmutexlave(sqlite3.c:18998)
==12982==by0x5122e3f:sqlite3\u互斥体\u离开(sqlite3.c:18451)
==12982==by0x5123321:sqlite3_-free(sqlite3.c:19929)
==12982==by0x5168349:sqlite3LeaveMutexAndCloseZombie(sqlite3.c:122082)
==12982==by 0x51685A4:sqlite3Close(sqlite3.c:121948)
==12982==by0x51685C5:sqlite3\u关闭(sqlite3.c:121961)
==12982==by 0x518FA7F:Sqlite3Db::~Sqlite3Db()(twnestshared.cpp:89)
==12982==by 0x519A346:CIniFile::SetValue(std::string const&,std::string const&,std::string const&,std::string const&)(twnestshared.cpp:1264)
==12982==by 0x519B148:CMetiReg::SerialItem(字符常量*,无符号整数*,无符号整数,字符常量*)(twnestshared.cpp:1431)
==12982==0x4F22D6F:CMetiMNSSrv::SetRegistryVal(char const*,char const*,unsigned int,bool)(MetiMNSSrv.cpp:72)
==12982==by 0x4F24BAE:CMNSSrvNesting::SetLastOperationTime(bool、unsigned int、unsigned long long、unsigned long long)(MetiMNSSrv.cpp:616)
==12982==其他段端(螺纹4)
==12982==0x68667EB:recv(recv.c:33)
==12982==by 0x518E736:SK_GetBytes(socket2.h:44)
==12982==by0x518e8d6:SK_GetBlock(twlsocket.c:858)
==12982==0x518F19D:_SK_Connection_处理程序(twlsocket.c:407)
==12982==0x4C30E7B:???(在/usr/lib/valgrind/vgpreload_drd-amd64-linux.so中)
==12982==by 0x685F181:start_线程(pthread_create.c:312)
==12982==by0x6b6f47c:clone(clone.S:111)
我应该如何解释这些信息?在哪里可以找到
线程4
线程5
冲突的点

编辑:其他信息


该程序已使用GCC 4.8编译,调试信息
-g3
和优化
-Og
drd无法给出冲突在其他线程中的精确位置

在上述drd错误输出中,2段开始/结束限制为12 默认情况下,程序计数器。您可以使用 选项--num调用者=

如果你想得到更准确的信息,你可以试试 --工具=研磨 它可以记录比赛中涉及的两个线程的精确堆栈跟踪。 但是,对于helgrind,“其他线程”堆栈跟踪限制为8 程序计数器(而“第一个线程”堆栈跟踪类似
受限于--num callers=

好的,谢谢。我尝试了helgrind,由于它,我找到了更多有用的信息。