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

Socket read/write crash on 64-bit Solaris for buffer sizes > 2k

    XMLWordPrintable

Details

    • hopper
    • generic
    • generic
    • Verified

    Description


      I/O with byte arrays >2k cause us to crash on 64-bit.

      The problem has existed since the original 64-bit port but hasn't
      been reported by anyone yet. It's showing up now with a few of the
      regression tests because they use java.io.BufferedReader and
      BufferedReader depends on NIO charset classes which were re-designed
      and integrated at b82. The new NIO charset stream decoder uses
      a 8k byte array.

      The bug stems from us not including stdlib.h so we don't have
      the function prototypes for malloc/free. The result is that the
      wrong code is generated. The solution is simply to include
      stdlib.h.

      Here's an example crash :-



      An unexpected exception has been detected in native code outside the VM.
      Unexpected Signal : 11 occurred at PC=0xFFFFFFFF7EF49EF4
      Function=[Unknown. Nearest: free+0x70]
      Library=/usr/lib/sparcv9/libc.so.1

      Current Java thread:
              at java.net.SocketInputStream.socketRead0(Native Method)
              at java.net.SocketInputStream.read(SocketInputStream.java:119)
              at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:393)
              at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:429)
              at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:171)
              - locked <ffffffff32052140> (a java.io.InputStreamReader)
              at java.io.InputStreamReader.read(InputStreamReader.java:169)
              at java.io.BufferedReader.fill(BufferedReader.java:139)
              at java.io.BufferedReader.readLine(BufferedReader.java:302)
              - locked <ffffffff32052140> (a java.io.InputStreamReader)
              at java.io.BufferedReader.readLine(BufferedReader.java:365)
              at XServer.run(SetIfModifiedSince.java:32)

      Dynamic libraries:
      0x100000000 java
      0xffffffff7f200000 /usr/lib/64/libthread.so.1
      0xffffffff7f400000 /usr/lib/64/libdl.so.1
      0xffffffff7ef00000 /usr/lib/64/libc.so.1
      0xffffffff7ed00000 /usr/platform/SUNW,Ultra-2/lib/sparcv9/libc_psr.so.1
      0xffffffff7e000000 /export/Users/alanb/ws/merlin/build/solaris-sparcv9/lib/sparcv9/server/libjvm.so
      0xffffffff7e900000 /usr/lib/64/libCrun.so.1
      0xffffffff7de00000 /usr/lib/64/libsocket.so.1
      0xffffffff7db00000 /usr/lib/64/libnsl.so.1
      0xffffffff7d900000 /usr/lib/64/libm.so.1
      0xffffffff7eb00000 /usr/lib/64/libw.so.1
      0xffffffff7d600000 /usr/lib/64/libmp.so.2
      0xffffffff7d300000 /usr/lib/64/librt.so.1
      0xffffffff7d100000 /usr/lib/64/libaio.so.1
      0xffffffff7cf00000 /usr/lib/64/libmd5.so.1
      0xffffffff7cc00000 /usr/platform/SUNW,Ultra-2/lib/sparcv9/libmd5_psr.so.1
      0xffffffff7ca00000 /export/Users/alanb/ws/merlin/build/solaris-sparcv9/lib/sparcv9/native_threads/libhpi.so
      0xffffffff7c600000 /export/Users/alanb/ws/merlin/build/solaris-sparcv9/lib/sparcv9/libverify.so
      0xffffffff7c400000 /export/Users/alanb/ws/merlin/build/solaris-sparcv9/lib/sparcv9/libjava.so
      0xffffffff7c100000 /export/Users/alanb/ws/merlin/build/solaris-sparcv9/lib/sparcv9/libzip.so
      0xffffffff30c00000 /export/Users/alanb/ws/merlin/build/solaris-sparcv9/lib/sparcv9/libnet.so
      0xffffffff30700000 /usr/lib/64/nss_files.so.1

      Attachments

        Activity

          People

            alanb Alan Bateman
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: