-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fall back to a fully qualified path to libapp.so if the library can not be loaded by name #9762
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this 👍
…ot be loaded by name libapp.so contains compiled application Dart code. On most Android systems, this library can be loaded by calling dlopen("libapp.so"), which will search Android's default library directories. On some Android devices this does not work as expected. As a workaround, this patch provides a fallback path to libapp.so based on ApplicationInfo.nativeLibraryDir. Fixes flutter/flutter#35838
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't fully qualifying it pose problems before when the shared library was still in the zip archive?
Yes - loading with |
Does this really fix the case of the bug report then, since isn't |
This is intended as a workaround for a specific old Android device where calling dlopen with an unqualified name does not produce the same results as standard Android devices. The affected device is running a variant of Jellybean and predates support for loading libraries directly out of a ZIP file. |
Gotcha. LGTM. |
…ry can not be loaded by name (flutter/engine#9762)
…ry can not be loaded by name (flutter/engine#9762)
flutter/engine@3b94410...bcde838 git log 3b94410..bcde838 --no-merges --oneline bcde838 Roll Wuffs and buildroot (flutter/engine#9791) 3b75979 fix ColorFilter.matrix constness (flutter/engine#9789) 3c9a22c Fall back to a fully qualified path to libapp.so if the library can not be loaded by name (flutter/engine#9762) 298a610 Roll fuchsia/sdk/core/mac-amd64 from XOXaWqvr4OuJ6O3uPefSwSFjZMaEmDHy5JQm3Q8Oc0wC to CDbRdGJ3bu-aWMCZqN5VzfQqIBwDGL2wfFodWABKdCIC (flutter/engine#9790) 833f6b4 Roll src/third_party/skia f9fcf7ffa89a..7825d4983f90 (6 commits) (flutter/engine#9788) 1250c37 Add comments to differentiate two cache paths (flutter/engine#9721) The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff (garyq@google.com), and stop the roller if necessary.
Can we add a test for this? |
We could add a device with this issue to the device lab. For unit tests, there's an ongoing discussion about how to test Java embedding code that relies on Android APIs. |
I just checked the Firebase device farm and the lowest Android version they have is |
dlopen errors are expected behavior when locating libapp.so on some older Android devices (see flutter#9762)
dlopen errors are expected behavior when locating libapp.so on some older Android devices (see #9762)
…ot be loaded by name (flutter#9762) libapp.so contains compiled application Dart code. On most Android systems, this library can be loaded by calling dlopen("libapp.so"), which will search Android's default library directories. On some Android devices this does not work as expected. As a workaround, this patch provides a fallback path to libapp.so based on ApplicationInfo.nativeLibraryDir. Fixes flutter/flutter#35838
dlopen errors are expected behavior when locating libapp.so on some older Android devices (see flutter#9762)
…ot be loaded by name (#9762) libapp.so contains compiled application Dart code. On most Android systems, this library can be loaded by calling dlopen("libapp.so"), which will search Android's default library directories. On some Android devices this does not work as expected. As a workaround, this patch provides a fallback path to libapp.so based on ApplicationInfo.nativeLibraryDir. Fixes flutter/flutter#35838
dlopen errors are expected behavior when locating libapp.so on some older Android devices (see #9762)
This PR has been merged into a hotfix candidate, 1.7.8+hotfix.4, currently in the beta channel. If it soaks well, we anticipate pushing this to stable soon. |
Thanks, @kf6gpe - I can confirm |
flutter/engine@3b94410...bcde838 git log 3b94410..bcde838 --no-merges --oneline bcde838 Roll Wuffs and buildroot (flutter/engine#9791) 3b75979 fix ColorFilter.matrix constness (flutter/engine#9789) 3c9a22c Fall back to a fully qualified path to libapp.so if the library can not be loaded by name (flutter/engine#9762) 298a610 Roll fuchsia/sdk/core/mac-amd64 from XOXaWqvr4OuJ6O3uPefSwSFjZMaEmDHy5JQm3Q8Oc0wC to CDbRdGJ3bu-aWMCZqN5VzfQqIBwDGL2wfFodWABKdCIC (flutter/engine#9790) 833f6b4 Roll src/third_party/skia f9fcf7ffa89a..7825d4983f90 (6 commits) (flutter/engine#9788) 1250c37 Add comments to differentiate two cache paths (flutter/engine#9721) The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff (garyq@google.com), and stop the roller if necessary.
As the Engine uses `dlopen` to find the `libapp.so`, flutter/flutter#59834 can happen which will prevent `dlopen` from finding the binary. In theory this should be mitigated by flutter#9762, but an internal customer observed errors where `dlopen` is not found. The additional logging here can help to rule out that hypothesis. For Googlers, see b/276657840 for more details.
As the Engine uses `dlopen` to find the `libapp.so`, flutter/flutter#59834 can happen which will prevent `dlopen` from finding the binary. In theory this should be mitigated by #9762, but an internal customer observed errors that could be related. The additional logging here can help to rule out that hypothesis. For Googlers, see b/276657840 for more details. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
libapp.so contains compiled application Dart code. On most Android systems,
this library can be loaded by calling dlopen("libapp.so"), which will search
Android's default library directories.
On some Android devices this does not work as expected. As a workaround, this
patch provides a fallback path to libapp.so based on ApplicationInfo.nativeLibraryDir.
Fixes flutter/flutter#35838