Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

Crash on API level 28 when SoLoader initialise the .so libraries #58

Closed
prithvibhola opened this issue Jan 16, 2020 · 6 comments
Closed

Comments

@prithvibhola
Copy link

Hi, we are facing an issue on API Level 28 while Profilo tries to load .so Libraries using SoLoader. Here are the stack traces

E/SoLoader: couldn't find DSO to load: libgnustl_shared.so caused by: dlopen failed: "/data/data/com.app.telemetry/lib-main/libgnustl_shared.so" has unexpected e_machine: 40 (EM_ARM)
2020-01-16 12:46:39.294 26366-26366/com.app.telemetry W/System.err: com.facebook.soloader.SoLoader$WrongAbiError: APK was built for a different platform
2020-01-16 12:46:39.294 26366-26366/com.app.telemetry W/System.err:     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:645)
2020-01-16 12:46:39.294 26366-26366/com.app.telemetry W/System.err:     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:587)
2020-01-16 12:46:39.294 26366-26366/com.app.telemetry W/System.err:     at com.facebook.soloader.DirectorySoSource.loadDependencies(DirectorySoSource.java:111)
2020-01-16 12:46:39.294 26366-26366/com.app.telemetry W/System.err:     at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:71)
2020-01-16 12:46:39.294 26366-26366/com.app.telemetry W/System.err:     at com.facebook.soloader.UnpackingSoSource.loadLibrary(UnpackingSoSource.java:458)
2020-01-16 12:46:39.294 26366-26366/com.app.telemetry W/System.err:     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:731)
2020-01-16 12:46:39.294 26366-26366/com.app.telemetry W/System.err:     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:639)
2020-01-16 12:46:39.294 26366-26366/com.app.telemetry W/System.err:     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:587)
2020-01-16 12:46:39.294 26366-26366/com.app.telemetry W/System.err:     at com.facebook.soloader.DirectorySoSource.loadDependencies(DirectorySoSource.java:111)
2020-01-16 12:46:39.295 26366-26366/com.app.telemetry W/System.err:     at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:71)
2020-01-16 12:46:39.295 26366-26366/com.app.telemetry W/System.err:     at com.facebook.soloader.UnpackingSoSource.loadLibrary(UnpackingSoSource.java:458)
2020-01-16 12:46:39.295 26366-26366/com.app.telemetry W/System.err:     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:731)
2020-01-16 12:46:39.295 26366-26366/com.app.telemetry W/System.err:     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:639)
2020-01-16 12:46:39.295 26366-26366/com.app.telemetry W/System.err:     at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:577)
2020-01-16 12:46:39.295 26366-26366/com.app.telemetry W/System.err:     at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:525)
2020-01-16 12:46:39.295 26366-26366/com.app.telemetry W/System.err:     at com.facebook.profilo.logger.Logger.initialize(Logger.java:58)
2020-01-16 12:46:39.296 26366-26366/com.app.telemetry W/System.err:     at com.facebook.profilo.core.TraceOrchestrator.bind(TraceOrchestrator.java:230)
2020-01-16 12:46:39.296 26366-26366/com.app.telemetry W/System.err:     at com.facebook.profilo.core.TraceOrchestrator.initialize(TraceOrchestrator.java:101)

and

java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libprofilo.so caused by: couldn't find DSO to load: libprofilo_fmt.so caused by: APK was built for a different platform
        at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:789)
        at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:639)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:577)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:525)
        at com.facebook.profilo.logger.Logger.initialize(Logger.java:58)
        at com.facebook.profilo.core.TraceOrchestrator.bind(TraceOrchestrator.java:230)
        at com.facebook.profilo.core.TraceOrchestrator.initialize(TraceOrchestrator.java:101)

Specifications of the emulator on which we are getting the issue:
Android version: 28
Device: Pixel XL
Architecture: x86,armeabi-v7a,armeabi(executing adb -s emulator-5556 shell getprop ro.product.cpu.abilist)

We backtracked the releases and figured out that the issue is coming from the following release : https://github.com/facebookincubator/profilo/tree/release-62ca671 in which the SoLoader is updated to the latest version(0.8.0)

Is this a known issue or are we missing something?

@ricardorey10
Copy link
Contributor

Hey, @prithvibhola !

Thanks for bringing this up. It looks like this is a legit issue and we're actively working on it. We're very sorry for this, but we'll try to fix this ASAP =)

In the meantime, I have a quick question. Is this app running on arm64?

@prithvibhola
Copy link
Author

Hey, we tested the application on the emulator with 32-bit architecture.

@BurntBrunch
Copy link
Contributor

This looks the same as SoLoader issue #55.
I've investigated this a bit and I am reasonably convinced that particular emulator image is just broken.

The Google APIs version is reporting both x86 and armv7 compatibility when the non-Google version correctly only reports x86. As a workaround, can you try using an SDK 29 (Q) Google APIs image? In my testing, that image should behave better.

I've also posted this on the Android bug tracker here.

@prithvibhola
Copy link
Author

Hey @BurntBrunch ,
If this is the Google APIs version issue, then why the issue is coming on the latest version of SoLoader and working fine with v0.6.1?

@xserxses
Copy link

@prithvibhola, unfortunately, I found out that downgrade to 0.6.1 didn't help as I faced crashes on production :/ facebook/SoLoader#55

@BurntBrunch
Copy link
Contributor

then why the issue is coming on the latest version of SoLoader and working fine with v0.6.1?

0.8.0 fixes bugs in 0.6.1 around phones that report the wrong ABIs.
Google are reporting that the image is actually correct because there's runtime dynamic code translation in that image. I'll try and find a way to fix this in the soloader repo, moving discussions there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants