boost::coroutine 无法显示调用栈

本文详细分析了一起由boost::format()格式化参数个数错误导致的coredump问题,解释了为何使用boost::coroutine时无法正常显示异常时的调用栈,并提供了解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

boost::coroutine 无法显示调用栈

(金庆的专栏)

一例因 boost::format() 格式化参数个数错误造成的 coredump,
因为使用了 boost::coroutine, 无法显示异常时的调用栈,
仅显示了异常的类型:

#0  raise()
#1  abort()
#2  __gnu_cxx::__verbose_terminate_handler()
#3  ??
#4  std::terminate()
#5  __cxa_throw()
#6  boost::exception_detail::clone_impl<
      boost::exception_detail::error_info_injector<
        boost::io::too_many_args> >::rethrow()
    at /usr/include/boost/exception/exception.hpp:466
#7  boost::rethow_exception()
    at /usr/include/boost/exception/detail/exception_ptr.hpp:458
#8  boost::coroutine::detail::coroutine_base_resume<
      void(), boost::coroutines::detail::coroutine_base<void()>, void, 0>
        ::resume(void)
    at /usr/include/boost/coroutine/v1/detail/coroutine_base_resume.hpp:57
#9  boost::coroutines::detail::coroutine_op<void(),
      boost::coroutines::coroutine<void(), 0>, void, 0>::operator()(void)
    at /usr/include/boost/coroutine/v1/detail/coroutine_op.hpp:46
#10 PlayerCoro::operator()
    at /home/jinqing/mnt/code/server/loginserver/PlayerCoro.h
   

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值