1

我有一个使用 yaml-cpp(版本 0.3.0)的 C++ 程序。当程序退出时,由于“信号 7”,我感到恐慌。

Program terminated with signal 7, Bus error.
#0  0x00007f766e658360 in void
std::_Destroy_aux<false>::__destroy<YAML::RegEx*>(YAML::RegEx*, YAML::RegEx*)
() from /usr/lib/x86_64-linux-gnu/libyaml-cpp.so.0.3
(gdb) where
#0  0x00007f766e658360 in void
std::_Destroy_aux<false>::__destroy<YAML::RegEx*>(YAML::RegEx*, YAML::RegEx*)
() from /usr/lib/x86_64-linux-gnu/libyaml-cpp.so.0.3
#1  0x00007f766e65843e in YAML::RegEx::~RegEx() () from
/usr/lib/x86_64-linux-gnu/libyaml-cpp.so.0.3
#2  0x00007f766d4b3df2 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#3  0x00007f766d4b3e45 in exit () from /lib/x86_64-linux-gnu/libc.so.6
#4  0x00007f766d49beb4 in __libc_start_main () from
/lib/x86_64-linux-gnu/libc.so.6
#5  0x0000000000419cb1 in _start ()

有没有人使用 yaml-cpp 遇到过这个问题?似乎在我的程序退出后(从第 3 帧)遇到了恐慌,并且正在卸载库。我查看了 RegEx 析构函数的源代码,它基本上是一个 {}。任何调试此问题的指针将不胜感激。

(编辑后的附加信息)我在打开调试的情况下构建了 yaml-cpp0.3 库。我现在在回溯中获得了更多信息,但恐慌是由于“程序以信号 11 终止,分段错误。”。以下是回溯:

#0  0x0000000000ae05c6 in std::vector<YAML::RegEx, std::allocator<YAML::RegEx> >::~vector (this=0x2039353539414358, __in_chrg=<optimized out>) at /usr/include/c++/4.7/bits/stl_vector.h:403
#1  0x0000000000adefd6 in YAML::RegEx::~RegEx (this=0x2039353539414350, __in_chrg=<optimized out>) at /u/aalmehdi/yaml/yaml-cpp/yaml_0.3.0/yaml-cpp/src/regex.h:28
#2  0x0000000000ae5d96 in std::_Destroy<YAML::RegEx> (__pointer=0x2039353539414350) at /usr/include/c++/4.7/bits/stl_construct.h:95
#3  0x0000000000ae46ac in std::_Destroy_aux<false>::__destroy<YAML::RegEx*> (__first=0x2039353539414350, __last=0x5047207469622d36) at /usr/include/c++/4.7/bits/stl_construct.h:105
#4  0x0000000000ae2457 in std::_Destroy<YAML::RegEx*> (__first=0x2039353539414350, __last=0x5047207469622d36) at /usr/include/c++/4.7/bits/stl_construct.h:128
#5  0x0000000000ae0f5d in std::_Destroy<YAML::RegEx*, YAML::RegEx> (__first=0x2039353539414350, __last=0x5047207469622d36) at /usr/include/c++/4.7/bits/stl_construct.h:155
#6  0x0000000000ae05dc in std::vector<YAML::RegEx, std::allocator<YAML::RegEx> >::~vector (this=0x37c2b48, __in_chrg=<optimized out>) at /usr/include/c++/4.7/bits/stl_vector.h:403
#7  0x0000000000adefd6 in YAML::RegEx::~RegEx (this=0x37c2b40, __in_chrg=<optimized out>) at /u/aalmehdi/yaml/yaml-cpp/yaml_0.3.0/yaml-cpp/src/regex.h:28
#8  0x0000000000ae5d96 in std::_Destroy<YAML::RegEx> (__pointer=0x37c2b40) at /usr/include/c++/4.7/bits/stl_construct.h:95
#9  0x0000000000ae46ac in std::_Destroy_aux<false>::__destroy<YAML::RegEx*> (__first=0x37c2b40, __last=0x37c2b80) at /usr/include/c++/4.7/bits/stl_construct.h:105
#10 0x0000000000ae2457 in std::_Destroy<YAML::RegEx*> (__first=0x37c2b40, __last=0x37c2b80) at /usr/include/c++/4.7/bits/stl_construct.h:128
#11 0x0000000000ae0f5d in std::_Destroy<YAML::RegEx*, YAML::RegEx> (__first=0x37c2b40, __last=0x37c2b80) at /usr/include/c++/4.7/bits/stl_construct.h:155
#12 0x0000000000ae05dc in std::vector<YAML::RegEx, std::allocator<YAML::RegEx> >::~vector (this=0x37c2c28, __in_chrg=<optimized out>) at /usr/include/c++/4.7/bits/stl_vector.h:403
#13 0x0000000000adefd6 in YAML::RegEx::~RegEx (this=0x37c2c20, __in_chrg=<optimized out>) at /u/aalmehdi/yaml/yaml-cpp/yaml_0.3.0/yaml-cpp/src/regex.h:28
#14 0x0000000000ae5d96 in std::_Destroy<YAML::RegEx> (__pointer=0x37c2c20) at /usr/include/c++/4.7/bits/stl_construct.h:95
#15 0x0000000000ae46ac in std::_Destroy_aux<false>::__destroy<YAML::RegEx*> (__first=0x37c2c20, __last=0x37c2c40) at /usr/include/c++/4.7/bits/stl_construct.h:105
#16 0x0000000000ae2457 in std::_Destroy<YAML::RegEx*> (__first=0x37c2c00, __last=0x37c2c40) at /usr/include/c++/4.7/bits/stl_construct.h:128
#17 0x0000000000ae0f5d in std::_Destroy<YAML::RegEx*, YAML::RegEx> (__first=0x37c2c00, __last=0x37c2c40) at /usr/include/c++/4.7/bits/stl_construct.h:155
#18 0x0000000000ae05dc in std::vector<YAML::RegEx, std::allocator<YAML::RegEx> >::~vector (this=0x25b26e8, __in_chrg=<optimized out>) at /usr/include/c++/4.7/bits/stl_vector.h:403
#19 0x0000000000adefd6 in YAML::RegEx::~RegEx (this=0x25b26e0, __in_chrg=<optimized out>) at /u/aalmehdi/yaml/yaml-cpp/yaml_0.3.0/yaml-cpp/src/regex.h:28
#20 0x00007ff78f7b2df2 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#21 0x00007ff78f7b2e45 in exit () from /lib/x86_64-linux-gnu/libc.so.6
#22 0x00007ff78f79aeb4 in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
#23 0x000000000041ca91 in _start ()
4

0 回答 0