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

lanhai0859 2019-11-28 05:50:06
我在本机虚拟机断开行情连接完全没有问题,但放到其他的服务器上断开时就崩溃了

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
...全文
629 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
lanhai0859 2019-12-02
  • 打赏
  • 举报
回复
自己搞定了。谢谢啦
lanhai0859 2019-11-28
  • 打赏
  • 举报
回复
引用 5 楼 SuperDay 的回复:
应该是是代码路径不对,可以定位到代码的
#0 pthread_join (threadid=139888531080960, thread_return=0x0) at pthread_join.c:45 45 if (INVALID_NOT_TERMINATED_TD_P (pd))
铖邑 2019-11-28
  • 打赏
  • 举报
回复
应该是是代码路径不对,可以定位到代码的
lanhai0859 2019-11-28
  • 打赏
  • 举报
回复
引用 1 楼 SuperDay 的回复:
有没生成dump文件?可以拿来定位一下
不行定位出来还是跟堆栈信息一模一样
lanhai0859 2019-11-28
  • 打赏
  • 举报
回复
还没有用过dump过呢
lanhai0859 2019-11-28
  • 打赏
  • 举报
回复
没有哎!我试下!
铖邑 2019-11-28
  • 打赏
  • 举报
回复
有没生成dump文件?可以拿来定位一下

64,647

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