Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4118392

JDK1.1.6J regression: Cannot create Datagram Socket on WINDOWS95. Get exception.

XMLWordPrintable

    • 1.1.6
    • x86
    • windows_95
    • Verified

      I cannot create a Datagram Socket on Windows95 for JDK1.1.6J. This is
      a REGRESSION from JDK1.1.5. I get the following exception:

      % run_udp_server
      VERBOSE: port number is = 26000
      VERBOSE: loop count is = 0
      DEBUG: creating datagram socket on port 26000
      ERROR: udpServer.udpServer(): caught exception
      java.lang.NullPointerException: null Address
      java.lang.NullPointerException: null Address
      at java.net.DatagramSocket.create(DatagramSocket.java:138)
      at java.net.DatagramSocket.<init>(Compiled Code)
      at udpServer.<init>(Compiled Code)
      at udpServer.main(Compiled Code)
      FINALSTATUS:udpServer:EXIT_ERROR:2:Number of ERRORS:1:TEST INCOMPLETE

      I have a udpServer program and udpClient program that reproduces
      the problem.

      The programs are added as part of the attachment.

      To run the programs type the following:

      % uncompress udp.tar.Z
      % tar xvf udp.tar
      % cd udp
      % javac *.java
      % run_udp_server or run_udp_client


      Hello,

      I found the problem with BUGID: 4118392 on WINDOWS95 and WINDOWSNT.

      4118392 P3/S3 JDK1.1.6J regression: Cannot create Datagram Socket
                            on Windows95. Get exception.

      The problem is a JIT BUG. Static initialization is not getting done
      in all cases.

      Here is what happens:

      I created and modified my own version of the JDK1.1.6J build and
      added debugging statements in the files:

      DatagramSocket.java
      InetAddress.java

      When I run my UDP application with this debugged build here is
      what I found:

      When I run with the JIT it does not get into the static initializer
      code in the file: InetAddress.java

      where it sets anyLocalAddress. Thus anyLocalAddress is null and that
      is why the exception occurrs.

      % java udpServer -d -v -l 0

      VERBOSE: port number is = 26000
      VERBOSE: loop count is = 0
      DEBUG: creating datagram socket on port 26000
      AEF: Here in DatagramSocket(int port, InetAddress laddr)
      AEF: Here in create(int port, InetAddress laddr)
      AEF: laddr = null
      AEF: InetAddress.anyLocalAddress == null (BIG PROBLEM)
      ERROR: udpServer.udpServer(): caught exception
      java.lang.NullPointerException: null Address
      java.lang.NullPointerException: null Address
      at java.net.DatagramSocket.create(DatagramSocket.java:144)
      at java.net.DatagramSocket.<init>(Compiled Code)
      at udpServer.<init>(Compiled Code)
      at udpServer.main(Compiled Code)
      FINALSTATUS:udpServer:EXIT_ERROR:2:Number of ERRORS:1:TEST INCOMPLETE

      When I run without the JIT it does get into the static initializer
      code in the file: InetAddress.java

      where it sets anyLocalAddress. Thus anyLocalAddress is not null
      and the program works:

      % java -nojit udpServer -d -v -l 0

      VERBOSE: port number is = 26000
      VERBOSE: loop count is = 0
      DEBUG: creating datagram socket on port 26000
      AEF: Here in DatagramSocket(int port, InetAddress laddr)
      AEF: Here in create(int port, InetAddress laddr)
      AEF: laddr = null
      AEF: Here in static initializer in file: InetAddress.java
      AEF: anyLocalAddress = AEFPC /0.0.0.0
      DEBUG: DATAGRAM SOCKET INFO
      DEBUG: --------------------
      DEBUG: getLocalPort() = 26000
      DEBUG: getSoTimeout() = 0
      DEBUG: Dump getLocalAddress()
      DEBUG: INET ADDRESS INFO
      DEBUG: -----------------
      DEBUG: getHostName() = AEFPC
      DEBUG: getAllByName[0] = AEFPC /0.0.0.0
      DEBUG: getByName() = AEFPC /0.0.0.0
      DEBUG: getLocalHost() = aefpc.east.sun.com/129.148.27.249
      DEBUG: getHostAddress() = 0.0.0.0
      DEBUG: isMulticastAddress() = false


      The UDP program is added as an attachment:

            dviswanasunw Deepa Viswanathan (Inactive)
            aefreche Alan Frechette (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: