2

I have an OpenCV 2.4.6 application (compiled with TBB), running in ARM cortex A9 board (Odroid X2). I get segmentation fault when running the application, so first I debug with gdb. gdb cannot finish the backtrace, giving message:

Backtrace stopped: previous frame identical to this frame (corrupt stack?)

But it did output some trace, leading to 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

I tried running without TBB, and it runs fine. But I need TBB because it helps my application runs 2-3x faster, so I debug with Valgrind based on my previous experience with segmentation fault and multithreading problem. Unfortunately too, Valgrind stops and messages appear, seems related to kernel (?):

[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

I am pretty new to Linux and debugging tool, thus I will be most grateful if you can help me understand what happened. Is it my application runs bad? Is it Valgrind that cause the crash? Do I need to reinstall Linux?

Oh yeah, I cannot type anything to the console after the message, but if I turn the device off, then on again, I can start using Linux again. Thanks!

bonchenko
  • 567
  • 1
  • 9
  • 21
  • When you said it worked without TBB, were you running in non-threaded or were you using a different threading library? – Vaughn Cato Jul 30 '13 at 01:46
  • I suppose it runs non-threaded because: 1. OpenCV library only use TBB ( [here, pls see Common Prerequisites](http://opencv.willowgarage.com/wiki/InstallGuide) ), which I disabled when recompiling OpenCV. 2. Application runs 2-3x slower without TBB – bonchenko Jul 30 '13 at 02:24
  • @bonchenko that link is way too old! See the new site http://docs.opencv.org/trunk/doc/tutorials/introduction/linux_install/linux_install.html – Braiam Jul 30 '13 at 05:27
  • are you suggesting that now OpenCV multithreading implementation can use other library than tbb? I choose the site because it says "since OpenCV 2.4.3 ... we do not use OpenMP any longer". Thus OpenCV 2.4.4 an so forth do not use OpenMP. – bonchenko Jul 30 '13 at 05:36

0 Answers0