lanhai0859 2019-11-28 17:43 采纳率: 33.3%
浏览 1547

量化交易ctp,在断开行情连接服务(api->release时)程序崩溃了

我在本机虚拟机断开行情连接完全没有问题,但放到其他的服务器上断开时就崩溃了

if (this->md_user_api != nullptr)
{
      LOG_INFO("断开行情服务");
      this->connect_status = false;
      this->login_status = false;
      //this->md_user_api->RegisterSpi(NULL);
      this->md_user_api->Release();
      this->md_user_api = NULL;
}

堆栈信息

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffb2eb42700 (LWP 5619)]
pthread_join (threadid=140716587353856, thread_return=0x0) at pthread_join.c:45
45    if (INVALID_NOT_TERMINATED_TD_P (pd))
(gdb) bt
#0  pthread_join (threadid=140716587353856, thread_return=0x0) at pthread_join.c:45
#1  0x00007ffff73d8b9f in CThread::Join() () from /usr/local/lib/libthostmduserapi.so
#2  0x00007ffff73e1d87 in CAPISessionFactory::Stop() () from /usr/local/lib/libthostmduserapi.so
#3  0x00007ffff73e3486 in CAPISessionFactory::~CAPISessionFactory() () from /usr/local/lib/libthostmduserapi.so
#4  0x00007ffff7489f35 in CThostFtdcUserApiImplBase::~CThostFtdcUserApiImplBase() ()
   from /usr/local/lib/libthostmduserapi.so
#5  0x00007ffff74873d8 in CThostFtdcUserApiImpl::~CThostFtdcUserApiImpl() ()
   from /usr/local/lib/libthostmduserapi.so
#6  0x00007ffff7488217 in CThostFtdcUserApiImplBase::Release() () from /usr/local/lib/libthostmduserapi.so
#7  0x00007ffff7498d82 in CFtdcMdApiImpl::Release() () from /usr/local/lib/libthostmduserapi.so
#8  0x000000000047b734 in MarketSpi::CloseConnect (this=0x6e1be0) at ./MarketSpi.cpp:117
#9  0x0000000000474d30 in auto_market_connect (m=0x6e1be0) at ./main.cpp:38
#10 0x000000000047a4be in std::_Bind_simple<void (*(MarketSpi*))(MarketSpi*)>::_M_invoke<0ul>(std::_Index_tuple<0ul>) (this=0x6d3f50) at /usr/include/c++/4.8.2/functional:1732
#11 0x000000000047a361 in std::_Bind_simple<void (*(MarketSpi*))(MarketSpi*)>::operator()() (this=0x6d3f50)
    at /usr/include/c++/4.8.2/functional:1720
#12 0x000000000047a292 in std::thread::_Impl<std::_Bind_simple<void (*(MarketSpi*))(MarketSpi*)> >::_M_run() (
    this=0x6d3f38) at /usr/include/c++/4.8.2/thread:115
#13 0x00007ffff525f070 in std::(anonymous namespace)::execute_native_thread_routine (__p=<optimized out>)
    at ../../../../../libstdc++-v3/src/c++11/thread.cc:84
#14 0x00007ffff7bc6e65 in start_thread (arg=0x7ffb2eb42700) at pthread_create.c:307
#15 0x00007ffff49c288d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 keil的map文件中Image component sizes各项意思
    • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
    • ¥15 划分vlan后,链路不通了?
    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 Centos / PETGEM
    • ¥15 划分vlan后不通了
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)