使用OpenCV和Caffe的代码已在我对其进行测试的所有Linux设备上工作。但是,在成功安装的Jetson TX2上启动它会导致这种堆栈跟踪的细分故障:
nvidia@tegra-ubuntu:~/Desktop$ gdb ./main
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
This GDB was configured as "aarch64-linux-gnu".
Reading symbols from ./main...done.
(gdb) r
Starting program: /home/nvidia/Desktop/main
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".Program received signal SIGSEGV, Segmentation fault.
0x0000007fb5e5d14c in google::protobuf::Arena::AllocateAligned(std::type_info const*, unsigned long) () from /usr/local/lib/libopencv_dnn.so.3.3
(gdb) bt
#0 0x0000007fb5e5d14c in google::protobuf::Arena::AllocateAligned(std::type_info const*, unsigned long) () from /usr/local/lib/libopencv_dnn.so.3.3
#1 0x0000007fb5e5d248 in google::protobuf::Arena::AddListNode(void*, void ()(void)) ()
from /usr/local/lib/libopencv_dnn.so.3.3
#2 0x0000007fb5eaaf34 in google::protobuf::FileDescriptorProto::New(google::protobuf::Arena*) const [clone .localalias.409] () from /usr/local/lib/libopencv_dnn.so.3.3
#3 0x0000007fad71bfc4 in google::protobuf::MessageLite::ParseFromArray(void const*, int)
() from /usr/lib/aarch64-linux-gnu/libprotobuf.so.9
#4 0x0000007fad763e70 in google::protobuf::EncodedDescriptorDatabase::Add(void const*, int) () from /usr/lib/aarch64-linux-gnu/libprotobuf.so.9
#5 0x0000007fad726d30 in google::protobuf::DescriptorPool::InternalAddGeneratedFile(void const*, int) () from /usr/lib/aarch64-linux-gnu/libprotobuf.so.9
#6 0x0000007fad7560bc in google::protobuf::protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto() () from /usr/lib/aarch64-linux-gnu/libprotobuf.so.9
#7 0x0000007fb7fdfb18 in call_init (l=<optimized out>, argc=argc@entry=1,
argv=argv@entry=0x7ffffff478, env=env@entry=0x7ffffff488) at dl-init.c:72
#8 0x0000007fb7fdfc60 in call_init (env=0x7ffffff488, argv=0x7ffffff478, argc=1,
l=<optimized out>) at dl-init.c:30
#9 _dl_init (main_map=0x7fb8000190, argc=1, argv=0x7ffffff478, env=0x7ffffff488)
at dl-init.c:120
#10 0x0000007fb7fd2d44 in _dl_start_user () from /lib/ld-linux-aarch64.so.1
Protobuf出现了很多,所以我安装了Protobuf 3.3并重新编译了所有内容,但这也无济于事。使用OpenCV DO Work和Caffe Runtest的简单代码示例已通过。我如何搜索此SEGFAULT的解决方案?
arvids
如何搜索此segfault的解决方案?
你不。
您没有搜索解决方案,而是通过调试问题来查找。
第一步可能是为libopencv_dnn.so.3.3
安装调试信息包或从源构建它,以便您可以了解竞技场分配中的位置您的代码正在崩溃。
仅在malloc
中的任何崩溃时,问题很可能在用户代码中,而不是竞技场分配器本身。问题可能是流浪写(即随机损坏),或者更有可能是API误用(例如,在没有从该领域分配的东西上调用Arena::Deallocate
)。
P.S。该错误可能存在于其他架构上,但尚未宣布。堆的损坏通常是这样做的。