JVM BUG: Internal Error (classFileParser.cpp:3161), pid=1116, tid=3912 Error: ShouldNotReachHere()

涉及到线程安全的部分出现了JVM BUG——不解,Eclipse返回的信息如下,

#

# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (classFileParser.cpp:3161), pid=1116, tid=3912
#  Error: ShouldNotReachHere()
#
# JRE version: 6.0_21-b07
# Java VM: Java HotSpot(TM) Client VM (17.0-b17 mixed mode windows-x86 )
# An error report file with more information is saved as:

# D:\user\workspace\MultiThread\hs_err_pid1116.log

MultiThread\hs_err_pid1116.log的内容:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (classFileParser.cpp:3161), pid=1116, tid=3912
#  Error: ShouldNotReachHere()
#
# JRE version: 6.0_21-b07
# Java VM: Java HotSpot(TM) Client VM (17.0-b17 mixed mode windows-x86 )
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

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

Current thread (0x01ad9000):  JavaThread "Unknown thread" [_thread_in_vm, id=3912, stack(0x00260000,0x002b0000)]

Stack: [0x00260000,0x002b0000],  sp=0x002af880,  free space=13e002af890k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [jvm.dll+0x1fd090]
V  [jvm.dll+0xa47c9]
V  [jvm.dll+0x75f01]
V  [jvm.dll+0x775a4]
V  [jvm.dll+0x1cbcb5]
V  [jvm.dll+0x1cc3ed]
V  [jvm.dll+0x1cc7a5]
V  [jvm.dll+0x1cc7eb]
V  [jvm.dll+0x1cc912]
V  [jvm.dll+0x1cc98a]
V  [jvm.dll+0x1cce3d]
V  [jvm.dll+0x1cd252]
V  [jvm.dll+0x1eceb3]
V  [jvm.dll+0x1ed28c]
V  [jvm.dll+0xdb721]
V  [jvm.dll+0x1e6618]
V  [jvm.dll+0x1065d0]
C  [javaw.exe+0x1657]
C  [javaw.exe+0x1e2c]
C  [javaw.exe+0x8614]
C  [kernel32.dll+0x4ed6c]
C  [ntdll.dll+0x6377b]
C  [ntdll.dll+0x6374e]

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

Java Threads: ( => current thread )

Other Threads:

=>0x01ad9000 (exited) JavaThread "Unknown thread" [_thread_in_vm, id=3912, stack(0x00260000,0x002b0000)]

VM state:not at safepoint (not fully initialized)

VM Mutex/Monitor currently owned by a thread: None

Dynamic libraries:
0x00400000 - 0x00424000 C:\Program Files\Java\jdk1.6.0_21\bin\javaw.exe
0x775f0000 - 0x7772c000 C:\Windows\SYSTEM32\ntdll.dll
0x76bd0000 - 0x76ca4000 C:\Windows\system32\kernel32.dll
0x75860000 - 0x758aa000 C:\Windows\system32\KERNELBASE.dll
0x77430000 - 0x774d0000 C:\Windows\system32\ADVAPI32.dll
0x76d90000 - 0x76e3c000 C:\Windows\system32\msvcrt.dll
0x75c20000 - 0x75c39000 C:\Windows\SYSTEM32\sechost.dll
0x75a80000 - 0x75b21000 C:\Windows\system32\RPCRT4.dll
0x77360000 - 0x77429000 C:\Windows\system32\USER32.dll
0x75da0000 - 0x75dee000 C:\Windows\system32\GDI32.dll
0x777b0000 - 0x777ba000 C:\Windows\system32\LPK.dll
0x772c0000 - 0x7735d000 C:\Windows\system32\USP10.dll
0x77760000 - 0x7777f000 C:\Windows\system32\IMM32.DLL
0x75df0000 - 0x75ebc000 C:\Windows\system32\MSCTF.dll
0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_21\jre\bin\msvcr71.dll
0x6d8b0000 - 0x6db57000 C:\Program Files\Java\jdk1.6.0_21\jre\bin\client\jvm.dll
0x73c80000 - 0x73cb2000 C:\Windows\system32\WINMM.dll
0x756b0000 - 0x756fc000 C:\Windows\system32\apphelp.dll
0x6d860000 - 0x6d86c000 C:\Program Files\Java\jdk1.6.0_21\jre\bin\verify.dll
0x6d3e0000 - 0x6d3ff000 C:\Program Files\Java\jdk1.6.0_21\jre\bin\java.dll
0x6d340000 - 0x6d348000 C:\Program Files\Java\jdk1.6.0_21\jre\bin\hpi.dll
0x77750000 - 0x77755000 C:\Windows\system32\PSAPI.DLL
0x6d8a0000 - 0x6d8af000 C:\Program Files\Java\jdk1.6.0_21\jre\bin\zip.dll

