我有一个OpenCV 2.4.6应用程序(用TBB编译),在ARM cortex A9板(Odroid X2)上运行。运行应用程序时出现分段错误,所以首先使用gdb进行调试。 gdb无法完成回溯,给出消息:
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
但它确实输出了一些痕迹,导致TBB:
#3 0x001752f4 in tbb::interface6::internal::start_for<tbb::blocked_range<int>, (anonymous namespace)::ProxyLoopBody, tbb::auto_partitioner con)
()
#4 0x00502d9e in tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::local_wait_for_all(tbb::task&, tbb::task*) ()
#5 0x00503610 in tbb::internal::arena::process(tbb::internal::generic_scheduler&) ()
#6 0x00506aa0 in tbb::internal::market::process(rml::job&) ()
#7 0x0050773e in tbb::internal::rml::private_worker::run() ()
#8 0x00507a7a in tbb::internal::rml::private_worker::thread_routine(void*) ()
#9 0xb6fafcb0 in start_thread () from /usr/lib/libpthread.so.0
我尝试在没有TBB的情况下运行,运行正常。但我需要TBB,因为它可以帮助我的应用程序运行速度提高2-3倍,所以我根据我以前的分段错误和多线程问题经验调试Valgrind。不幸的是,Valgrind停止并显示消息,似乎与内核(?)相关:
[27140.140000] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[27140.140000] pgd = ebf10000
[27140.140000] [00000000] *pgd=6a02e831, *pte=00000000, *ppte=00000000
[27140.140000] Internal error: Oops: 17 [#1] PREEMPT SMP ARM
[27140.140000] Modules linked in: r8712u(C) ath9k_htc ath9k_common ath9k_hw ath mac80211 cfg80211 rfkill vfat fat smsc95xx uvcvideo usbnet vide6
...
[27140.140000] Code: e3110001 0a00004d e59f1150 e5911000 (e7912102)
[27140.140000] ---[ end trace ce3bd4d9f0a91ec4 ]---
[27140.140000] note: memcheck-arm-li[5626] exited with preempt_count 1
我对Linux和调试工具都很陌生,所以如果你能帮助我理解发生了什么,我将非常感激。是我的应用运行不好吗?是Valgrind导致崩溃吗?我需要重新安装Linux吗?
哦,是的,我不能在消息后向控制台输入任何内容,但如果我关闭设备,然后再打开,我可以再次开始使用Linux。谢谢!