bug:terminate called after throwing an instance of 'std::logic_error' what(): basic_string::_M_co

bug:

terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_M_construct null not valid

gdb看后发现:

587471207Tue Apr 21 20:13:27 2020
**************************loop start***************************
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_M_construct null not valid

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) 
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff6fb442a in __GI_abort () at abort.c:89
#2  0x00007ffff7ae80ad in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff7ae6066 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff7ae60b1 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff7ae62c9 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007ffff7b0e8ef in std::__throw_logic_error(char const*) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x0000555555566f13 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*> (this=0x7fffffffd360, __beg=0x0, 
    __end=0x61 <error: Cannot access memory at address 0x61>) at /usr/include/c++/6/bits/basic_string.tcc:212
#8  0x00007ffff7b7716f in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#9  0x0000555555581259 in dr::automatic_warehouse_des::package_type::package_type (this=0x7fffffffd360) at include/automatic_warehouse_des/resequencer.hh:57
#10 0x000055555557ba8a in dr::automatic_warehouse_des::Resequencer::ask_new_pkg (this=0x5555557dbc30, input_seq=std::queue wrapping: std::deque with 0 elements, pkg=...)
    at include/automatic_warehouse_des/resequencer.hh:520
#11 0x000055555557e0b3 in dr::automatic_warehouse_des::Resequencer::resequence_new (this=0x5555557dbc30, input_seq=std::queue wrapping: std::deque with 0 elements, seqer=..., 
    output_seq=std::queue wrapping: std::deque with 79 elements = {...}) at include/automatic_warehouse_des/resequencer.hh:1065
#12 0x000055555557ae17 in dr::automatic_warehouse_des::Resequencer::run (this=0x5555557dbc30) at include/automatic_warehouse_des/resequencer.hh:292
#13 0x000055555558069d in main (argc=2, argv=0x7fffffffd968) at src/main.cc:26
(gdb) 

初步分析,去取一个空的queue的值导致的。
去取之前判断是否这个queue已经被pop成空的。

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值