VM Arguments:
jvm_args: -Dfile.encoding=UTF-8 -Xbootclasspath:C:\Program Files\Android\android-sdk\platforms\android-14\android.jar 
java_command: com.gogler.MultiThread.ThreadSafeDemo
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=C:\Program Files\Java\jdk1.6.0_21
CLASSPATH=.;C:\Program Files\Java\jdk1.6.0_21\lib\tools.jar;C:\Program Files\Java\jdk1.6.0_21\lib\dt.jar;C:\Program Files\Java\jdk1.6.0_21\bin;
PATH=C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:/Program Files/Java/jre6/lib/i386;C:\Program Files\Common Files\NetSarang;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\Program
Files\TortoiseSVN\bin;C:\Program Files\Java\jdk1.6.0_21\bin;F:\android-sdk-windows\android-sdk-windows\tools;F:\android-sdk-windows\android-sdk-windows\platform-tools;d:\Program Files\DBank\ClickUp;C:\Users\Administrator\Downloads\eclipse-SDK-3.7-win32\eclipse;
USERNAME=Administrator
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 6 Model 23 Stepping 10, GenuineIntel

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

OS: Windows 7 Build 7601 Service Pack 1

CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 23 stepping 10, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3

Memory: 4k page, physical 3634232k(2249368k free), swap 7266708k(5328364k free)

vm_info: Java HotSpot(TM) Client VM (17.0-b17) for windows-x86 JRE (1.6.0_21-b07), built on Jul 17 2010 01:10:15 by "java_re" with MS VC++ 7.1 (VS2003)

time: Sat Apr 28 17:11:19 2012
elapsed time: 0 seconds

执行的代码:

package com.gogler.MultiThread;
//Java语言: ArrayList的线程安全与不安全对比演示
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;

public class ThreadSafeDemo {

    public static int demo(final List list, final int testCount) throws InterruptedException {
        ThreadGroup group = new ThreadGroup(list.getClass().getName() + "@" + list.hashCode());
        final Random rand = new Random(); 

        Runnable listAppender = new Runnable() {
            public void run() {
                try {
                    Thread.sleep(rand.nextInt(2));
                } catch (InterruptedException e) {
                    return;
                }
                list.add("0");
            }
        }; 

        for (int i = 0; i < testCount; i++) {
            new Thread(group, listAppender, "InsertList-" + i).start();
        }

        while (group.activeCount() > 0) {
            Thread.sleep(10);
        }

        return list.size();
    }
    public static void main(String[] args) throws InterruptedException {
        List unsafeList = new ArrayList();
        List safeList = Collections.synchronizedList(new ArrayList());
        final int N = 10000;
        for (int i = 0; i < 10; i++) {
            unsafeList.clear();
            safeList.clear();
            int unsafeSize = demo(unsafeList, N);
            int safeSize = demo(safeList, N);
            System.out.println("unsafe/safe: " + unsafeSize + "/" + safeSize);
        }
    }
}
时间: 2024-10-11 00:57:34

JVM BUG: Internal Error (classFileParser.cpp:3161), pid=1116, tid=3912 Error: ShouldNotReachHere()的相关文章

DBCC CHECKDB 遭遇Operating system error 112(failed to retrieve text for this error. Reason: 15105) encountered

