应用程序在启动时崩溃,信号为11和sigsev。
来自故障报告的日志
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'Xiaomi/santoni/santoni:7.1.2/N2G47H/V10.3.1.0.NAMMIXM:user/release-keys'
Revision: '0'
ABI: 'arm64'
pid: 30404, tid: 30404, name: rg.etlegacy.app >>> org.etlegacy.app <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7d02bdb8
x0 000000007d02bdb8 x1 0000007f7d0e6000 x2 0000000000001000 x3 0000000000000004
x4 0000000000000000 x5 0000000000000040 x6 000000000000003f x7 0000000000000000
x8 0000007f8ef0cad0 x9 0000000000000001 x10 0000007f8ef0caa0 x11 0000000000000000
x12 000000000000004e x13 000000000000000c x14 0000000000000001 x15 00334cb51f425b69
x16 0000007f8d81d5a8 x17 0000007f8d7c894c x18 0000007f836ebef4 x19 0000007f7d0e6000
x20 000000007d02bdb8 x21 0000000000001000 x22 0000000000000001 x23 0000007f6ded2db0
x24 0000000000000000 x25 3010888e20f53c95 x26 0000007f8b043a98 x27 3010888e20f53c95
x28 0000000000000000 x29 0000007ff151f080 x30 0000007f8d7813bc
sp 0000007ff151f050 pc 0000007f8d7810e8 pstate 0000000080000000
backtrace:
#00 pc 00000000000210e8 /system/lib64/libc.so (_ZL11__dirname_rPKcPcm+36)
#01 pc 00000000000213b8 /system/lib64/libc.so (dirname+88)
#02 pc 0000000000133354 /data/app/org.etlegacy.app-1/lib/arm64/libetl.so (SDL_main+104)
#03 pc 0000000000152a24 /data/app/org.etlegacy.app-1/lib/arm64/libetl.so (Java_org_etlegacy_app_SDLActivity_nativeSetupJNI+68)
#04 pc 00000000000185cc /data/app/org.etlegacy.app-1/oat/arm64/base.odex (offset 0x17000)
Java_org_etlegacy_app_SDLActivity_nativeSetupJNI函数
JNIEXPORT void JNICALL Java_org_etlegacy_app_SDLActivity_nativeSetupJNI()
{
Android_JNI_SetupThread();
SDL_SetMainReady();
/* Run the application code! */
char *argv[2];
argv[0] = SDL_strdup("./");
// send r_fullscreen 0 with argv[1] because on fullscreen can cause some issues see: https://github.com/rafal1137/android-project/commit/d960cc244b17d8cc0d084f9c8dad9c1af4b2ba72#diff-b9bd293cfb066fe80c10d3fcdd0fd6cbL439
argv[1] = 0;
SDL_main(1, argv);
}
我应该将SDL_SetminReady()移到main()函数吗?
将函数更改为SDL_GetBasePath()实现了