Obscure eclipse failures with OpenJDK 7
fw at deneb.enyo.de
Sat May 2 12:53:00 UTC 2009
A stock build of OpenJDK 7 on Debian sid results in obscure failures
when running Eclipse due to internal errors in java.util.zip:
java.lang.InternalError: error code: -6
at java.util.zip.Deflater.init(Native Method)
I guess that this is an incompatibility between the system zlib (which
is loaded by Eclipse) and OpenJDK's copy. Both use the same symbols,
and with ELF dynamic linking, it is a bit hard to predict which
definition gets picked up. (I haven't positively identified such a
symbol clash as the actual cause, but -6 is Z_VERSION_ERROR in the
system zlib, and OpenJDK's zlib copy doesn't return this error code,
so I'm reasonably convinced I've identified the problem.)
There are several ways to work around that: Dynamically link against
the system zlib in OpenJDK (this is what I did, using the patch from
IcedTea), use "ld -r" with some linker script to hide the zlib
symbols, use hidden visibility, use symbol versioning, or rename all
definitions in the source file.
I don't know why this issue only appeared relatively recently.
Perhaps the system zlib and OpenJDK's version were somewhat
compatible, hiding the name clash. Or there were some changes in
OpenJDK how dlopen was used.
More information about the core-libs-dev