我们一个SQL Server服务器在执行YourSQLDBa的作业YourSQLDba_FullBackups_And_Maintenance时遇到了错误:   Exec YourSQLDba.Maint.ShowHistoryErrors @JobNo = 1227 <row> <ctx>yMaint.IntegrityTesting</ctx> <Sql>DBCC checkDb('xxxx') </Sql> <err>In ca

JVM Bug:多个线程持有一把锁

JVM线程dump Bug描述 在JAVA语言中,当同步块(Synchronized)被多个线程并发访问时,JVM中会采用基于互斥实现的重量级锁.JVM最多只允许一个线程持有这把锁,如果其它线程想要获得这把锁就必须处于等待状态,也就是说在同步块被并发访问时,最多只会有一个处于RUNNABLE状态的线程持有某把锁,而另外的线程因为竞争不到这把锁而都处于BLOCKED状态.然而有些时候我们会发现处于BLOCKED状态的线程,它的最上面那一帧在打印其正在等待的锁对象时,居然也会出现-locked的信息

Dx 1 error; aborting;Conversion to Dalvik format failed with error 1

[2011-11-12 17:10:50 - Todo_list] Dx trouble processing "javax/net/ServerSocketFactory.class": Ill-advised or mistaken usage of a core class (java.* or javax.*) when not building a core library. This is often due to inadvertently including a cor

我的Android进阶之旅------&amp;gt;解决 Error: ShouldNotReachHere() 问题

在Android项目中创建一个包含main()方法的类,直接右键运行该类时会报如下错误: # # An unexpected error has been detected by Java Runtime Environment: # # Internal Error (classFileParser.cpp:2923), pid=7780, tid=7832 # Error: ShouldNotReachHere() # # Java VM: Java HotSpot(TM) Client V

[android]android自动化测试十之单元测试实例

android源代码中每个app下中都自带了一个test用例,下面主要介绍下camra单元测试用例  在AndroidManifest.xml中标明了测试用例instrumentation函数入口  Java代码 <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2008 The Android Open Source Project Licensed under the Apach

Android常见错误 整理收集

1.Unable to resolve target 'android-2' 安装低版本的api,再default.properties 这个文件中把target=android-2 改成 target=android-7终于就没有问题了. 2.Invalid start tag LinearLayout main.xml放错文件夹了,应该在\res\layout下. 3.INSTALL_FAILED_INSUFFICIENT_STORAGE 原因:SD卡内存容量不够 法一:在下图的"Addit

定时任务执行一段时间JVM会自动退出问题,急求大神帮忙。

问题描述 最近程序很不稳定,运行一段时间后,JVM会自动退出,急求ITeye大神帮忙看下.下面是错误日志:## A fatal error has been detected by the Java Runtime Environment:## Internal Error (safepoint.cpp:308), pid=16953, tid=139961315587840# guarantee(PageArmed == 0) failed: invariant## JRE version:

在Android中进行单元测试遇到的问题

问题1.Cannot connect to VM  socket closed 在使用JUnit进行测试的时候,遇到这个问题.网上的解释是:使用Eclipse对Java代码进行调试,无论是远程JVM还是本地JVM都会进行Socket通讯.发生这样的错误是由于这些软件会修改winsock,还会监听和占用一些端口,Socket通讯不上造成的. 我通过cmd →ping localhost ,发现localhost指向::1,这是因为我的系统是win7 ,它支持IPv6的原因.而Eclipse需要lo

错误日志-阿里云 Java环境 每小时在根目录下生成 hs_err_pid*.log ,求教!

问题描述 阿里云 Java环境 每小时在根目录下生成 hs_err_pid*.log ,求教! OS环境:阿里云 1核 1G内存: 安装软件:安装了 JDK 1.7 TOMCAT 7.X: 部署内容:部署了 java web 工程,工程正常运行: 问题:每小时在跟目录下生成一个 hs_err_pid.log 已经采取的措施: 1.配置服务器Swap 2.配置tomcat jvm 内存 (bin/catalina.sh) 未果,求牛人指点. 文件内容如下: # There is insuffici