Android arm64-v8a - OpenCFile crashs
Hi
if I build Monkey2 for arm64-v8a all compiles fine (after EACCES fix from seyhajin - http://monkeycoder.co.nz/forums/topic/android-64bit-arm64-v8a/#post-16227).
After my App tries to read a config file it crashs at:
2019-07-22 07:43:55.587 18510-18679/com.lb.app I/MX2: Monkey 2 Runtime error: SIGNAL: Memory access violation 2019-07-22 07:43:55.587 18510-18679/com.lb.app I/MX2: {{!DEBUG!}} 2019-07-22 07:43:55.587 18510-18679/com.lb.app I/MX2: >OpenCFile:libc.FILE Ptr(path:monkey.types.String,mode:monkey.types.String);C:/dev/monkey2/modules/std/filesystem/filesystem.monkey2;926;5746 2019-07-22 07:43:55.587 18510-18679/com.lb.app I/MX2: path:String="en.txt" 2019-07-22 07:43:55.587 18510-18679/com.lb.app I/MX2: mode:String="rb"
Line 926 is: Local asset:=AAssetManager_open( asstMngr,path,0 ) Is differs in my source because I add some debug log output.
The same APK on a armeabi-v7a works fine (compiled for both v7a and v8a in one APK).
I'm using the latst NDK Version (20.0.5594570).
I re-compile it with you suggestion but it makes no difference. Anyway thanks for your input.
I think the reason for the issue is in a lower level because the 32 bit ARM version is runnig fine.
Am 22.07.2019 um 22:19 schrieb Simon Armstrong:
I may be wrong but maybe the hard coded value 10 in the Slice call in OpenCFile should be:
path=path.Slice( "${ASSETS}/".Length )
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/blitz-research/monkey2/issues/486?email_source=notifications&email_token=AHV76LBZ7CS6KE6VIOY6V4LQAYI5ZA5CNFSM4IFVDBJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2RBITQ#issuecomment-513938510, or mute the thread https://github.com/notifications/unsubscribe-auth/AHV76LB77KS4HBU56A6J2GDQAYI5ZANCNFSM4IFVDBJQ.
Apologies, I removed the suggestion after realizing I was confused. I became more confused when not seeing this in my windows config (macos only?):
'MX2_ANDROID_APP_ABI=all
I assume from your user name you are on Mac and have this switched on to enable the 64 bit mode?
No, I'm working with Win10.
My android section looks like this: '***** ANDROID TARGET *****
'Note: Requires Android Studio + Android NDK, see: https://developer.android.com/studio/index.html
'This is where my ndk-bundle is located - yours is probably somewhere else! ' 'For android builds, you need to either set this correctly or make sure 'ndk-build' is available from the command line via you PATH. ' 'PATH=D:\devtools\Android\sdk\ndk-bundle;${PATH} PATH=C:\apps\Android\Sdk\ndk-bundle;${PATH}
'Application.mk ' MX2_ANDROID_APP_CFLAGS=-std=gnu99 -fno-stack-protector MX2_ANDROID_APP_CPPFLAGS=-std=c++11 -fno-stack-protector -frtti -fexceptions MX2_ANDROID_APP_PLATFORM=android-16 MX2_ANDROID_APP_ABI=armeabi-v7a arm64-v8a MX2_ANDROID_APP_STL=c++_static