Assertion when loading shared object with unmet version dependencies

Marc Streckfuß marc.streckfuss@gmail.com
Fri Feb 14 23:16:00 GMT 2020


Hello all!

I am currently debugging a strange problem where loading a native library
stops working depending on the build environment used to build openJDK.

Basically when loading the lwjgl2.so, it fails at the following assertion:
https://github.com/lattera/glibc/blob/master/elf/dl-lookup.c#L111

So, the problem is: With OpenJDK 11, they removed the source maps, so the
symbol SUNWprivate_1.1 which lwjgl2's verneed depends on isn't emitted
anymore.

Furthermore it depends on whether building openJDK with Debian, where the
linker still emits GLIBC_2_2_5 symbols, so versym and verneed still exist
[and verdef doesn't] or building with Ubuntu, where no version table
doesn't exist at all.

So when building with Debian, I can load lwjgl2, even though the version
dependency cannot be resolved, the symbol is just loaded.
When building on Ubuntu, where no version table exists at all, the
following assertion crashes the application.

In case you want to read the whole story, the following are our tracking
bugs:
https://bugs.launchpad.net/ubuntu/+source/openjdk-lts/+bug/1838740
https://mail.openjdk.java.net/pipermail/jdk-dev/2020-February/003865.html

btw: Even when building on Ubuntu with Debians glibc, I fail to make it
emit the version tables.

Thanks in Advance!
Marc Streckfuß



More information about the Libc-help mailing list