-
Notifications
You must be signed in to change notification settings - Fork 937
Fix NativememTests#dlopenCustomLib on Alpine
#1254
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
Conversation
|
Should we instead make sure |
|
I think a better fix (and a more canonical way to check for errors) will be not to call |
If you mean that we should not always call |
I would think we can log such errors, or ignore them purposefully by calling |
|
I mean, calling |
|
How do you determine if a dl function is failed, without calling |
By checking return value. |
|
That sounds good, but in the example we can see that |
|
We can change the tests not to be too strict about |
Description
This PR fixes
NativememTests#dlopenCustomLibon Alpine.Hooks::initincludes the following three lines:ADDRESS_OFis defined as follows:and ignores
dlerror, which could then leak in subsequent parts of the code, even thoughsymis eventually patched using the original symbol rather than the one resolved bydlsym. This is why theASSERT_NO_DLERRORat L48 fails with the following error:A similar problem happens a bit below, in the
ASSERT_NO_DLERRORafter(call_malloc_t)dlsym(lib, "call_malloc"):This is coming from
Profiler::start -> VM::tryAttach, which does not find anylibjvm.so(as expected) and does not reset thedlerror.Related issues
#1226
Motivation and context
Tests introduced in #1243 do not work properly on Alpine, presumably because
dlerroris not used in the same way in glibc and musl.How has this been tested?
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.