Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[java-interop] use RTLD_GLOBAL|RTLD_NOW
Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=4003094&view=logs&j=051336c7-58fc-58df-2c99-9295b706a641&t=cd7280e7-3b2b-5dce-74ae-fa5a799ab1af d3d1c61 failed; RTLD_LOCAL|RTLD_NOW doesn't work. Which *does* make sense given the prior conjecture; > Thus, the next conjecture: whatever codepath was trying to lookup > `java_interop_jnienv_get_java_vm` within 2cf8ac9 *isn't* using > `java_interop_get_symbol_address()` to do so, and is instead relying > on the normal dynamic linker (somehow). RTLD_LOCAL means "you can only use the handle returned from dlopen() along with dlsym() to find symbols", and since our current conjecture is that "something else" is "somehow" obtaining these symbols, then therefore the .so *must* be loaded globally. RTLD_GLOBAL is also the default, so the prior log that mentioned RTLD_NOW was implicitly using RTLD_GLOBAL. Confirm the current theory: we need global lookup, so use RTLD_GLOBAL. (I'd also consider trying RTLD_LAZY, but I think RTLD_NOW is closer to Windows' LoadLibrary() semantics anyway...)
- Loading branch information