Comments (11)
Most likely this is a dup of http://b.android.com/181517. I assume this was libc++_shared
?
from ndk.
@DanAlbert I cannot open your link. It was libc++_static
.
Edit: http version of link works for me.
from ndk.
Oops. Link fixed, but I guess not then...
from ndk.
Well, the libc++ + clang version crashed with SIGSEGV immediately when calling native method and stack trace was completely wrong.
Hopefully I will have time to investigate this further next week and probably prepare some sample.
from ndk.
E/AndroidRuntime( 5460): FATAL EXCEPTION: main
E/AndroidRuntime( 5460): java.lang.ExceptionInInitializerError
E/AndroidRuntime( 5460): at java.lang.Class.newInstanceImpl(Native Method)
E/AndroidRuntime( 5460): at java.lang.Class.newInstance(Class.java:1409)
E/AndroidRuntime( 5460): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
E/AndroidRuntime( 5460): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
E/AndroidRuntime( 5460): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
E/AndroidRuntime( 5460): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
E/AndroidRuntime( 5460): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
E/AndroidRuntime( 5460): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 5460): at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime( 5460): at android.app.ActivityThread.main(ActivityThread.java:3683)
E/AndroidRuntime( 5460): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 5460): at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime( 5460): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/AndroidRuntime( 5460): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/AndroidRuntime( 5460): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 5460): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1479]: 67 unknown reloc type 160 @ ( 379)
E/AndroidRuntime( 5460): at java.lang.Runtime.loadLibrary(Runtime.java:434)
E/AndroidRuntime( 5460): at java.lang.System.loadLibrary(System.java:554)
E/AndroidRuntime( 5460): at com.example.hellojni.HelloJni.(HelloJni.java:64)
E/AndroidRuntime( 5460): ... 15 more
W/ActivityManager( 106): Force finishing activity com.example.hellojni/.HelloJni
Relocation 160 is an ifunc. After some readelf and some objdump, tracked that down to libatomic. Android doesn't support ifuncs until M, so this is going to require a fix to GCC...
from ndk.
A little more testing shows that this is specific to GCC, which is why the libc++ test suite didn't catch it (we don't run the tests with GCC yet because our version of libc++ is far too old for the test suite to be very GCC compatible).
from ndk.
Maybe the title should be updated, this is much worse than the title implies:
The failure isn't limited to libc++ runtime, and it affects android up until 5.0 (not just the rather old 2.3).
Would it be possible to recompile libatomic with HAVE_IFUNC=false? After a cursory look it appears to support that.
from ndk.
Yeah, the fix is nearly done. The changes to our GCC were https://android-review.googlesource.com/#/c/210660/ and https://android-review.googlesource.com/#/c/212250/. I just need to actually pull the new prebuilts into the NDK.
Updated the title to reflect the issue more clearly.
from ndk.
Just as an FYI, not clear if this will be in the r12 beta that I'll be kicking out in a couple weeks, but it will definitely be in the r12 release in June.
from ndk.
@DanAlbert, we didn't experience that crash on Android 4.0, 4.1 and 4.4 - only on 2.3. Are you sure this affects all android versions up until 5.0?
EDIT: sorry, I didn't notice that this is solely an armeabi issue (i.e. not present in armeabi-v7a and x86, which we used for testing on 4.0, 4.1 and 4.4).
from ndk.
Fix is in for r12.
from ndk.
Related Issues (20)
- [Bug]: ld.lld: error: undefined symbol: __aeabi_l2d HOT 4
- [BUG] Unable to Handle Exceptions Properly HOT 2
- [BUG] With Buildozer for Python/Kivy project for Android NDK 26b HOT 6
- [Bug]: Cannot select while compiling llama.cpp on Windows HOT 4
- Simpleperf: Only one FEAT_FILE2 feature section can be read from the file HOT 2
- AES support (arm/arm64 vaeseq_u8) HOT 12
- [FR] clang driver should default to gnu hashes if the target api level is >= 23? HOT 7
- [Bug]: Segmentation Fault trying to run an LLVM pass HOT 2
- [Bug] clang frontend crashes on NDK 28.0.11617993 HOT 11
- [BUG] Building Library\Bee\artifacts\Android\a7sem\2b6k1szry106.o failed [RAM ISSUE?] HOT 9
- [FR] remove superfluous LLVM libraries HOT 10
- [BUG] clang frontend crashes on both r26d and canary version HOT 5
- [Bug] ndk clang building release raise error `declaration does not match` while llvm upstream compiles HOT 8
- [FR] improve bad diagnostic for `__REMOVED_IN` on `ALooper_pollAll` HOT 8
- [BUG] With Compose AndroidView on API 29, ANativeWindow_fromSurface with SurfaceView without an additional ViewGroup makes AndroidViewsHandle go black HOT 3
- [FR] Update Vulkan headers in sysroot of NDK r27 to enable FFmpeg's Vulkan integration HOT 19
- [Feature request] consider to provide libc.a for each API level HOT 6
- [BUG] using thread_local in x64 Android 12L/13 desktop simulator for release build generates invalid init function for thread_local variable that leads to SIGSEGV HOT 1
- [BUG] 23.1.77 Build errors on Unity 2022.3.21f1 HOT 7
- [BUG] Prebuilt clang and ld.lld fail to load compatible pass plugin HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ndk.