-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.6.2, 5.7.1, 5.8.0, 5.9.0 Alpha
-
None
-
Android native NDK app
As described on http://stackoverflow.com/questions/42314442/bug-in-qtlocation-android-jni-onload-never-called-crash-on-nullpointer-acces JNI_OnLoad() inside libqtposition_android.so doesn't get called before using JNI based functionality.
Because the global javaVM pointer gets set inside JNI_OnLoad() it's still NULL when you call e.g.
QGeoPositionInfoSource::createDefaultSource(this)
and the app immediately crashes as described here: http://stackoverflow.com/questions/42237283/qt5-qgeopositioninfosourcecreatedefaultsource-crashes-on-android-5-0
logcat prints:
F/libc ( 422): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 797 (QtThread) I/DEBUG ( 333): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** I/DEBUG ( 333): Build fingerprint: 'samsung/trltexx/trlte:5.0.1/LRX22C/N910FXXU1BOE3:user/release-keys' I/DEBUG ( 333): Revision: '12' I/DEBUG ( 333): ABI: 'arm' I/DEBUG ( 333): pid: 422, tid: 797, name: QtThread >>> org.qtproject.DPW <<< I/DEBUG ( 333): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 I/DEBUG ( 333): r0 00000000 r1 9d2bedf8 r2 00010006 r3 be7eb61d I/DEBUG ( 333): r4 9d2bedf4 r5 9d2bedf8 r6 00000000 r7 9cffa030 I/DEBUG ( 333): r8 9d2bedf4 r9 afd04388 sl 00000001 fp 9d2bf8dc I/DEBUG ( 333): ip 9cff9e80 sp 9d2bedd0 lr 9cff49b7 pc 9cff612e cpsr 60070030 I/DEBUG ( 333): I/DEBUG ( 333): backtrace: I/DEBUG ( 333): #00 pc 0000512e /data/data/org.qtproject.DPW/qt-reserved-files/plugins/position/libqtposition_android.so I/DEBUG ( 333): #01 pc 000039b3 /data/data/org.qtproject.DPW/qt-reserved-files/plugins/position/libqtposition_android.so