Repository navigation
Closed
Labels
Description
System information (version)
- OpenCV => 4.0.1
- Operating System / Platform => Android / Android 7.1.1(Device: Nexus 6)
- Compiler => Android NDK
Detailed description
My source code build on Ubuntu is success, but the output sample face detect crashed at native. This is the crash log:
2019-01-23 14:27:30.284 21034-21100/org.opencv.samples.facedetect A/libc: Fatal signal 7 (SIGBUS), code 1, fault addr 0x95b02d13 in tid 21100 (Thread-2)
2019-01-23 14:27:30.366 21121-21121/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2019-01-23 14:27:30.366 21121-21121/? A/DEBUG: Build fingerprint: 'google/shamu/shamu:7.1.1/N6F27M/4299435:user/release-keys'
2019-01-23 14:27:30.366 21121-21121/? A/DEBUG: Revision: '0'
2019-01-23 14:27:30.366 21121-21121/? A/DEBUG: ABI: 'arm'
2019-01-23 14:27:30.366 21121-21121/? A/DEBUG: pid: 21034, tid: 21100, name: Thread-2 >>> org.opencv.samples.facedetect <<<
2019-01-23 14:27:30.366 21121-21121/? A/DEBUG: signal 7 (SIGBUS), code 1 (BUS_ADRALN), fault addr 0x95b02d13
2019-01-23 14:27:30.366 21121-21121/? A/DEBUG: r0 95b02d00 r1 00000008 r2 ae95a000 r3 00000025
2019-01-23 14:27:30.366 21121-21121/? A/DEBUG: r4 95b02d54 r5 00000000 r6 95b02d13 r7 94c6f9e0
2019-01-23 14:27:30.366 21121-21121/? A/DEBUG: r8 0000002d r9 00000013 sl 00000000 fp ffffffff
2019-01-23 14:27:30.366 21121-21121/? A/DEBUG: ip 00000008 sp 94c6f998 lr ae95a020 pc 96df840c cpsr 800b0030
2019-01-23 14:27:30.380 21121-21121/? A/DEBUG: backtrace:
2019-01-23 14:27:30.381 21121-21121/? A/DEBUG: #00 pc 0030040c /data/app/org.opencv.samples.facedetect-1/lib/arm/libopencv_java4.so
2019-01-23 14:27:30.381 21121-21121/? A/DEBUG: #01 pc 0030123f /data/app/org.opencv.samples.facedetect-1/lib/arm/libopencv_java4.so
2019-01-23 14:27:30.381 21121-21121/? A/DEBUG: #02 pc 001f45f1 /data/app/org.opencv.samples.facedetect-1/lib/arm/libopencv_java4.so (_ZN2cv13parallel_for_ERKNS_5RangeERKNS_16ParallelLoopBodyEd+404)
2019-01-23 14:27:30.381 21121-21121/? A/DEBUG: #03 pc 002f5e29 /data/app/org.opencv.samples.facedetect-1/lib/arm/libopencv_java4.so
2019-01-23 14:27:30.381 21121-21121/? A/DEBUG: #04 pc 002f41f9 /data/app/org.opencv.samples.facedetect-1/lib/arm/libopencv_java4.so (_ZN2cv3hal6resizeEiPKhjiiPhjiiddi+1424)
2019-01-23 14:27:30.381 21121-21121/? A/DEBUG: #05 pc 002f6ba1 /data/app/org.opencv.samples.facedetect-1/lib/arm/libopencv_java4.so (_ZN2cv6resizeERKNS_11_InputArrayERKNS_12_OutputArrayENS_5Size_IiEEddi+464)
2019-01-23 14:27:30.381 21121-21121/? A/DEBUG: #06 pc 004fe92f /data/app/org.opencv.samples.facedetect-1/lib/arm/libopencv_java4.so
2019-01-23 14:27:30.381 21121-21121/? A/DEBUG: #07 pc 00501349 /data/app/org.opencv.samples.facedetect-1/lib/arm/libopencv_java4.so
2019-01-23 14:27:30.381 21121-21121/? A/DEBUG: #08 pc 005016db /data/app/org.opencv.samples.facedetect-1/lib/arm/libopencv_java4.so
2019-01-23 14:27:30.381 21121-21121/? A/DEBUG: #09 pc 00501805 /data/app/org.opencv.samples.facedetect-1/lib/arm/libopencv_java4.so
2019-01-23 14:27:30.381 21121-21121/? A/DEBUG: #10 pc 005027fb /data/app/org.opencv.samples.facedetect-1/lib/arm/libopencv_java4.so (_ZN2cv17CascadeClassifier16detectMultiScaleERKNS_11_InputArrayERNSt6__ndk16vectorINS_5Rect_IiEENS4_9allocatorIS7_EEEEdiiNS_5Size_IiEESD_+106)
2019-01-23 14:27:30.381 21121-21121/? A/DEBUG: #11 pc 00145873 /data/app/org.opencv.samples.facedetect-1/lib/arm/libopencv_java4.so (Java_org_opencv_objdetect_CascadeClassifier_detectMultiScale_10+114)
2019-01-23 14:27:30.381 21121-21121/? A/DEBUG: #12 pc 000f7ccf /data/app/org.opencv.samples.facedetect-1/oat/arm/base.odex (offset 0x97000)
Steps to reproduce
- set env of path:
ANDROID_SDK,ANDROID_NDK - clone opencv source code and checkout branch 4.0.1
- build source code
mkdir build
cd build
python ../platforms/android/build_sdk.py
- Install the apk
o4a/opencv_android/face-detection/build/outputs/apk/debug/face-detection-armeabi-v7a-debug.apk
Activity
fengshenzhu commentedon Jan 23, 2019
I have tried the official release at version 4.0.1, it run well. The sample prints logs when first library loaded. This is my log:
And, this is the official's:
fengshenzhu commentedon Jan 23, 2019
Change ndk to version r18b, it worked!
hannesa2 commentedon Jan 24, 2019
Did you try to build with NDK 19.0 too ?
fengshenzhu commentedon Jan 24, 2019
Yes, compiled with NDK 19 will crash. r18b is OK.
fengshenzhu commentedon Jan 24, 2019
When loading opencv library, the version of ndk will be print like this.