[hardy] ia32 build of java fails to resolve dns names in some cases

Bug #227111 reported by Jason Felice
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ia32-libs (Ubuntu)
New
Undecided
Unassigned
Nominated for Hardy by Lex Ross
sun-java5 (Ubuntu)
New
Undecided
Unassigned
Nominated for Hardy by Lex Ross
sun-java6 (Ubuntu)
New
Undecided
Unassigned
Nominated for Hardy by Lex Ross

Bug Description

Binary package hint: ia32-sun-java5-bin

jfelice@flarp64:/tmp$ lsb_release -rd
Description: Ubuntu 8.04
Release: 8.04
jfelice@flarp64:/tmp$ uname -a
Linux flarp64 2.6.24-16-generic #1 SMP Thu Apr 10 12:47:45 UTC 2008 x86_64 GNU/Linux
jfelice@flarp64:/tmp$ cat foo.java
public class foo {
    public static void main(String[] argv) {
        try {
            new java.net.Socket("www.topcoder.com",5001);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
jfelice@flarp64:/tmp$ javac foo.java
jfelice@flarp64:/tmp$ /usr/lib/jvm/java-1.5.0-sun/bin/java foo
jfelice@flarp64:/tmp$ /usr/lib/jvm/ia32-java-1.5.0-sun/bin/java foo
java.net.UnknownHostException: www.topcoder.com
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:520)
        at java.net.Socket.connect(Socket.java:470)
        at java.net.Socket.<init>(Socket.java:367)
        at java.net.Socket.<init>(Socket.java:180)
        at foo.main(foo.java:4)
jfelice@flarp64:/tmp$

Note that this happens for other people as well:

http://forums.topcoder.com/?module=Thread&threadID=611945&start=0&mc=17#970318

(I'm "eraserhd")

Revision history for this message
Jason Felice (jason-m-felice) wrote :
Revision history for this message
Jason Felice (jason-m-felice) wrote :

I forgot to mention that adding 'www.topcoder.com' to /etc/hosts allows the 32-bit java to work.

Also, here is a screenshot showing some diagnostics about a locking issue that occurs just before the problem in another circumstance. I don't believe it is relevant, but just in case:

http://eraserhead.net/arena-problem.png

Revision history for this message
Dan Everton (dan-iocaine) wrote :

This also seems to affect the ia32 version of Java 6 too.

Revision history for this message
Arkaaito (alstisgi) wrote :

Me three!

Sorry for this, my initial search failed to turn up your thread: http://forums.topcoder.com/?module=Thread&threadID=608713&start=0&mc=5#972557

Reproed on Debian x64. Some other details are in the thread - feel free also to e-mail me if I can be of assistance in pinning the problem down further.

Revision history for this message
Jason Felice (jason-m-felice) wrote :

I've found a better work around that suggests this is a problem with ia32-libs.

If you edit /etc/nsswitch.conf and place 'dns' before the 'mdns4_minimal' on the 'hosts' line, it will work.

I can't figure out why, though. In C, gethostbyname() works in both 32 and 64 bit. I don't know how to track down what Java does to resolve names.

Revision history for this message
Jason Felice (jason-m-felice) wrote :

OK, it looks like this is a duplicate of a known bug.

Solution: apt-get install lib32nss-mdns

I'm marking as dup.

Revision history for this message
Lex Ross (lross) wrote :

Installing lib32nss-mdns did not help me with both Hardy and Intrepid 8.10 RC/64-bit. Neither did putting the site into /etc/hosts. Sun's 32-bit javaws fails to connect to server, period. Open java provided by default logs into server but does not work with application. I am forced to reboot into 32-bit Gutsy whenever I need to use Java web start. Any ideas? And when 64-bit version of Sun Java Web Start is going to be released? I think it is up to the community now.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.