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

On Solaris 8 no BindException thrown if bind to IPv4 address whilst bound to ::

XMLWordPrintable

    • beta2
    • x86, sparc
    • solaris_8
    • Verified


      On Solaris 8 if we have to in6addr_any/X it's possible to bind a second
      socket to a specific IPv4 address on the same port X even when SO_REUSEADDR
      is not enabled -- ie: no BindException thrown in the following :-

      Socket s1 = new Socket();
      s1.bind( new InetSocketAddress(X) );

      Socket s2 = new Socket();
      s2.bind( new InetSocketAddress(InetAddress.getLocalHost(), X) );

      Similarly for the visa versa situation - if we are bound to a
      specific IPv4 address it's possible to bind to in6_addr_any for
      the same port without a BindException being thrown.

      This arises with Socket, DatagramSocket, and ServerSocket -
      see evaluation.

      alan.bateman@ireland 2001-03-19

      --

      The following test failed with not able to create DatagramTestServer instance when using jdk1.4-b52 on Solaris 8 (sparc/intel). The test passed on Sol 7 and 6 on Sparc and Intel.

      ****************************************************************************
      Failing Test:
      =============

      api/java_net/DatagramSocket/index.html#Ctor

      subtest

      DatagramSocket0003

      JCK :
      =====
      JCK1.3a

      Test source location:
      ====================

       /net/jdk/export/disk8/local.java/jck1.3a/JCK-runtime-13a/tests/api/java_net/DatagramSocket/CtorTests.java

      DatagramTestServer.java


      Platforms:
      =============
      Solaris 8 only sparc and intel.

      JDK, switches Info:
      ===================
      java version "1.4.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b52)
      Java HotSpot(TM) Client VM (build 1.4beta-B52, mixed mode)

      -client
      -client -Xint
      -client -Xcomp
      -server -Xint
      -server -Xcomp

      jtr file location:
      ==================
      file:/net/jtg-s120/export/home/jtg-test/JH_JDK14_b52_JCK13a_c1Xint/workDir/api/java_net/DatagramSocket/index_Ctor.jtr

      jtr also attached.

      How to reproduce:
      ====================
        Run the attached script:
            net_DatagramSocket_Ctor.ksh -client -Xcomp
                           " -client -Xint

      ---Script Start----
      #!/bin/ksh
      SWITCH=${1+$@}
      JDK=/net/jdk/export/disk8/local.java/jdk1.4.0
      TESTBASE=/net/jdk/export/disk8/local.java/jck1.3a
      JCK=${TESTBASE}/JCK-runtime-13a

      executeClass=javasoft.sqe.tests.api.java.net.DatagramSocket.CtorTests
      excludeCmd=
      executeClassArgs="-TestCaseID DatagramSocket0003"
      executeTestURL="-network.udpPortRange 1024-1100"
      executeContextArgs=

      case `uname -s` in
        SunOS)
         ARCH=`uname -p`
         case $ARCH in
          sparc)
            sharedJDK=$JDK/solsparc
            ;;
          i386)
            sharedJDK=$JDK/solx86
            ;;
         esac
         ;;
        Linux)
         sharedJDK=$JDK/linux-i386
         ARCH=linux
         ;;
      esac

      CLASSPATH=${JCK}/classes:${JCK}/javatest.jar
      DISPLAY=${DISPLAY-$HOST:0.0}

      if `echo $SWITCH|grep "\-d64" >/dev/null`; then
        LD_LIBRARY_PATH=${JCK}/lib/sparcv9
      else
        LD_LIBRARY_PATH=${JCK}/lib/${ARCH}
      fi

      PATH=$JDK/bin:$sharedJDK/bin:$PATH
      export PATH CLASSPATH DISPLAY LD_LIBRARY_PATH

      echo
      java ${SWITCH} -version
      echo
      java ${SWITCH} -verify -Xfuture -Djava.security.policy=${JCK}/lib/jck.policy -Djava.rmi.activation.port=javasoft.sqe.tests.api.java.net.DatagramSocket.CtorTests ${executeClass} ${excludeCmd} ${executeClassArgs} ${executeContextArgs} ${executeTestURL}
      ---script end---


      Test output:
      =============
      DatagramSocket0003: Failed. Failed: Can not create DatagramTestServer instance java.net.BindException: Address already in use
      STATUS:Failed.tests: 1; failed: 1; first test case failure: DatagramSocket0003



      Specific Machine Info:
      =====================
      Sparc:
      -------
      Release: 5.8
      Kernel architecture: sun4u
      Application architecture: sparc
      Hardware provider: Sun_Microsystems
      Domain: javasoft.eng.sun.com
      Kernel version: SunOS 5.8 Generic February 2000
      ===========
      Status of processor 0 as of: 02/21/01 17:40:44
        Processor has been on-line since 02/21/01 16:43:47.
        The sparcv9 processor operates at 360 MHz,
              and has a sparcv9 floating point processor.
      Status of processor 2 as of: 02/21/01 17:40:44
        Processor has been on-line since 02/21/01 16:43:47.
        The sparcv9 processor operates at 360 MHz,
              and has a sparcv9 floating point processor.
      ===========
                                 Solaris 8 s28_38shwp2 SPARC
                 Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.
                                  Assembled 21 January 2000
      ===========

      Intel:
      ------
      Hostname: jtg-i109
      Hostid: 1956cfe7
      Release: 5.8
      Kernel architecture: i86pc
      Application architecture: i386
      Hardware provider:
      Domain: javasoft.eng.sun.com
      Kernel version: SunOS 5.8 Generic February 2000
      ===========
      Status of processor 0 as of: 02/21/01 17:59:56
        Processor has been on-line since 01/17/01 13:51:24.
        The i386 processor operates at 613 MHz,
              and has an i387 compatible floating point processor.
      Status of processor 1 as of: 02/21/01 17:59:56
        Processor has been on-line since 01/17/01 13:51:28.
        The i386 processor operates at 613 MHz,
              and has an i387 compatible floating point processor.
      ===========
                                 Solaris 8 s28_38shwp2 INTEL
                 Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.
                                  Assembled 21 January 2000
      ===========



      Additional JCK related info:
      ============================
      URL to find JCK test owners: http://javaweb.eng/jck/usr/owners.jto




      takwing.cheung@Eng 2001-02-21

            alanb Alan Bateman
            tacheung Tak Wing Cheung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: