我有一个使用std :: list的程序。 该程序使用作为生产者和消费者的std :: list作用的线程。
当消费者处理消息时,使用pop_front()将其从列表中删除。但是,在pop_front期间,有一个核心转储。
gdb跟踪如下。你能帮助我了解一下这个问题吗?
(gdb) bt full
#0 0xf7531d7b in std::_List_node_base::unhook () from /usr/lib/libstdc++.so.6
No symbol table info available.
#1 0x0805c600 in std::list<myMsg, std::allocator<myMsg> >::_M_erase (this=0x806b08c,
__position={_M_node = 0x8075308})
at /opt/target/usr/include/c++/4.2.0/bits/stl_list.h:1169
__n = (class std::_List_node<myMsg> *) 0x0
#2 0x0805c6af in std::list<myMsg, std::allocator<myMsg> >::pop_front (this=0x806b08c)
at /opt/target/usr/include/c++/4.2.0/bits/stl_list.h:750
No locals.
#3 0x0805afb6 in Base::run () at ../../src/Base.cc:342
nSentBytes = 130
tmpnm = {_vptr.myMsg = 0x80652c0,
m_msg = 0x8075140 "{0130,MSG_TYPE=ND_FUNCTION,ORG_PNAME=P01vm01Ax,FUNCTION=LOG,PARAM_CNT=3,DATETIME=06/12/2010 02:59:26.187,LOGNAME=N,ENTRY=Debug 0 }", m_from = 0x8096ee0 "P01vm01Ax", m_to = 0x0,
static m_logged = false, static m_pLogMutex = {__data = {__lock = 0, __count = 0, __owner = 0,
__kind = 0, __nusers = 0, {__spins = 0, __list = {__next = 0x0}}},
__size = '\0' <repeats 23 times>, __align = 0}}
newMsg = {_vptr.myMsg = 0x80652c0, m_msg = 0x0, m_from = 0x0, m_to = 0x0,
static m_logged = false, static m_pLogMutex = {__data = {__lock = 0, __count = 0, __owner = 0,
__kind = 0, __nusers = 0, {__spins = 0, __list = {__next = 0x0}}},
__size = '\0' <repeats 23 times>, __align = 0}}
strBuffer = "{0440,MSG_TYPE=NG_FUNCTION,ORG_PNAME=mach01./opt/abc/VAvsk/abc/comp/DML/gendrs.pl.17560,DST_PNAME=P01vm01Ax,FUNCTION=DRS_REPLICATE,CAUSE_DML_ERROR=N,CORRUPT_DATA=N,CORRUPT_HEADER=N,DEBUG=Y,EXTENDED_RU"...
fds = {{fd = 5, events = 1, revents = 0}}
retval = 0
iWaitTime = 0
#4 0x0805b277 in startRun () at ../../src/Base.cc:454
No locals.
#5 0xf7effe7b in start_thread () from /lib/libpthread.so.0
No symbol table info available.
#6 0xf744d82e in clone () from /lib/libc.so.6
No symbol table info available.