dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.12k stars 1.57k forks source link

[vm/ffi] `DynamicLibrary.process()` on Android emuators #53249

Open dcharkes opened 1 year ago

dcharkes commented 1 year ago

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.

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.

a-siva commented 10 months ago

//cc @liamappelbe

a-siva commented 8 months ago

//cc @dcharkes @liamappelbe is this a P2 issue ?