|
在我的网络程序中,getq()会在数据传输量很大的时候出现segmentation fault,Call Stack如下
#0 0x001d7526 in ACE_Message_Block::total_size_and_length (this=0xb7fc93a8, mb_size=@0xb5ac5f8c, mb_length=@0xb5ac5f88) at Message_Block.cpp:267
#1 0x080507a9 in ACE_Message_Queue <ACE_MT_SYNCH>::dequeue_head_i (this=0x9794dd0, first_item=@0xb5ac6040) at ../../../../usr/local/ACE_wrappers/ace/Message_Queue_T.cpp:1334
#2 0x08053e74 in ACE_Message_Queue <ACE_MT_SYNCH>::dequeue_head (this=0x9794dd0, first_item=@0xb5ac6040, timeout=0xb5ac6038)
at ../../../../usr/local/ACE_wrappers/ace/Message_Queue_T.cpp:1786
#3 0x08057d4a in ACE_Task <ACE_MT_SYNCH>::getq (this=0x9794d50, mb=@0xb5ac6040, tv=0xb5ac6038) at ../../../../usr/local/ACE_wrappers/ace/Task_T.inl:24
#4 0x08056e6c in GateWayService::handle_output (this=0x9794d50, hdl=17) at /home/bigboss/codeblocks_workspace/gateway_server/src/client_connection.cpp:207
#5 0x001a807d in ACE_Select_Reactor_T <ACE_Reactor_Token_T <ACE_Token> >::notify_handle (this=0x9787938, handle=17, mask=2, ready_mask=@0x9787ecc, event_handler=0x9794d50,
ptmf= <error reading variable>) at /usr/local/ACE_wrappers/ace/Select_Reactor_T.cpp:817
#6 0x001a738d in ACE_Select_Reactor_T <ACE_Reactor_Token_T <ACE_Token> >::dispatch_io_set (this=0x9787938, number_of_active_handles=4, number_of_handlers_dispatched=@0xb5ac6178,
mask=2, dispatch_mask=@0x97879e0, ready_mask=@0x9787ecc, callback= <error reading variable>) at /usr/local/ACE_wrappers/ace/Select_Reactor_T.cpp:1205
#7 0x001a1409 in ACE_Select_Reactor_T <ACE_Reactor_Token_T <ACE_Token> >::dispatch_io_handlers (this=0x9787938, dispatch_set=@0x9787954, number_of_active_handles=@0xb5ac6194,
number_of_handlers_dispatched=@0xb5ac6178) at /usr/local/ACE_wrappers/ace/Select_Reactor_T.cpp:1239
#8 0x001a19a2 in ACE_Select_Reactor_T <ACE_Reactor_Token_T <ACE_Token> >::dispatch (this=0x9787938, active_handle_count=4, dispatch_set=@0x9787954)
at /usr/local/ACE_wrappers/ace/Select_Reactor_T.cpp:1367
#9 0x001a6ac3 in ACE_Select_Reactor_T <ACE_Reactor_Token_T <ACE_Token> >::handle_events (this=0x9787938, max_wait_time=0x0) at /usr/local/ACE_wrappers/ace/Select_Reactor_T.cpp:1447
#10 0x001fdc83 in ACE_Reactor::handle_events (this=0x9783738, max_wait_time=0x0) at Reactor.cpp:420
#11 0x0804ba0f in updateServer4Logic (argv=0x0) at /home/bigboss/codeblocks_workspace/gateway_server/main.cpp:88
#12 0x001e3b67 in ACE_OS_Thread_Adapter::invoke (this=0x9783800) at OS_Thread_Adapter.cpp:90
#13 0x001a95d1 in ace_thread_adapter (args=0x9783800) at Base_Thread_Adapter.cpp:116
#14 0x00c9850b in start_thread () from /lib/libpthread.so.0
#15 0x00bd9b2e in clone () from /lib/libc.so.6
出错是在
0x001d7526 in ACE_Message_Block::total_size_and_length (this=0xb7fc93a8, mb_size=@0xb5ac5f8c, mb_length=@0xb5ac5f88) at Message_Block.cpp:267
267 mb_size += i->size ();
这句,我怀疑可能是msg_queue_线程不安全,所以我将
class GateWayService : public ACE_Svc_Handler < ACE_SOCK_STREAM, ACE_NULL_SYNCH >
改为了
class GateWayService : public ACE_Svc_Handler < ACE_SOCK_STREAM, ACE_MT_SYNCH >
可是程序依旧出错,哪位前辈能指点下问题还可能出在哪儿吗?如果需要更多信息,请说明 |
|