BACKGROUND
JRockit includes a few patches of the JDK. In order to simplify the JRockit JDK updating process, we want to move as many as possible of these to the Java SE JDK.
PROBLEM
JRockit uses the NET_Read, NET_Send, NET_Timeout and other methods from libnet.so. However, these are not exported in the Java SE JDK. JRockit therefore builds its own version of this lib with the same source code but with these methods exported. This is only an issue in 1.4.2 and 1.5.0. In 1.6.0 these methods are already exported
Run "readelf libnet.so -s | grep NET"
In the Java SE JDK, only 10 methods are currently exported (the ones at http://opengrok.ireland.sun.com:8080/source/xref/5.0-rev-latest/j2se/make/java/net/mapfile-vers)
JRockit also needs the following methods exported (should be 32 methods all in all in 1.5.0, and 30 methods in 1.4.2):
NET_Read NET_Send NET_Timeout NET_Accept NET_addrtransAvailable NET_Connect NET_Dup2 NET_GetFileDescriptorID NET_IPv4MappedToIPv4 NET_IsEqual NET_IsIPv4Mapped NET_Poll NET_Read NET_ReadV NET_RecvFrom NET_Send NET_SendTo NET_SetTrafficClass NET_SocketClose NET_ThrowByNameWithLastError NET_ThrowCurrent NET_ThrowNew NET_Timeout NET_WriteV
1.5.0 only: NET_Wait NET_SockaddrEqualsInetAddress0
The solution should simply be to add these to the mapfile
REPRODUCER
1) Download JRockit R27.6.7 1.5.0 or 1.4.2 for Linux: ftp://jrpgftp.se.oracle.com/jrockit_builds/R27.6.7/builds/R27.6.7-23/release/linux_ia32/jrockit-jdk1.5.0_24-linux_ia32.zip
ftp://jrpgftp.se.oracle.com/jrockit_builds/R27.6.7/builds/R27.6.7-23/release/linux_ia32/jrockit-jdk1.4.2_26-linux_ia32.zip
2) Replace jre/lib/i386/libnet.so with the default JDK version
3) Run a java program that calls:
new ServerSocket(4321);
You will fail with error message
Exception in thread "Main Thread" java.lang.UnsatisfiedLinkError: failed to initialize net library.
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
AFFECTED VERSIONS: 1.4.2, 1.5.0
|