Regression for Native Library Loading in 11.0.5 on Linux
David Holmes
david.holmes at oracle.com
Sun Feb 2 23:17:59 UTC 2020
Hi Marc,
On 1/02/2020 9:56 pm, Marc Streckfuß wrote:
> Dear Sirs or Madams,
> Since posting to the Java Bug System is restricted to OpenJDK Authors, I'm
> asking here for help and maybe someone can create a tracking issue on my
> behalf.
>
> We're seeing a problem where loading the "lwjgl2" (
> https://github.com/LWJGL/lwjgl) native dependencies fails ONLY on Linux and
> ONLY on JDK/JVM 11.
> I've been told that this only happens on 11.0.5, 11.0.4 should be fine,
> however research shows, that this also happens on 11.0.3
> https://unix.stackexchange.com/q/532054.
>
> The issue is:
>
> Inconsistency detected by ld.so: dl-lookup.c: 111: check_match:
> Assertion `version->filename == NULL || ! _dl_name_match_p
> (version->filename, map)' failed!
>
> Technically this issue stems from glib, here:
> https://github.com/lattera/glibc/blob/master/elf/dl-lookup.c#L111, but it
> has to be somehow related to the way the JVM is interacting with glibc, as
> this behavior wasn't there with Java 8.
> I can't really reliable comment on the state for versions 9, 10 and up
> until 11.0.4, but 11.0.5 has the problem and 8 doesn't.
>
> Sorry for the vague information on this one, but maybe someone has an idea
> or could give this a quick look?
> I guess if you already have a dev env setup and can step through with a
> debugger, the issue could be trivial.
I've done a bit of a google search on this problem and it seems to be a
somewhat confused situation. I've seen reports of 8 not working, but
falling back to 8 as fixing it. I've seen 11.0.5 is broken but 11.0.4
works, but someone else said 11.0.4 was fine. I've followed other
reports that indicate this all relates to a glibc bug.
https://hub.jmonkeyengine.org/t/solved-jme-does-not-work-at-all-on-modern-java-due-to-a-regression/42112/14
but also suggests a different solution:
"you either need openJDK 11.0.4 (not 11.0.5) or lwjgl3 instead of lwjgl2
unfortunately."
From what I can tell from the reports that I have found is that the
problem seems to come and go with OpenJDK builds from different OpenJDK
distributors. I did not see any reports that conclusively indicated the
problem was seen on Oracle JDK. My suspicion is that whether or not this
problem appears depends on how the JDK was built i.e. which version of
glibc it has been linked against. The Oracle JDK binaries for 11.0.4 and
11.0.5 seems to have the exact same build environment. I can't comment
on any binaries from other places e.g. AdoptOpenJDK. This conclusion was
also proposed on the jmonkeyengine post above:
"If they’re right, it’s going to depend on what version of glibc you jvm
is using, and possibly what was present when your native payload was
compiled."
Not sure what can be done at the OpenJDK end.
Cheers,
David
> Thanks in Advance,
> Marc Streckfuß
>
More information about the jdk-dev
mailing list