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

cpCacheOop.cpp:215 : Error: ShouldNotReachHere()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Incomplete
    • Affects Version/s: 7u40
    • Fix Version/s: None
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      windows_7

      Description

      FULL PRODUCT VERSION :
      java version "1.7.0_40"
      Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
      Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)

      FULL OS VERSION :
      Microsoft Windows [Version 6.1.7600]

      A DESCRIPTION OF THE PROBLEM :
      I consistently reach to ShouldNotReachHere() error, which is a severe issue. Even if I do something wrong with AsynchronousFileChannel synchronization, there should be a proper error message to identify whereis the problem.

      THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Yes

      THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the attached source class a couple of times - the error will appear one per 5 to 10 executions on my Windows 7 64 platform.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      I expect no error to appear in this scenario.
      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (cpCacheOop.cpp:215), pid=6188, tid=2740
      # Error: ShouldNotReachHere()
      #
      # JRE version: Java(TM) SE Runtime Environment (7.0_40-b43) (build 1.7.0_40-b43)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (24.0-b56 mixed mode windows-amd64 compressed oops)
      # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
      #
      # An error report file with more information is saved as:
      # C:\Users\mort\workspace\org.msn.test.db\hs_err_pid6188.log
      #
      # If you would like to submit a bug report, please visit:
      # http://bugreport.sun.com/bugreport/crash.jsp

      CONTENT OF C:\Users\mort\workspace\org.msn.test.db\hs_err_pid6188.log:

      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (cpCacheOop.cpp:215), pid=6188, tid=2740
      # Error: ShouldNotReachHere()
      #
      # JRE version: Java(TM) SE Runtime Environment (7.0_40-b43) (build 1.7.0_40-b43)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (24.0-b56 mixed mode windows-amd64 compressed oops)
      # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
      #
      # If you would like to submit a bug report, please visit:
      # http://bugreport.sun.com/bugreport/crash.jsp
      #

      --------------- T H R E A D ---------------

      Current thread (0x000000000035e800): JavaThread "main" [_thread_in_vm, id=2740, stack(0x0000000002240000,0x0000000002340000)]

      Stack: [0x0000000002240000,0x0000000002340000]
      Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
      j sun.nio.ch.WindowsAsynchronousFileChannelImpl.tryLock(JJZ)Ljava/nio/channels/FileLock;+133
      j java.nio.channels.AsynchronousFileChannel.tryLock()Ljava/nio/channels/FileLock;+6
      j org.msn.org.msn.test.db.files.DataWriter.<init>(Ljava/nio/file/Path;)V+33
      j org.msn.org.msn.test.db.files.DataWriter.main([Ljava/lang/String;)V+19
      v ~StubRoutines::call_stub

      --------------- P R O C E S S ---------------

      Java Threads: ( => current thread )
        0x000000000be48800 JavaThread "Thread-8" daemon [_thread_in_native, id=7092, stack(0x000000000ea30000,0x000000000eb30000)]
        0x000000000be47800 JavaThread "Thread-7" daemon [_thread_in_native, id=716, stack(0x000000000e7d0000,0x000000000e8d0000)]
        0x000000000be3f000 JavaThread "Thread-6" daemon [_thread_in_native, id=732, stack(0x000000000e580000,0x000000000e680000)]
        0x000000000be3e000 JavaThread "Thread-5" daemon [_thread_in_native, id=7500, stack(0x000000000e050000,0x000000000e150000)]
        0x000000000be3d000 JavaThread "Thread-4" daemon [_thread_in_native, id=6836, stack(0x000000000e360000,0x000000000e460000)]
        0x000000000be3c800 JavaThread "Thread-3" daemon [_thread_in_native, id=7940, stack(0x000000000e1f0000,0x000000000e2f0000)]
        0x000000000be3b800 JavaThread "Thread-2" daemon [_thread_in_native, id=6076, stack(0x000000000d740000,0x000000000d840000)]
        0x000000000be39000 JavaThread "Thread-1" daemon [_thread_in_native, id=6544, stack(0x000000000df20000,0x000000000e020000)]
        0x000000000be38000 JavaThread "Thread-0" daemon [_thread_in_native, id=8008, stack(0x000000000de20000,0x000000000df20000)]
        0x000000000ad5e800 JavaThread "Service Thread" daemon [_thread_blocked, id=6564, stack(0x000000000d850000,0x000000000d950000)]
        0x000000000ad59000 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=6912, stack(0x000000000d5e0000,0x000000000d6e0000)]
        0x000000000ad52000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=6772, stack(0x000000000d420000,0x000000000d520000)]
        0x000000000ad50800 JavaThread "Attach Listener" daemon [_thread_blocked, id=7728, stack(0x000000000cec0000,0x000000000cfc0000)]
        0x000000000ad4f800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=7236, stack(0x000000000d300000,0x000000000d400000)]
        0x000000000221c800 JavaThread "Finalizer" daemon [_thread_blocked, id=5392, stack(0x000000000d1b0000,0x000000000d2b0000)]
        0x0000000002216000 JavaThread "Reference Handler" daemon [_thread_blocked, id=5956, stack(0x000000000d090000,0x000000000d190000)]
      =>0x000000000035e800 JavaThread "main" [_thread_in_vm, id=2740, stack(0x0000000002240000,0x0000000002340000)]

      Other Threads:
        0x000000000ad3e800 VMThread [stack: 0x000000000cdc0000,0x000000000cec0000] [id=6552]
        0x000000000ad5f000 WatcherThread [stack: 0x000000000da00000,0x000000000db00000] [id=8112]

      VM state:not at safepoint (normal execution)

      VM Mutex/Monitor currently owned by a thread: None

      Heap
       PSYoungGen total 37376K, used 6452K [0x00000007d6c00000, 0x00000007d9580000, 0x0000000800000000)
        eden space 32256K, 20% used [0x00000007d6c00000,0x00000007d724d190,0x00000007d8b80000)
        from space 5120K, 0% used [0x00000007d9080000,0x00000007d9080000,0x00000007d9580000)
        to space 5120K, 0% used [0x00000007d8b80000,0x00000007d8b80000,0x00000007d9080000)
       ParOldGen total 84480K, used 0K [0x0000000784400000, 0x0000000789680000, 0x00000007d6c00000)
        object space 84480K, 0% used [0x0000000784400000,0x0000000784400000,0x0000000789680000)
       PSPermGen total 21504K, used 3007K [0x000000077f200000, 0x0000000780700000, 0x0000000784400000)
        object space 21504K, 13% used [0x000000077f200000,0x000000077f4effe8,0x0000000780700000)

      Card table byte_map: [0x0000000005490000,0x00000000058a0000] byte_map_base: 0x0000000001897000

      Polling page: 0x0000000000330000

      Code Cache [0x0000000002490000, 0x0000000002700000, 0x0000000005490000)
       total_blobs=200 nmethods=0 adapters=169 free_code_cache=48756Kb largest_free_block=49926528

      Compilation events (0 events):
      No events

      GC Heap History (0 events):
      No events

      Deoptimization events (0 events):
      No events

      Internal exceptions (2 events):
      Event: 0.017 Thread 0x000000000035e800 Threw 0x00000007d6c0be78 at C:\jdk7u2_64p\jdk7u40\hotspot\src\share\vm\prims\jni.cpp:3991
      Event: 0.039 Thread 0x000000000035e800 Threw 0x00000007d6c52d48 at C:\jdk7u2_64p\jdk7u40\hotspot\src\share\vm\prims\jvm.cpp:1244

      Events (10 events):
      Event: 0.054 loading class 0x000000000be2a0a0
      Event: 0.054 loading class 0x000000000be2a0a0 done
      Event: 0.054 loading class 0x000000000be2a290
      Event: 0.054 loading class 0x000000000be2a290 done
      Event: 0.054 loading class 0x000000000be16da0
      Event: 0.054 loading class 0x000000000be21870
      Event: 0.054 loading class 0x000000000be21870 done
      Event: 0.054 loading class 0x000000000be16da0 done
      Event: 0.054 loading class 0x000000000be2a2b0
      Event: 0.054 loading class 0x000000000be2a2b0 done


      Dynamic libraries:
      0x000000013f3a0000 - 0x000000013f3d3000 C:\Program Files\Java\jre7\bin\javaw.exe
      0x0000000077b70000 - 0x0000000077d1c000 C:\Windows\SYSTEM32\ntdll.dll
      0x0000000077590000 - 0x00000000776af000 C:\Windows\system32\kernel32.dll
      0x000007fefe090000 - 0x000007fefe0fc000 C:\Windows\system32\KERNELBASE.dll
      0x000007fefecb0000 - 0x000007fefed8b000 C:\Windows\system32\ADVAPI32.dll
      0x000007fefe710000 - 0x000007fefe7af000 C:\Windows\system32\msvcrt.dll
      0x000007fefe6f0000 - 0x000007fefe70f000 C:\Windows\SYSTEM32\sechost.dll
      0x000007fefe3b0000 - 0x000007fefe4de000 C:\Windows\system32\RPCRT4.dll
      0x0000000077490000 - 0x000000007758a000 C:\Windows\system32\USER32.dll
      0x000007fefe4f0000 - 0x000007fefe557000 C:\Windows\system32\GDI32.dll
      0x000007fefe640000 - 0x000007fefe64e000 C:\Windows\system32\LPK.dll
      0x000007fefe9b0000 - 0x000007fefea7a000 C:\Windows\system32\USP10.dll
      0x000007fefc670000 - 0x000007fefc864000 C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7600.16661_none_fa62ad231704eab7\COMCTL32.dll
      0x000007feffdb0000 - 0x000007feffe21000 C:\Windows\system32\SHLWAPI.dll
      0x000007fefea80000 - 0x000007fefeaae000 C:\Windows\system32\IMM32.DLL
      0x000007fefeab0000 - 0x000007fefebb9000 C:\Windows\system32\MSCTF.dll
      0x0000000066400000 - 0x00000000664d1000 C:\Program Files\Java\jre7\bin\msvcr100.dll
      0x0000000062620000 - 0x0000000062de9000 C:\Program Files\Java\jre7\bin\server\jvm.dll
      0x000007fef9700000 - 0x000007fef9709000 C:\Windows\system32\WSOCK32.dll
      0x000007fefec60000 - 0x000007fefecad000 C:\Windows\system32\WS2_32.dll
      0x000007fefe4e0000 - 0x000007fefe4e8000 C:\Windows\system32\NSI.dll
      0x000007fefbda0000 - 0x000007fefbddb000 C:\Windows\system32\WINMM.dll
      0x0000000077d30000 - 0x0000000077d37000 C:\Windows\system32\PSAPI.DLL
      0x000000006ec60000 - 0x000000006ec6f000 C:\Program Files\Java\jre7\bin\verify.dll
      0x000000006d710000 - 0x000000006d738000 C:\Program Files\Java\jre7\bin\java.dll
      0x000000006cb30000 - 0x000000006cb45000 C:\Program Files\Java\jre7\bin\zip.dll
      0x000000006cb10000 - 0x000000006cb29000 C:\Program Files\Java\jre7\bin\net.dll
      0x000007fefd850000 - 0x000007fefd8a4000 C:\Windows\system32\mswsock.dll
      0x000007fefd840000 - 0x000007fefd847000 C:\Windows\System32\wship6.dll
      0x000000006caf0000 - 0x000000006cb01000 C:\Program Files\Java\jre7\bin\nio.dll

      VM Arguments:
      jvm_args: -Dfile.encoding=UTF-8
      java_command: org.msn.org.msn.test.db.files.DataWriter
      Launcher Type: SUN_STANDARD

      Environment Variables:
      JAVA_HOME=C:\Program Files\Java\jdk1.7.0_40
      PATH=C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x64;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\TortoiseSVN\bin;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Java\jdk1.7.0_40\bin;C:\javautils\apache-maven-3.1.1\bin
      USERNAME=mort
      OS=Windows_NT
      PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 60 Stepping 3, GenuineIntel



      --------------- S Y S T E M ---------------

      OS: Windows 7 , 64 bit Build 7600

      CPU:total 8 (4 cores per cpu, 2 threads per core) family 6 model 60 stepping 3, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, aes, erms, ht, tsc, tscinvbit

      Memory: 4k page, physical 8106352k(3880164k free), swap 16210796k(10785436k free)

      vm_info: Java HotSpot(TM) 64-Bit Server VM (24.0-b56) for windows-amd64 JRE (1.7.0_40-b43), built on Aug 26 2013 22:38:32 by "java_re" with unknown MS VC++:1600

      time: Sun May 04 00:30:07 2014
      elapsed time: 0 seconds



      REPRODUCIBILITY :
      This bug can be reproduced often.

      ---------- BEGIN SOURCE ----------
      package org.msn.org.msn.test.db.files;

      import java.io.IOException;
      import java.nio.ByteBuffer;
      import java.nio.channels.AsynchronousFileChannel;
      import java.nio.channels.FileLock;
      import java.nio.file.Path;
      import java.nio.file.Paths;
      import java.nio.file.StandardOpenOption;
      import java.util.concurrent.ExecutionException;
      import java.util.concurrent.ExecutorService;
      import java.util.concurrent.Executors;
      import java.util.concurrent.Future;
      import java.util.concurrent.TimeUnit;
      import java.util.concurrent.TimeoutException;

      public class DataWriter implements AutoCloseable {

      private final AsynchronousFileChannel file;

      private final FileLock lock;

      private volatile long size;

      public DataWriter(Path filePath) throws IOException {

      file = AsynchronousFileChannel.open(filePath,
      StandardOpenOption.CREATE, StandardOpenOption.WRITE);

      lock = file.tryLock();

      size = file.size();
      }

      public long appendData(byte[] data) throws InterruptedException,
      ExecutionException, TimeoutException {

      long resultID = -1;

      long oldSize = size;

      size += data.length;

      if (writeToFile(data, oldSize)) {

      resultID = oldSize;
      }

      return resultID;
      }

      private boolean writeToFile(byte[] data, long position)
      throws InterruptedException, ExecutionException, TimeoutException {

      ByteBuffer buffer = ByteBuffer.allocate(data.length);
      buffer.clear();
      buffer.put(data);
      buffer.rewind();

      Future<Integer> future = file.write(buffer, position);

      int bytesWriten = future.get(Long.MAX_VALUE, TimeUnit.MILLISECONDS);

      if (bytesWriten < data.length) {

      return false;
      }

      return true;
      }

      public void close() throws IOException {

      lock.release();

      file.close();
      }

      public static void main(String[] args) {

      Path file = Paths.get("test.dat");

      try (DataWriter writer = new DataWriter(file)) {

      byte[] data = "A VERY STRANGE TEST GOING ON HERE!\n".getBytes();

      ExecutorService executionService = Executors.newFixedThreadPool(16);

      for (int i = 0; i < 64; i++) {

      executionService.execute(new DataAppender(writer, data));
      }

      executionService.shutdown();

      executionService.awaitTermination(Long.MAX_VALUE,
      TimeUnit.MILLISECONDS);
      } catch (IOException e) {
      e.printStackTrace();
      } catch (InterruptedException e) {
      e.printStackTrace();
      }
      }

      public static class DataAppender implements Runnable {

      private static int count = 1;

      private DataWriter writer;

      private byte[] data;

      public DataAppender(DataWriter writer, byte[] data) {

      this.writer = writer;

      this.data = data;
      }

      public void run() {

      try {

      long id = writer.appendData(data);

      System.out.println("\nWriting: " + count++ + ";\tPosition: " + id);

      } catch (InterruptedException e) {
      e.printStackTrace();
      } catch (ExecutionException e) {
      e.printStackTrace();
      } catch (TimeoutException e) {
      e.printStackTrace();
      }
      }
      }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Don't know of any possible workaround for now. To make progress with my task I need to think of possible re-design of the solution.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: