DynamicLibrary.process() does not correctly expose symbols on the Android emulator.
A manual use of dlsym with RTLD_DEFAULT does succeed in finding the symbols after a manual dlopen with RTLD_GLOBAL.
This is surprising, because the implementation of DynamicLibrary.process() is RTLD_DEFAULT.
DynamicLibrary.process()
does not correctly expose symbols on the Android emulator.A manual use of
dlsym
withRTLD_DEFAULT
does succeed in finding the symbols after a manualdlopen
withRTLD_GLOBAL
. This is surprising, because the implementation ofDynamicLibrary.process()
isRTLD_DEFAULT
.https://github.com/dart-lang/sdk/blob/f779ba3cb084b5d49cae86fe1cd6ebcd5717fc8c/runtime/lib/ffi_dynamic_library.cc#L176-L183
Repro in Flutter FFI plugin: https://github.com/dcharkes/ffi-plugin-with-ffi-native/blob/main/lib/my_plugin.dart
Uncovered in investigating: https://github.com/dart-lang/native/issues/923.