libobjc2: UnexpectedException test failing on ARM ABIs
This test was recently added in #220 and subsequently disabled on ARM (https://github.com/gnustep/libobjc2/commit/226455bd10d8b4a0a090449b5b7ebf1e42daf0a5) due to failing on the cross-build ARM CI targets.
I’m able to reproduce it on an arm64 Android emulator with this result in gdb:
Program received signal SIGABRT, Aborted.
0x0000007fbdee5f74 in abort () from target:/apex/com.android.runtime/lib64/bionic/libc.so
(gdb) bt
#0  0x0000007fbdee5f74 in abort () from target:/apex/com.android.runtime/lib64/bionic/libc.so
#1  0x0000007fbe2e7178 in objc_exception_throw (object=0x5555558ee0 <.objc_str_Exception>)
    at eh_personality.c:261
#2  0x0000005555556a4c in main ()
    at UnexpectedException.m:38
Any idea what might be going on here? Interestingly the exception hook is working fine in our app on Android ARM devices and has been for years.
Steps to reproduce with an Android emulator (on macOS ARM host, NDK paths may vary):
adb push libobjc.so /data/local/tmp
adb push Test/UnexpectedException /data/local/tmp
adb push $ANDROID_NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_shared.so /data/local/tmp
# run test
adb shell LD_LIBRARY_PATH=/data/local/tmp/ /data/local/tmp/UnexpectedException
# debug with gdb
adb push $ANDROID_NDK_ROOT/prebuilt/android-arm64/gdbserver/gdbserver /data/local/tmp
adb forward tcp:5039 tcp:5039
adb shell
> cd /data/local/tmp
> LD_LIBRARY_PATH=$PWD ./gdbserver :5039 ./UnexpectedException
# on host machine
$ANDROID_NDK_ROOT/prebuilt/darwin-x86_64/bin/gdb
> target remote :5039
> c
About this issue
- Original URL
- State: open
- Created 9 months ago
- Comments: 21 (10 by maintainers)
Commits related to this issue
- Tests: disable failing UnexpectedException test on ARM architectures — committed to gnustep/libobjc2 by triplef 10 months ago
s/libgcc/gcc/. The bug is not in libgcc directly but rather the code that GCC produces has the bug.
I hope to get it backported in time for the GCC 11.5 release but we will see. I will be posting the patch over the weekend and I doubt it will be reviewed until Monday or later.
I would enable it unconditionally. The libgcc patch will probably be backported to gcc 13 and maybe gcc 12.