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

HPROF: run with option "net" does not close socket correctly on win2k

XMLWordPrintable

    • mantis
    • x86
    • windows_2000
    • Verified

          96 1 14 [B
        213 0.01% 98.01% 96 2 96 2 69 [S
        214 0.01% 98.02% 96 1 96 1 98 [B
        215 0.01% 98.03% 96 3 96 3 263 [I
        216 0.01% 98.04% 96 4 96 4 167 java.lang.String
        217 0.01% 98.05% 96 4 96 4 168 java.lang.String
        218 0.01% 98.06% 96 4 96 4 30 java.lang.String
      SITES END
      $
      -----------------------------------------------------------------------

      There is also another problem which prevents the test from pass on
      Solaris. It is described in the bug 4631952.

      The test net001 will be available in the releases v14r12, v131r12
      of testbase_nsk.
      ======================================================================

      Name: egR10015 Date: 02/10/2002


      This bug affects also the following test from testbase_nsk:

      nsk/hprof/options/net/net003

      ======================================================================


      Name: egR10015 Date: 02/05/2002



      Hprof agent shipped with HotSpot 1.4.0-b92 fails to pass the following test

      nsk/hprof/options/net/net001

      from testbase_nsk on Windows 2000. The test performs check that Hprof
      will send profiling data over a socket to a server, specified by the
      option "net". But Hprof or underlying network support closes the socket
      abruptly during the profiling data receiving. All subsequent attempts
      of the server to read the socket through the Java method InputStream.read()
      fail with the following exception:

      SocketException: Connection reset by peer: JVM_recv in socket input stream read

      and as result the profiling data is incomplete.

      Note that this bug is only on Windows and only when the client and the
      server are on the same computer (localhost) and/or both of them run on
      Windows. The problems also remains when profiled VM and the server are
      run on Windows as two separate programs mutually independent from each
      other.

      The test consists of the following files.
      net001.java contains a main class which starts profiled VM in a separate
      process and a special thread collecting the data and writing it out to
      the file net001.hprof.out.
      net001p.java contains an auxiliary class used for profiling itself.

      ======================================================================
      To reproduce the bug run on Windows

      sh doit.sh $JAVA_HOME

      in
      /net/sqesvr.sfbay/export/vsn/GammaBase/Bugs/<this bug number>

      where JAVA_HOME should point to jdk1.4.0

      ---------------- output on Win2000 with HS 1.4.0-b92: -----------------
      $ sh doit.sh e:/hs_run/jdk/jdk140-b92
      Compiling support classes ...
      Note: share/Status.java uses or overrides a deprecated API.
      Note: Recompile with -deprecation for details.
      Compiling test classes ...
      java version "1.4.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

      Executing the test ...
      Output file name: O:\work\evaluation\GammaBase\bugdir\.\net001.hprof.out
      Waiting for Server's thread ...
      Server: started
      Starting the command: e:/hs_run/jdk/jdk140-b92/bin/java -Xrunhprof:net=localhost
      :3331 net001p
      Server: listening to the following address: localhost:3331

      Starting potential timed out section:
              waiting 2 minute(s) for profiled VM exit ...

      Server: socket: Socket[addr=/127.0.0.1,port=3332,localport=3331] accepted
      Server: read 1974 bytes from socket input stream
      Server: read 1997 bytes from socket input stream
      Server: read 4035 bytes from socket input stream
      Server: read 4033 bytes from socket input stream
      Server: read 4038 bytes from socket input stream
      Server: read 2036 bytes from socket input stream
      Server: read 3736 bytes from socket input stream
      Server: read 3736 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 3696 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 2123 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 4269 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 1332 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 3497 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 2160 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 2590 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 2119 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 2745 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 2133 bytes from socket input stream
      Server: read 3736 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 3879 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      profiled VM stderr: Dumping Java heap ... allocation sites ... done.
      Server: read 2151 bytes from socket input stream
      Server: read 3736 bytes from socket input stream
      Server: read 3736 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      # ERROR: TEST FAILURE: Server: caught java.net.SocketException: Connection reset
       by peer: JVM_recv in socket input stream read
      Server: sleeping for 1 second(s) ...
      # ERROR: TEST FAILURE: Server: caught java.net.SocketException: Connection reset
       by peer: JVM_recv in socket input stream read
      Server: sleeping for 1 second(s) ...
      # ERROR: TEST FAILURE: Server: caught java.net.SocketException: Connection reset
       by peer: JVM_recv in socket input stream read
      Server: sleeping for 1 second(s) ...
      # ERROR: TEST FAILURE: Server: caught java.net.SocketException: Connection reset
       by peer: JVM_recv in socket input stream read
      Server: sleeping for 1 second(s) ...
      # ERROR: TEST FAILURE: Server: caught java.net.SocketException: Connection reset
       by peer: JVM_recv in socket input stream read
      Server: sleeping for 1 second(s) ...
      # ERROR: TEST FAILURE: Server: caught java.net.SocketException: Connection reset
       by peer: JVM_recv in socket input stream read
      # ERROR:
      # ERROR: TEST FAILED: Server: unable to read socket input stream after 5 tries
      # ERROR: Connection with profilied VM has been lost

      Server: finished

      Potential timed out section successfully passed

      Profiled VM: exit code = 95


      #>
      #> SUMMARY: Following errors occured
      #> during test execution:
      #>
      # ERROR: TEST FAILURE: Server: caught java.net.SocketException: Connection reset
       by peer: JVM_recv in socket input stream read
      # ERROR: TEST FAILURE: Server: caught java.net.SocketException: Connection reset
       by peer: JVM_recv in socket input stream read
      # ERROR: TEST FAILURE: Server: caught java.net.SocketException: Connection reset
       by peer: JVM_recv in socket input stream read
      # ERROR: TEST FAILURE: Server: caught java.net.SocketException: Connection reset
       by peer: JVM_recv in socket input stream read
      # ERROR: TEST FAILURE: Server: caught java.net.SocketException: Connection reset
       by peer: JVM_recv in socket input stream read
      # ERROR: TEST FAILURE: Server: caught java.net.SocketException: Connection reset
       by peer: JVM_recv in socket input stream read
      # ERROR:
      # ERROR: TEST FAILED: Server: unable to read socket input stream after 5 tries
      # ERROR: Connection with profilied VM has been lost
      exit code = 97

      $ tail net001.hprof.out
         93 0.02% 96.37% 224 7 224 7 1 java.lang.ref.SoftReference

         94 0.02% 96.39% 224 4 224 4 131 java.util.Hashtable$Entry
         95 0.02% 96.42% 224 4 224 4 16 java.net.URL
         96 0.02% 96.44% 224 4 224 4 133 java.lang.Object
         97 0.02% 96.47% 224 4 224 4 242 [I
         98 0.02% 96.49% 224 4 224 4 19 [C
         99 0.02% 96.51% 224 14 224 14 101 java.util.jar.Attributes$Na
      me
        100 0.02% 96.54% 216 9 216 9 1 java.util.logging.Level
        101 0.02% 96.56% 216 1 216 1 66 [B
        102 0.02% 96.58% 208 2 208 2 73 [B
        103 0.02% 96.60% 208 1
      $
      -----------------------------------------------------------------------

      ----------------- output on Linux with HS 1.4.0-b92: ------------------
      $ sh doit.sh ~/hotspot/jdk1.4/linux
      Compiling support classes ...
      Note: share/Status.java uses or overrides a deprecated API.
      Note: Recompile with -deprecation for details.
      Compiling test classes ...
      java version "1.4.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

      Executing the test ...
      Output file name: /export/ld24/java/eug/evaluation/GammaBase/bugdir/./net001.hprof.out
      Server: started
      Waiting for Server's thread ...
      Server: listening to the following address: localhost:2468
      Starting the command: /home/eug/hotspot/jdk1.4/linux/bin/java -Xrunhprof:net=localhost:2468 net001p

      Starting potential timed out section:
              waiting 2 minute(s) for profiled VM exit ...

      Server: socket: Socket[addr=/127.0.0.1,port=2469,localport=2468] accepted
      Server: read 1974 bytes from socket input stream
      Server: read 2043 bytes from socket input stream
      Server: read 2028 bytes from socket input stream
      Server: read 2035 bytes from socket input stream
      Server: read 1987 bytes from socket input stream
      Server: read 2035 bytes from socket input stream
      Server: read 2031 bytes from socket input stream
      Server: read 2020 bytes from socket input stream
      Server: read 2031 bytes from socket input stream
      Server: read 2027 bytes from socket input stream
      Server: read 2004 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      profiled VM stderr: Dumping Java heap ... allocation sites ... done.
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 5000 bytes from socket input stream
      Server: read 473 bytes from socket input stream
      Server: read EOF from socket input stream: -1
      Server: finished

      Potential timed out section successfully passed

      Profiled VM: exit code = 95
      exit code = 95

      $ tail net001.hprof.out
        210 0.01% 97.98% 96 1 96 1 211 java.lang.Object
        211 0.01% 97.99% 96 1 96 1 263 [B
        212 0.01% 98.00% 96 1

            dcubed Daniel Daugherty
            eugsunw Eug Eug (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: