ModernLinker issue loading SO files in runtime

104 views
Skip to first unread message

ayde...@gmail.com

unread,
Dec 12, 2017, 2:21:15 PM12/12/17
to Chromium-dev
Hi all! We used external library-SDK with so files in our project and there were no problems with it. The application worked as expected and had no problems but recently we started to receive lots of crashes with unclear logs. Digging deeper we found that on application creation exception occured when loading native libraries. Log:

12-11 17:32:08.046 23156 23201 E cr_ChromiumAndroidLinker: LoadLibrary: android_dlopen_ext: dlopen failed: library "libchrome.so" not found
12-11 17:32:08.046 23156 23201 E cr_LibraryLoader: Unable to load library: libchrome.so
12-11 17:32:08.046 23156 23201 I cr_LibraryLoader: Time to load native libraries: 230 ms (timestamps 2646-2876)
12-11 17:32:08.046 23156 23201 E art     : No implementation found for void org.chromium.base.library_loader.LibraryLoader.nativeInitCommandLine(java.lang.String[]) (tried Java_org_chromium_base_library_1loader_LibraryLoader_nativeInitCommandLine and Java_org_chromium_base_library_1loader_LibraryLoader_nativeInitCommandLine___3Ljava_lang_String_2)


12-11 17:32:08.066 23156 23201 E AndroidRuntime: FATAL EXCEPTION: AsyncTask #3


12-11 17:32:08.066 23156 23201 E AndroidRuntime: java.lang.RuntimeException: An error occurred while executing doInBackground()
12-11 17:32:08.066 23156 23201 E AndroidRuntime: at android.os.AsyncTask$3.done(AsyncTask.java:309)
12-11 17:32:08.066 23156 23201 E AndroidRuntime: at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
12-11 17:32:08.066 23156 23201 E AndroidRuntime: at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
12-11 17:32:08.066 23156 23201 E AndroidRuntime: at java.util.concurrent.FutureTask.run(FutureTask.java:242)
12-11 17:32:08.066 23156 23201 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
12-11 17:32:08.066 23156 23201 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
12-11 17:32:08.066 23156 23201 E AndroidRuntime: at java.lang.Thread.run(Thread.java:818)
12-11 17:32:08.066 23156 23201 E AndroidRuntime: Caused by: java.lang.UnsatisfiedLinkError: No implementation found for void org.chromium.base.library_loader.LibraryLoader.nativeInitCommandLine(java.lang.String[]) (tried Java_org_chromium_base_library_1loader_LibraryLoader_nativeInitCommandLine and Java_org_chromium_base_library_1loader_LibraryLoader_nativeInitCommandLine___3Ljava_lang_String_2)
12-11 17:32:08.066 23156 23201 E AndroidRuntime: at org.chromium.base.library_loader.LibraryLoader.nativeInitCommandLine(Native Method)
12-11 17:32:08.066 23156 23201 E AndroidRuntime: at org.chromium.base.library_loader.LibraryLoader.ensureCommandLineSwitchedAlreadyLocked(LibraryLoader.java:357)
12-11 17:32:08.066 23156 23201 E AndroidRuntime: at org.chromium.base.library_loader.LibraryLoader.initializeAlreadyLocked(LibraryLoader.java:368)
12-11 17:32:08.066 23156 23201 E AndroidRuntime: at org.chromium.base.library_loader.LibraryLoader.ensureInitialized(LibraryLoader.java:144)
12-11 17:32:08.066 23156 23201 E AndroidRuntime: at org.chromium.chrome.browser.init.AsyncInitTaskRunner$LoadTask.doInBackground$5f8445a4(AsyncInitTaskRunner.java:48)
12-11 17:32:08.066 23156 23201 E AndroidRuntime: at org.chromium.chrome.browser.init.AsyncInitTaskRunner$LoadTask.doInBackground(AsyncInitTaskRunner.java:42)
12-11 17:32:08.066 23156 23201 E AndroidRuntime: at android.os.AsyncTask$2.call(AsyncTask.java:295)
12-11 17:32:08.066 23156 23201 E AndroidRuntime: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
12-11 17:32:08.066 23156 23201 E AndroidRuntime: ... 3 more

The crash is completely random. happens in 30% of times on some rare devices. Using LegacyLinker fixes the issue but we hope to find the issue and leave ModernLinker as is. Any help is appreciated

Egor Pasko

unread,
Dec 18, 2017, 11:38:20 AM12/18/17
to ayde...@gmail.com, Chromium-dev
Not sure what your setup is, but non-determinism is a little puzzling to me.

We are planning to remove the ModernLinker in Chromium soon: https://goo.gl/kWnHYr (link to googledoc on chromium.org), in favor of the LegacyLinker (yes .. as intuitive as that). I expect this to be a path of a few surprises, likely to be reverted a few more times.

If you do not need RELRO sharing/packing and loading from the APK, then you can use System.loadLibrary(), this is the path of least surprise.

Generally we do not support any external libraries that might want to provide parts of Chromium on a side. On Android the supported alternatives are: CustomTabs, WebView, Cronet.

Dennis

unread,
May 13, 2019, 3:58:01 AM5/13/19
to Chromium-dev
I want to reopen an old topic. I'm getting a similar error in an older Chromium version(64.0.3246.0). Are there any suggestions?

12 Aralık 2017 Salı 22:21:15 UTC+3 tarihinde ayde...@gmail.com yazdı:
Reply all
Reply to author
Forward
0 new messages