View Issue Details

IDProjectCategoryView StatusLast Update
0001859NoesisGUIC++ SDKpublic2021-03-24 19:20
ReporterdaldegamAssigned Tojsantos 
PrioritynormalSeveritycrashReproducibilityalways
Status assignedResolutionopen 
Product Version3.0.8 
Target VersionFixed in Version 
Summary0001859: NativeSDK - Exception Crash - ARM
DescriptionWhenever I use an exception in my project, a crash happens and catch() is not executed.

However, this only happens on Android devices armeabi-v7a, on other platforms, it doesn't.

Investigating I found that the crash only happens when the Noesis.so library is linked and some exception handled happens.

No code is needed to start noesis, just link the library and any exception thrown will make the program close.

Cases that do not crash:
- Noesis.so linked but without exceptions;
- Noesis.se not linked with or without exceptions;

I tried to find out for myself what is happening, but without success.

I removed Noesis.so for x86_64 because the file got big and Mantis won't let me attach the file with the example.
Steps To ReproduceI'm using Android Studio 4.1.1 to build the sample project.

I did a test project so that you can reproduce the problem.

In the NativeEngine.cpp file I put a simple exception code:
    try {
        throw std::runtime_error("Noesis Team, look here!");
    }
    catch (const std::exception &exp) {
        __android_log_print(ANDROID_LOG_ERROR, "Game", "Normal exception: %s", exp.what());
    }


In the CMakeList.txt file I put the link for lib 3.0.8 as follows:
    ${CMAKE_CURRENT_SOURCE_DIR}../../app/src/main/jniLibs/${CMAKE_ANDROID_ARCH_ABI}/libNoesis.so

So to reproduce, just leave the lib linked and the exception enabled.
Tagsarmeabi-v7a, C++, OpenGL
PlatformAndroid

Relationships

has duplicate 0001858 closedjsantos NativeSDK - Exception Crash - ARM 

Activities

daldegam

daldegam

2020-12-11 12:45

reporter  

gamecore.7z (3,868,160 bytes)
daldegam

daldegam

2020-12-11 13:22

reporter   ~0006888

I made a folder in Google Drive with examples why I can't upload files larger than 5MB here;

I compiled the project in three different ways, I also put the project code in the folder.

There are then the following APKs:

