jetpacapp / DeepBeliefSDK

The SDK for Jetpac's iOS Deep Belief image recognition framework
Other
2.86k stars 437 forks source link

[Android] crash when deepbelief functions are called from background thread #13

Open ziggyJ opened 10 years ago

ziggyJ commented 10 years ago

issue is gone after removing -fopenmp.

It seems that issue is caused by an openmp bug on Android. details and workaround can be found in http://recursify.com/blog/2013/08/09/openmp-on-android-tls-workaround

This is the log. ZhengZhihengs-iMac:source zhengzhiheng$ adb logcat | grep 23864 I/DEBUG (23864): * * * * * * * * * * * * * * * * I/DEBUG (23864): Build fingerprint: 'samsung/jgedlteue/jgedlte:4.4.4/KTU84P.S001/140602:user/release-keys' I/DEBUG (23864): Revision: '11' I/DEBUG (23864): pid: 6108, tid: 6441, name: Thread-2423 >>> com.buuna.bourbonbeats <<< I/DEBUG (23864): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000008 I/DEBUG (23864): r0 00000000 r1 78cb3dd0 r2 00000040 r3 00000018 I/DEBUG (23864): r4 78cb2bd0 r5 78cb2b18 r6 78cb2ab0 r7 0000016b I/DEBUG (23864): r8 00000000 r9 00000040 sl 75b0bb08 fp 000002d6 I/DEBUG (23864): ip 78ce1f9c sp 78cb2a48 lr 78cda168 pc 78cda168 cpsr 88070010 I/DEBUG (23864): d0 0000000000000000 d1 0000000000000000 I/DEBUG (23864): d2 0000000000000000 d3 0000000000000000 I/DEBUG (23864): d4 4306494041769400 d5 418c3880435c6940 I/DEBUG (23864): d6 000000d54306db10 d7 46f6d60000000000 I/DEBUG (23864): d8 bec96d473750324e d9 0000000000000000 I/DEBUG (23864): d10 0000000000000000 d11 0000000000000000 I/DEBUG (23864): d12 0000000000000000 d13 0000000000000000 I/DEBUG (23864): d14 0000000000000000 d15 0000000000000000 I/DEBUG (23864): d16 0000000000000000 d17 c1d4e170423912e8 I/DEBUG (23864): d18 41b8ef20c20558a4 d19 41f6c0fcc1e9ec10 I/DEBUG (23864): d20 c1f2f10041699af8 d21 42a50dcb42577d0a I/DEBUG (23864): d22 42b97bffc290f7c1 d23 c24a4d14421ee5c2 I/DEBUG (23864): d24 43167895bbae2364 d25 00c000bf00bd00be I/DEBUG (23864): d26 0000000000000000 d27 0000000000000000 I/DEBUG (23864): d28 009e009d009c009b d29 00a0009f009d009e I/DEBUG (23864): d30 00c000c000c000c0 d31 3ff1c37937e08000 I/DEBUG (23864): scr 60000012 I/DEBUG (23864): I/DEBUG (23864): backtrace: I/DEBUG (23864): #00 pc 00026168 /data/app-lib/com.buuna.bourbonbeats-2/libjpcnn.so (omp_get_num_threads+8) I/DEBUG (23864): I/DEBUG (23864): stack: I/DEBUG (23864): 78cb2a08 00000000
I/DEBUG (23864): 78cb2a0c 00000000
I/DEBUG (23864): 78cb2a10 00000000
I/DEBUG (23864): 78cb2a14 00000000
I/DEBUG (23864): 78cb2a18 00000000
I/DEBUG (23864): 78cb2a1c 78cb2ac4 [stack:6441] I/DEBUG (23864): 78cb2a20 78cb2abc [stack:6441] I/DEBUG (23864): 78cb2a24 78cb2ab0 [stack:6441] I/DEBUG (23864): 78cb2a28 00100000
I/DEBUG (23864): 78cb2a2c 00002000
I/DEBUG (23864): 78cb2a30 00000000
I/DEBUG (23864): 78cb2a34 78cb2ab0 [stack:6441] I/DEBUG (23864): 78cb2a38 00000000
I/DEBUG (23864): 78cb2a3c 78cc2831 /data/app-lib/com.buuna.bourbonbeats-2/libjpcnn.so I/DEBUG (23864): 78cb2a40 0000016b
I/DEBUG (23864): 78cb2a44 78cb2bc0 [stack:6441] I/DEBUG (23864): #00 78cb2a48 00000bd1
I/DEBUG (23864): 78cb2a4c 78cc398b /data/app-lib/com.buuna.bourbonbeats-2/libjpcnn.so I/DEBUG (23864): 78cb2a50 00000000
I/DEBUG (23864): 78cb2a54 00000000
I/DEBUG (23864): 78cb2a58 00000040
I/DEBUG (23864): 78cb2a5c 00000001
I/DEBUG (23864): 78cb2a60 00000bd1
I/DEBUG (23864): 78cb2a64 00000001
I/DEBUG (23864): 78cb2a68 80e32214
I/DEBUG (23864): 78cb2a6c 75af5008
I/DEBUG (23864): 78cb2a70 0000016b
I/DEBUG (23864): 78cb2a74 00000040
I/DEBUG (23864): 78cb2a78 78cb3220 [stack:6441] I/DEBUG (23864): 78cb2a7c 78cb2a6c [stack:6441] I/DEBUG (23864): 78cb2a80 78cb2bd0 [stack:6441] I/DEBUG (23864): 78cb2a84 78cb2b18 [stack:6441] I/DEBUG (23864): I/DEBUG (23864): memory near r1: I/DEBUG (23864): 78cb3db0 415bf0f5 401011b4 76fa2330 807248f8
I/DEBUG (23864): 78cb3dc0 78cb3dd0 0000000b 00000078 4010134c
I/DEBUG (23864): 78cb3dd0 78cb3dd0 807248f8 00000016 00000000
I/DEBUG (23864): 78cb3de0 00000000 26c52576 00000000 00000000
I/DEBUG (23864): 78cb3df0 00000000 00000000 00000000 00000000
I/DEBUG (23864): 78cb3e00 00000000 00000000 00000000 76fa2330
I/DEBUG (23864): 78cb3e10 00000000 00000000 00000000 00000000
I/DEBUG (23864): 78cb3e20 00000000 00000000 00000000 00000000
I/DEBUG (23864): 78cb3e30 80e2ecd8 80724b40 00000000 00000000
I/DEBUG (23864): 78cb3e40 00000000 00000000 80e2d400 00000000
I/DEBUG (23864): 78cb3e50 00000000 00000000 00000000 00000000
I/DEBUG (23864): 78cb3e60 00000000 00000000 00000000 00000000
I/DEBUG (23864): 78cb3e70 00000000 00000000 00000000 00000000
I/DEBUG (23864): 78cb3e80 00000000 00000000 00000000 00000000
I/DEBUG (23864): 78cb3e90 00000000 00000000 00000000 00000000
I/DEBUG (23864): 78cb3ea0 00000000 00000000 00000000 00000000
I/DEBUG (23864): I/DEBUG (23864): memory near r4: I/DEBUG (23864): 78cb2bb0 00017000 40103865 ffffffff 00000000
I/DEBUG (23864): 78cb2bc0 75af5008 0000016b 00000040 40104eab
I/DEBUG (23864): 78cb2bd0 773c2008 0000016b 00000bd1 00016b00
I/DEBUG (23864): 78cb2be0 00000000 00000000 00000000 80d97008
I/DEBUG (23864): 78cb2bf0 00000060 00000020 0000016b 0000016b
I/DEBUG (23864): 78cb2c00 772a6108 78cc3d45 00000bd1 0000016b
I/DEBUG (23864): 78cb2c10 3f800000 75af5008 0000016b 773c2008
I/DEBUG (23864): 78cb2c20 0000016b 00000000 772a6008 00000060
I/DEBUG (23864): 78cb2c30 773c2000 000005ac 80d97008 80d97008
I/DEBUG (23864): 78cb2c40 00000010 75af5008 00000066 00000070
I/DEBUG (23864): 78cb2c50 0000006f 00000bd1 3f800000 773c2008
I/DEBUG (23864): 78cb2c60 0000016b 00000000 00000060 00005ac0
I/DEBUG (23864): 78cb2c70 0000b580 ffffffe0 00000060 000002d6
I/DEBUG (23864): 78cb2c80 0000016a 76f1f008 01000000 40800000
I/DEBUG (23864): 78cb2c90 00000037 80e2d518 00000060 76fdde38
I/DEBUG (23864): 78cb2ca0 76dc3b20 00000090 0000000b 00000a80
I/DEBUG (23864): I/DEBUG (23864): memory near r5: I/DEBUG (23864): 78cb2af8 773c2008 75af5008 00000070 78cc3bd7
I/DEBUG (23864): 78cb2b08 0000016b 00000040 000003f6 000003f7
I/DEBUG (23864): 78cb2b18 772a6008 00000040 00000bd1 00000060
I/DEBUG (23864): 78cb2b28 00000001 000007f8 000007f9 00000ff4
I/DEBUG (23864): 78cb2b38 00000ff5 00000ff6 00000ff7 00003fe0
I/DEBUG (23864): 78cb2b48 00007fc2 00007fc3 0000ff88 0000ff89
I/DEBUG (23864): 78cb2b58 0000ff8a 0000ff8b 0000ff8c 0000ff8d
I/DEBUG (23864): 78cb2b68 0000ff8e 0000ff8f 0000ff90 0000ff91
I/DEBUG (23864): 78cb2b78 0000ff92 0000ff93 0000ff94 0000ff95
I/DEBUG (23864): 78cb2b88 00000000 ffffffff 76f1f000 40106cdf
I/DEBUG (23864): 78cb2b98 76f1f000 76f1f000 76f1f000 4012191f
I/DEBUG (23864): 78cb2ba8 40133f4a 00017000 00017000 40103865
I/DEBUG (23864): 78cb2bb8 ffffffff 00000000 75af5008 0000016b
I/DEBUG (23864): 78cb2bc8 00000040 40104eab 773c2008 0000016b
I/DEBUG (23864): 78cb2bd8 00000bd1 00016b00 00000000 00000000
I/DEBUG (23864): 78cb2be8 00000000 80d97008 00000060 00000020
I/DEBUG (23864): I/DEBUG (23864): memory near r6: I/DEBUG (23864): 78cb2a90 00000001 80e336f4 40142384 78cb2aa4
I/DEBUG (23864): 78cb2aa0 00000000 00000000 00000001 00000004
I/DEBUG (23864): 78cb2ab0 00000000 00000000 00000000 00000040
I/DEBUG (23864): 78cb2ac0 00000bd1 00000080 00002000 0005e880
I/DEBUG (23864): 78cb2ad0 00000400 0000003b 00000078 78cb2b18
I/DEBUG (23864): 78cb2ae0 773c1904 772a6008 00000060 78cc3b2b
I/DEBUG (23864): 78cb2af0 00000000 0000016b 773c2008 75af5008
I/DEBUG (23864): 78cb2b00 00000070 78cc3bd7 0000016b 00000040
I/DEBUG (23864): 78cb2b10 000003f6 000003f7 772a6008 00000040
I/DEBUG (23864): 78cb2b20 00000bd1 00000060 00000001 000007f8
I/DEBUG (23864): 78cb2b30 000007f9 00000ff4 00000ff5 00000ff6
I/DEBUG (23864): 78cb2b40 00000ff7 00003fe0 00007fc2 00007fc3
I/DEBUG (23864): 78cb2b50 0000ff88 0000ff89 0000ff8a 0000ff8b
I/DEBUG (23864): 78cb2b60 0000ff8c 0000ff8d 0000ff8e 0000ff8f
I/DEBUG (23864): 78cb2b70 0000ff90 0000ff91 0000ff92 0000ff93
I/DEBUG (23864): 78cb2b80 0000ff94 0000ff95 00000000 ffffffff
I/DEBUG (23864): I/DEBUG (23864): memory near sl: I/DEBUG (23864): 75b0bae8 3d12aa90 3c9dec70 3ba20840 3c0510a0
I/DEBUG (23864): 75b0baf8 bbb3f280 3c72db40 3bf69cc0 baaee600
I/DEBUG (23864): 75b0bb08 00000000 00000000 00000000 00000000
I/DEBUG (23864): 75b0bb18 00000000 00000000 00000000 00000000
I/DEBUG (23864): 75b0bb28 00000000 00000000 00000000 00000000
I/DEBUG (23864): 75b0bb38 00000000 00000000 00000000 00000000
I/DEBUG (23864): 75b0bb48 00000000 00000000 00000000 00000000
I/DEBUG (23864): 75b0bb58 00000000 00000000 00000000 00000000
I/DEBUG (23864): 75b0bb68 00000000 00000000 00000000 00000000
I/DEBUG (23864): 75b0bb78 00000000 00000000 00000000 00000000
I/DEBUG (23864): 75b0bb88 00000000 00000000 00000000 00000000
I/DEBUG (23864): 75b0bb98 00000000 00000000 00000000 00000000
I/DEBUG (23864): 75b0bba8 00000000 00000000 00000000 00000000
I/DEBUG (23864): 75b0bbb8 00000000 00000000 00000000 00000000
I/DEBUG (23864): 75b0bbc8 00000000 00000000 00000000 00000000
I/DEBUG (23864): 75b0bbd8 00000000 00000000 00000000 00000000
I/DEBUG (23864): I/DEBUG (23864): memory near ip: I/DEBUG (23864): 78ce1f7c 4012196d 40114af8 40106c9d 4010722b
I/DEBUG (23864): 78ce1f8c 401030d1 4011587c 00000000 00000000
I/DEBUG (23864): 78ce1f9c 40101940 4011ccd1 4011cbc5 4011f3e5
I/DEBUG (23864): 78ce1fac 40108489 4011f0ad 4011f38d 4011f1d5
I/DEBUG (23864): 78ce1fbc 40106ce9 40106d11 40106d59 40107455
I/DEBUG (23864): 78ce1fcc 4011be99 4011cc47 40102d98 40101960
I/DEBUG (23864): 78ce1fdc 40106d69 40101258 40106d03 401016f4
I/DEBUG (23864): 78ce1fec 401017f0 401142f8 401143cc 4012e20b
I/DEBUG (23864): 78ce1ffc 40115f8c 00000000 78cdec84 78cbe4a9
I/DEBUG (23864): 78ce200c 78cded70 78cbe615 78cded84 78cbe795
I/DEBUG (23864): 78ce201c 78cded98 78cbea75 78cdef00 78cbf431
I/DEBUG (23864): 78ce202c 78cdefc0 78cbf769 78cdefcc 78cbf949
I/DEBUG (23864): 78ce203c 78cdefd4 78cc0581 78cdeb84 78cbefb5
I/DEBUG (23864): 78ce204c ffffffff 0000013d 78cc509d 3ee8ba2e
I/DEBUG (23864): 78ce205c 3f800000 400ccccd 3f800000 58585858
I/DEBUG (23864): 78ce206c 75686320 6e206b6e 6b20746f 6e776f6e
I/DEBUG (23864): I/DEBUG (23864): memory near sp: I/DEBUG (23864): 78cb2a28 00100000 00002000 00000000 78cb2ab0
I/DEBUG (23864): 78cb2a38 00000000 78cc2831 0000016b 78cb2bc0
I/DEBUG (23864): 78cb2a48 00000bd1 78cc398b 00000000 00000000
I/DEBUG (23864): 78cb2a58 00000040 00000001 00000bd1 00000001
I/DEBUG (23864): 78cb2a68 80e32214 75af5008 0000016b 00000040
I/DEBUG (23864): 78cb2a78 78cb3220 78cb2a6c 78cb2bd0 78cb2b18
I/DEBUG (23864): 78cb2a88 3f800000 78cb2ab0 00000001 80e336f4
I/DEBUG (23864): 78cb2a98 40142384 78cb2aa4 00000000 00000000
I/DEBUG (23864): 78cb2aa8 00000001 00000004 00000000 00000000
I/DEBUG (23864): 78cb2ab8 00000000 00000040 00000bd1 00000080
I/DEBUG (23864): 78cb2ac8 00002000 0005e880 00000400 0000003b
I/DEBUG (23864): 78cb2ad8 00000078 78cb2b18 773c1904 772a6008
I/DEBUG (23864): 78cb2ae8 00000060 78cc3b2b 00000000 0000016b
I/DEBUG (23864): 78cb2af8 773c2008 75af5008 00000070 78cc3bd7
I/DEBUG (23864): 78cb2b08 0000016b 00000040 000003f6 000003f7
I/DEBUG (23864): 78cb2b18 772a6008 00000040 00000bd1 00000060
I/DEBUG (23864): I/DEBUG (23864): code around pc: I/DEBUG (23864): 78cda148 e08f0000 eb0007f0 e8bd4008 ea000200
I/DEBUG (23864): 78cda158 00007f80 00008138 e92d4008 ebffff99
I/DEBUG (23864): 78cda168 e5903008 e3530000 15930000 03a00001
I/DEBUG (23864): 78cda178 e8bd8008 e92d4008 ebffff92 e5900014
I/DEBUG (23864): 78cda188 e8bd8008 e92d4008 ebffff8e e590001c
I/DEBUG (23864): 78cda198 e2900000 13a00001 e8bd8008 e92d4008
I/DEBUG (23864): 78cda1a8 ebffff88 e5900018 e8bd8008 e92d4010
I/DEBUG (23864): 78cda1b8 e1a04000 ebffff83 e3540000 b3e00000
I/DEBUG (23864): 78cda1c8 b8bd8010 e5903018 e1540003 92800008
I/DEBUG (23864): 78cda1d8 90644003 9a000003 ea000006 e5900000
I/DEBUG (23864): 78cda1e8 e2444001 e2800008 e3540000 cafffffa
I/DEBUG (23864): 78cda1f8 e590000c e8bd8010 e3e00000 e8bd8010
I/DEBUG (23864): 78cda208 e92d4010 e1a04000 ebffff6e e3540000
I/DEBUG (23864): 78cda218 ba00000f e5903018 e1540003 92800008
I/DEBUG (23864): 78cda228 90644003 9a000003 ea000009 e5900000
I/DEBUG (23864): 78cda238 e2444001 e2800008 e3540000 cafffffa
I/DEBUG (23864): !@dumpstate -k -t -z -d -o /data/log/dumpstate_app_native -m 6108