RE: [Quickfix-developers] Segmentation Fault
Brought to you by:
orenmnero
From: <OM...@th...> - 2002-06-07 00:13:07
|
Justin, When Session::sendToTarget is called, a SessionNotFound exception is thrown if you try to send to a session that does not exist. I suspect you are sending to a session that is not configured in the QuickFIX config file. You can verify this by changing some of the code so it does some better error handling. In the queryEnterOrder function in Application.cpp for tradeclient, change this code: if(queryConfirm("Send order")) FIX::Session::sendToTarget(order); to this if(queryConfirm("Send order")) { try { FIX::Session::sendToTarget(order); } catch( FIX::SessionNotFound& e) { std::cout << "Session does not exist, cannot send message" << std::endl; } } If this message pops up, you know that the session does not exist. --oren Justin Pauley <jp...@fs...> To: OM...@th... cc: 06/06/2002 01:42 Subject: RE: [Quickfix-developers] Segmentation Fault PM I am running Linux Kernel:2.4.7-10 gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98) It is compiled as: g++ -g -I../quickfix/include -finline-functions -fexceptions -D_XOPEN_SOURCE=500 -I. -c tradeclient.cpp g++ -g -I../quickfix/include -finline-functions -fexceptions -D_XOPEN_SOURCE=500 -I. -c Application.cpp g++ -o tradeclient Application.o tradeclient.o -g -L../quickfix/lib -lquickfix -lpthread -lxml2 I don't have a core file (none was produced) but I do have this from GDB: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1026 (LWP 2810)] 0x0808233f in _Rb_tree<int, pair<int const, FIX::SocketConnection *>, _Select1st<pair<int const, FIX::SocketConnection *> >, less<int>, allocator<FIX::SocketConnection *> >::_M_erase () Current language: auto; currently c And here is the back trace: #0 0x0808233f in _Rb_tree<int, pair<int const, FIX::SocketConnection *>, _Select1st<pair<int const, FIX::SocketConnection *> >, less<int>, allocator<FIX::SocketConnection *> >::_M_erase () #1 0x08082349 in _Rb_tree<int, pair<int const, FIX::SocketConnection *>, _Select1st<pair<int const, FIX::SocketConnection *> >, less<int>, allocator<FIX::SocketConnection *> >::_M_erase () #2 0x080822c0 in _Rb_tree<int, pair<int const, FIX::SocketConnection *>, _Select1st<pair<int const, FIX::SocketConnection *> >, less<int>, allocator<FIX::SocketConnection *> >::clear () #3 0x080826a5 in _Rb_tree<int, pair<int const, FIX::SocketConnection *>, _Select1st<pair<int const, FIX::SocketConnection *> >, less<int>, allocator<FIX::SocketConnection *> >::~_Rb_tree () #4 0x080824ef in map<int, FIX::SocketConnection *, less<int>, allocator<FIX::SocketConnection *> >::~map () #5 0x0805a859 in FIX::SocketInitiator::~SocketInitiator () at tradeclient.cpp:94 #6 0x08052739 in main (argc=135036920, argv=0x8052728) at tradeclient.cpp:94 #7 0x400f9811 in find_exception_handler (pc=0x8063f4f, table=0x80c1c38, eh_info=0x80c7ff8, rethrow=1, cleanup=0x40a83468) at ../../gcc/libgcc2.c:3168 #8 0x400f9a62 in throw_helper (eh=0x80c8020, pc=0x8063fa1, my_udata=0x40a8366c, offset_p=0x40a83668) at ../../gcc/libgcc2.c:3168 #9 0x400f9f4f in __rethrow (index=0x80b71bc) at ../../gcc/libgcc2.c:3168 #10 0x08063fa2 in FIX::FieldMap::getField (this=0x40a83a18, field=@0x40a8378c) at /usr/local/include/quickfix/include/FieldMap.h:115 #11 0x0804e674 in Application::toApp (this=0xbffff9f0, message=@0x40a83a0c, sessionID=@0x80c4fb0) at Application.cpp:82 #12 0x080540bc in FIX::Session::sendRaw () at tradeclient.cpp:94 #13 0x08053d6c in FIX::Session::send () at tradeclient.cpp:94 #14 0x08058956 in FIX::Session::sendToTarget () at tradeclient.cpp:94 #15 0x0804eaf2 in Application::queryEnterOrder (this=0xbffff9f0, version=41) at Application.cpp:139 #16 0x0804e8ce in Application::onRun (this=0xbffff9f0) at Application.cpp:113 #17 0x0805a638 in FIX::Initiator::startThread () at tradeclient.cpp:94 #18 0x40029b9c in pthread_start_thread (arg=0x40a83be0) at manager.c:274 #19 0x40029c7f in pthread_start_thread_event (arg=0x40a83be0) at manager.c:298 Thanks, Justin -----Original Message----- From: qui...@li... [mailto:qui...@li...] On Behalf Of OM...@th... Sent: Thursday, June 06, 2002 12:25 PM To: jp...@fs... Cc: qui...@li...; qui...@li... Subject: Re: [Quickfix-developers] Segmentation Fault Justin, Can you give some more details. Are you running on Solaris or Linux, which kernal? What version of gcc are you using? Can you also recompile with the -g option and post the core file so everyone can take a look at the stack? --oren |---------+-----------------------------------------------> | | Justin Pauley <jp...@fs...> | | | Sent by: | | | qui...@li...ur| | | ceforge.net | | | | | | | | | 06/06/2002 01:04 PM | | | | |---------+-----------------------------------------------> >----------------------------------------------------------------------- -----------------------| | | | To: qui...@li... | | cc: | | Subject: [Quickfix-developers] Segmentation Fault | >----------------------------------------------------------------------- -----------------------| I just compiled tradeclient and ordermatch and when I run tradeclient I get a segmentation Fault? any ideas? Here is the session Justin [root@eats tradeclient]# ./tradeclient -f test_conf.cfg 1) Enter Order 2) Cancel Order 3) Replace Order Action: Logon - BeginString: FIX.4.1, SenderCompID: direct57, TargetCompID: IB 1 1) FIX.4.0 2) FIX.4.1 3) FIX.4.2 BeginString: 2 NewOrderSingle 1) Market 2) Limit 3) Stop 4) Stop Limit OrdType: 1 1) Buy 2) Sell 3) Sell Short 4) Sell Short Exempt 5) Cross 6) Cross Short 7) Cross Short Exempt Side: 1 Symbol: rhat ClOrdID: 0000 OrderQty: 10 1) Day 2) IOC 3) OPG 4) GTC 5) GTX TimeInForce: 1 SenderCompID: direct57 TargetCompID: IB Use a TargetSubID?: n Send order?: y Segmentation fault _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm _______________________________________________ Quickfix-developers mailing list Qui...@li... https://lists.sourceforge.net/lists/listinfo/quickfix-developers |