Red Hat Bugzilla – Bug 163006
sun's java 1.4.2_08 can't open network sockets
Last modified: 2007-11-30 17:11:09 EST
Description of problem:
Sun's latest patchlevel of it's 1.4.2 java software can not open network sockets
on FC4. In java 1.5 it works as expected, but unfortunately lots of software
require java 1.4 to function.
Version-Release number of selected component (if applicable):
glibc-2.3.5-10 (x86, x86_64)
Steps to Reproduce:
1. fetch and install j2sdk-1.4.2_08 from java.sun.com
2. compile and run the attached small program
Exception in thread "main" java.net.SocketException: Invalid argument or cannot
assign requested address
at java.net.PlainSocketImpl.socketConnect(Native Method)
nothing, or perhaps a ConnectException: Connection refused if you don't have a
listening sshd on localhost.
I understand that this is probably Sun's fault, but if there is a simple change
to be made to the glibc that fixes this perhaps it would be a good idea since a
lot of us in the RealWorld^tm are stuck with needing to run sun's 1.4 java and
the proabability of Sun fixing their software in a reasonable timeframe is
glibc is not going to put in workarounds for bogus programs.
You really have to take this with Sun.
I have reported this issue to Sun. Is there any way of finding out how the glibc
api is used by a binary program? If I could point out exactly what they do wrong
perhaps this problem can be fixed a bit faster.
You can try tracing the program with strace -f, if the call to glibc function
is done from the program and not from shared libraries it uses, you can use
ltrace as well. And of course there is gdb.
FYI my attempts to pinpoint the problem failed. I filed an error report with sun
on 050712 with internal review ID 488634. It has not yet been turned into a web
searchable bug. The email with the report confirmation states that there is a
three week response time, so perhaps we'll have a bug report in a week.
In light of this it becomes obvious what a great job the redhat people are doing
with their product. Thanks!
Just for the lurkers, i got a response from sun today stating that passing
-Djava.net.preferIPv4Stack=true java works around the problem.
Thought I'd chip in the solution this:
I doubt that this is a glibc problem! On FC3 with glibc-2.3.5-0.fc3.1 and
kernel-2.6.11-1.35_FC3 everything works fine. But installing
kernel-2.6.12-1.1372_FC3 brakes Java's TCP implementation. Please see bug
#163650 and fix it.
*** This bug has been marked as a duplicate of 163650 ***
Marking this bug a duplicate of bug 164165, which is filed against the FC4
kernel and has a fix in CVS.
*** This bug has been marked as a duplicate of 164165 ***