game-noesis-exception.apk (will crash)
game-noesis-without-exception.apk (it won't crash)
game-without-noesis-with-exception.apk (it won't crash)

Link to folder: https://drive.google.com/drive/folders/19Ge7L9h0taIy9wFqpTr07O5dhxJHqA2L?usp=sharing
jsantos

jsantos

2020-12-11 16:29

manager   ~0006890

I don't know if this is related to the fact that we compile NoesisGUI without exceptions. I will find time to test this, could you please paste the call stack and the crash information? Thanks!
daldegam

daldegam

2020-12-11 17:00

reporter  

callstack.png (57,236 bytes)
callstack.png (57,236 bytes)
daldegam

daldegam

2020-12-11 17:00

reporter   ~0006892

I will attach a screenshot with the content of the callstack, android studio will not let me copy as text.

As you can see, when the throw happens, a SIGABRT happens too.

----

Crash details from Android Logcat:

12-11 13:53:46.443 9667-9680/br.com.daldegam.game A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 9680 (GLThread 21503)
12-11 13:53:46.553 382-382/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
12-11 13:53:46.553 382-382/? A/DEBUG: Build fingerprint: 'samsung/j5lteub/j5lte:6.0.1/MMB29M/J500MUBU1BRD1:user/release-keys'
12-11 13:53:46.553 382-382/? A/DEBUG: Revision: '5'
12-11 13:53:46.553 382-382/? A/DEBUG: ABI: 'arm'
12-11 13:53:46.553 382-382/? A/DEBUG: pid: 9667, tid: 9680, name: GLThread 21503 >>> br.com.daldegam.game <<<
12-11 13:53:46.553 382-382/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
12-11 13:53:46.583 382-382/? A/DEBUG: r0 00000000 r1 000025d0 r2 00000006 r3 ae507978
12-11 13:53:46.583 382-382/? A/DEBUG: r4 ae507980 r5 ae507930 r6 00000000 r7 0000010c
12-11 13:53:46.583 382-382/? A/DEBUG: r8 ae5072b0 r9 b2f2f45f sl 00000001 fp 00000001
12-11 13:53:46.583 382-382/? A/DEBUG: ip 00000006 sp ae507190 lr b6c9cf15 pc b6c9f310 cpsr 400b0010
12-11 13:53:46.593 382-382/? A/DEBUG: backtrace:
12-11 13:53:46.593 382-382/? A/DEBUG: #00 pc 00044310 /system/lib/libc.so (tgkill+12)
12-11 13:53:46.593 382-382/? A/DEBUG: #01 pc 00041f11 /system/lib/libc.so (pthread_kill+32)
12-11 13:53:46.593 382-382/? A/DEBUG: #02 pc 0001ba13 /system/lib/libc.so (raise+10)
12-11 13:53:46.593 382-382/? A/DEBUG: #03 pc 00018c81 /system/lib/libc.so (__libc_android_abort+34)
12-11 13:53:46.593 382-382/? A/DEBUG: #04 pc 00016840 /system/lib/libc.so (abort+4)
12-11 13:53:46.593 382-382/? A/DEBUG: #05 pc 003a1bdf /data/app/br.com.daldegam.game-1/lib/arm/libNoesis.so
12-11 13:53:46.593 382-382/? A/DEBUG: #06 pc 003a1725 /data/app/br.com.daldegam.game-1/lib/arm/libNoesis.so
12-11 13:53:46.593 382-382/? A/DEBUG: #07 pc 003a15b3 /data/app/br.com.daldegam.game-1/lib/arm/libNoesis.so (__gxx_personality_v0+78)
12-11 13:53:46.593 382-382/? A/DEBUG: #08 pc 0004c790 /system/lib/libc.so (__gnu_Unwind_RaiseException+108)
12-11 13:53:46.593 382-382/? A/DEBUG: #09 pc 0001b1e4 /system/lib/libm.so (___Unwind_RaiseException+20)
daldegam

daldegam

2020-12-11 17:05

reporter   ~0006893

If you want to compile lib with -fexceptions, I can try and give you feedback if it has been resolved.

Thanks!
daldegam

daldegam

2021-03-24 15:45

reporter   ~0007101

Hi! I would like to know if there is any prediction for this problem to be evaluated and solved. We have the project paused due to this impediment. Thanks in advance.
jsantos

jsantos

2021-03-24 16:39

manager   ~0007103

Hi!

Unfortunately we cannot enable exceptions in our official builds and this seems to be related to mixing libraries with and without exceptions (it seems to be related to https://github.com/android/ndk/issues/1192 where a workaround is commented but I haven't tried).

Having access to the source code will solve this, in fact with the source code you will probably use noesis as a static lib.

Not sure at what stage of licensing you are but if you are open to negotiate a license with source code, please let us know.
daldegam

daldegam

2021-03-24 19:20

reporter   ~0007104

Yes, we are interested, I will contact Andrea by email.
Thanks.

Issue History

Date Modified Username Field Change
2020-12-11 12:45 daldegam New Issue
2020-12-11 12:45 daldegam Tag Attached: armeabi-v7a
2020-12-11 12:45 daldegam Tag Attached: C++
2020-12-11 12:45 daldegam Tag Attached: OpenGL
2020-12-11 12:45 daldegam File Added: gamecore.7z
2020-12-11 12:47 daldegam Relationship added has duplicate 0001858
2020-12-11 13:22 daldegam Note Added: 0006888
2020-12-11 16:28 jsantos Assigned To => jsantos
2020-12-11 16:28 jsantos Status new => assigned
2020-12-11 16:29 jsantos Note Added: 0006890
2020-12-11 16:29 jsantos Status assigned => feedback
2020-12-11 17:00 daldegam File Added: callstack.png
2020-12-11 17:00 daldegam Note Added: 0006892
2020-12-11 17:00 daldegam Status feedback => assigned
2020-12-11 17:05 daldegam Note Added: 0006893
2021-03-24 15:45 daldegam Note Added: 0007101
2021-03-24 16:39 jsantos Note Added: 0007103
2021-03-24 16:39 jsantos Status assigned => feedback
2021-03-24 19:20 daldegam Note Added: 0007104
2021-03-24 19:20 daldegam Status feedback => assigned