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

java.nio.MappedByteBuffer.get() crashes VM

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.4.0
    • 1.4.0
    • core-libs
    • beta
    • sparc
    • solaris_7
    • Verified

      Fails for both client and server VM on Solaris and Linux.

      Works OK on Window NT.

      Merlin Beta build B-58.

      ------- part of test code -------------
      byte[] dstData ;
      long fileLength ;
      FileChannel fc ;
      MappedByteBuffer b ;
      String fileName = "test.data" ;

      byte[] srcData = Helper.getRandomByteArray(MIN_DATA_SIZE, MAX_DATA_SIZE);

      try {
      // get filechannel for the file.
      fc = Helper.openRWFileChannel(fileName) ;
      // write out data to the file channel
      fc.write(ByteBuffer.wrap(srcData));
      // map first half of the file to the buffer
      int mapSize = srcData.length/2 ;
      b = fc.map(FileChannel.MAP_RW, 0, mapSize);
      System.out.println("MappedByteBuffer = " + b );

      byte val = b.get(); // <<<< crash

      } catch (Exception e) {
      return TestHelper.testFail(testName + " FAIL: Unexpected Exception", e);

      }


      --------- results -------------------
      % java -server FCmap
      MappedByteBuffer = java.nio.DirectByteBuffer[pos=0 lim=3535 cap=3535]

      Unexpected Signal : 11 occurred at PC=0xEE6B3688
      Function=JNI_CreateJavaVM+0x18C84
      Library=/net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/server/libjvm.so

      Current Java thread:
              at sun.misc.Unsafe.getByte(Native Method)
              at java.nio.DirectByteBuffer.get(DirectByteBuffer.java:132)
              at FCmap.MBBTest02(FCmap.java:207)
              at FCmap.go(FCmap.java:81)
              at FCmap.main(FCmap.java:54)

      Dynamic libraries:
      0x10000 /usr/local/java/jdk1.4/solsparc/bin/../bin/sparc/native_threads/java
      0xef770000 /usr/lib/libthread.so.1
      0xef7b0000 /usr/lib/libdl.so.1
      0xef680000 /usr/lib/libc.so.1
      0xef750000 /usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1
      0xee400000 /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/server/libjvm.so
      0xef630000 /usr/lib/libCrun.so.1
      0xef600000 /usr/lib/libsocket.so.1
      0xef500000 /usr/lib/libnsl.so.1
      0xef5d0000 /usr/lib/libm.so.1
      0xef660000 /usr/lib/libw.so.1
      0xef5a0000 /usr/lib/libmp.so.2
      0xef4d0000 /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/native_threads/libhpi.so
      0xef490000 /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/libverify.so
      0xef450000 /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/libjava.so
      0xef430000 /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/libzip.so
      0xee990000 /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/libnio.so
      0xee970000 /usr/lib/libposix4.so.1
      0xecfd0000 /usr/local/java/jdk1.4/solsparc/bin/../jre/lib/sparc/libnet.so
      0xecce0000 /usr/lib/libaio.so.1

      Local Time = Fri Mar 30 14:12:49 2001
      Elapsed Time = 1
      #
      # HotSpot Virtual Machine Error : 11
      # Error ID : 4F530E43505002D9 01
      # Please report this error at
      # http://java.sun.com/cgi-bin/bugreport.cgi
      #
      # Java VM: Java HotSpot(TM) Server VM (1.4.0-beta-b58 mixed mode)
      #
      # An error report file has been saved as hs_err_pid21387.log.
      # Please refer to the file for further information.
      #
      Abort (core dumped)
      ----------------------------------------

            mmcclosksunw Michael Mccloskey (Inactive)
            hvilekar Harshad Vilekar (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: