Archive

Archive for the ‘JRockit’ Category

转:Comparison Between Sun JDK And Oracle JRockit

December 15th, 2010 tonyxu No comments

转自:http://weblogic-wonders.com/weblogic/2010/12/06/comparison-between-sun-jdk-and-oracle-jrockit/

As we all know, JVM is responsible in converting the java byte code into machine code (which the machine understands)
Sun jdk and Oracle JRockit do the same thing using different mechanism.

**************************
Sun JDK uses interpreter (Interpreter and JIT in previous releases) – In this mechanism, the byte code is read and the translated into machine language, but these results are not saved in the memory. So every time even if the same method is run again and again, the JVM has to translate the code into machine language. This means machine code will not be reusable as it is not saved anywhere in the memory.

Oracle JRockit uses only JIT compiler (Just In Time) – JIT mechanism means, once a method is run, the byte code is translated to machine language and this is saved in the memory. This means if the method is run again, there is no need for translation and the machine code is reused.

Because of the interpreter mechanism used by sun jdk, the start up time for the server is faster because it does not have to save the machine code in memory. Once the translation is done for a method, it moves to the other one. Where as oracle JRockit saves the code, which is why  start up takes longer. For the same reason, oracle JRockit uses more memory than sun jdk.

In the long run, JRockit gives a slightly better performance as compared to sun jdk.

**************************
Oracle JRockit optimizes the code. It identifies the HOT SPOTS which means the methods that are being run more often. These methods are then queued up for optimization. This code is then optimized which improves performance. Many issues are seen becuase of the code optimization mechanism because it is a complex procedure. Optimization can be disabled.

JIT is also used by Sun JDK, but that was in the earlier versions. The Java Hotspot VM removes the need for a JIT compiler in most cases.

**************************
Memory spaces in jdks:

Sun JDK has the following memory spaces: Eden space, survivior space, tenured generation and permanent generation. The objects move from one space to another according to its age and survival from garbage collection.

JRockit has 2 spaces, young generation and old generation, it uses the same mechanism of garbage collection. There is nothing called as permanent generation in JRockit.

*************************
Memory and other JVM tunings:

JRockit gives advanced JVM tunings. From the release R26 and above, JRockit takes care of few tunings by itself. For example if there is an outofmemory occuring on the native TLA in previous releases due to insufficient TLA size which is 2k by default, in later releases the JRockit tunes these settings as per the requirement of the application. This has to be done and taken care of by the user in case of sun jdk. But then it is always better to be in a safer side it is recommended to have the tunings done by self.

*************************
JVM Crashes:

When JRockit crashes, a JRockit dump is produced which basically has the reason for the crash. JRockit uses native libraries by default. This can be disabled by disabling the NativeIO from the admin console. The most common reason for the JRockit crash is the conflict between native libraries. For example, the jdbc type 2 drivers which use native libs. It is recommended to use type 4 pure java drivers when using oracle JRockit. Another reason for the crash can be code optimization because of its complexity. The stack trace in the JRockit dump will show the exact cause. When the JVm crashes, it is important to test it again by disabling code optimization and check if the issue still persists.

A sun jdk crash produces hs_err_pid file which has the root cause of the crash. There can be several reasons for sun jdk crash are due to bugs in them (defects in the code of the jdk). These issues need to be reported to the sun team.

**************************
Tools for performance tracking:

Sun jdk that comes bundled with weblogic server gives tools like JConsole which can be used for performance tracking and monitoring the memory in use of the JVM. This tool is very much necessary so that each and every detail about the memory being used by the application, cpu usage, memory leaks can be identified.

Oracle JRockit has a much more advanced tool JRMC (JRockit mission Control) which gives advanced tracking features. JRA recordings can be taken which gives each detail about the JVM arguements, garbage collection details, methods using the maximum memory etc. The memory leak detector tool in JRMC is also one important and very helpful tool. These make it easy for the user and administrators to maintain a record and identify the issues with the application and the JVM.

Categories: JRockit, Java, SUN Tags: ,

JDBC-ODBC bridge导致jrockit crash

September 21st, 2010 tonyxu 2 comments

转载此文请保留原作者信息及出处: http://www.tonyxu.net

一、环境信息

主机/服务器: Windows Server 2003 version 5.2 Service Pack 2

CPU数量: AMD Pentium 4 SSE SSE2 EM64T(4)

内存: 4G

虚拟机版本:BEA JRockit(R) R26.3.0-32_CR283061-63465-1.4.2_10-20060620-1811-win-ia32

虚拟机参数:-Xms1024m –Xmx1024m

二、故障记录

Jrockit dump文件的记录:

 在故障发生时,虚拟机开始产生dump,具体摘录如下

===== BEGIN DUMP =======================================================

JRockit dump produced after 1 days, 22:27:28 on Fri Jul 23 09:22:31 2010

Additional information is available in:

E:\xxxx\xxx\user_projects\domains\xxx\jrockit.4088.dump

E:\xxxx\xxx\user_projects\domains\xxx\jrockit.4088.mdmp

If you see this dump, please open a support case with BEA and

supply as much information as you can on your system setup and

the program you were running. You can also search for solutions

to your problem at http://forums.bea.com in

the forum jrockit.developer.interest.general.

Error Message: Illegal memory access. [54]

Exception Rec: EXCEPTION_ACCESS_VIOLATION (c0000005) at 0x7C94A379 – memory at 0×00000008 could not be written.

Minidump : Wrote mdmp. Size is 1178MB

Version : BEA JRockit(R) R26.3.0-32_CR283061-63465-1.4.2_10-20060620-1811-win-ia32

GC : System optimized over throughput (initial strategy singleparpar)

: GC strategy for GC 7 was genparpar

: GC strategy for GC 8 was genparpar

: GC strategy for GC 9 was genparpar

: GC strategy for GC 10 was genparpar

: GC strategy for GC 11 was genparpar

: mmHeap->data = 0x00C00000, mmHeap->top = 0x40C00000

: The nurserylist starts at 0x00CBA688 and ends at 0x062D5EB8

: mmStartCompaction = 0x14C00000, mmEndCompaction = 0x18C00000

CPU : AMD Pentium 4 SSE SSE2 EM64T

Number CPUs : 4

Tot Phys Mem : 4294144000 (4095 MB)

OS version : Microsoft Windows Server 2003 version 5.2 Service Pack 2 (Build 3790)

Thread System: Windows Threads

State : JVM is running

Command Line : -Xms1024m -Xmx1024m -Dweblogic.Name=myserver -Dweblogic.ProductionModeEnabled=true -Djava.security.policy=d:\app\wls8\bea\WEBLOG~1\server\lib\weblogic.policy -verbose:gc -Xverboselog:E:\xxxx\jtith\user_projects\domains\p16web\myserver\gcmyserver2010-07-21_76.log weblogic.Server

JAVA_HOME : d:\app\wls8\bea\JROCKI~1

java.home : d:\app\wls8\bea\JROCKI~1\jre

j.class.path : D:\app\wls8\wls8_patches\CR284362_810sp6.jar;d:\app\wls8\bea\JROCKI~1\lib\tools.jar;d:\app\wls8\bea\WEBLOG~1\server\lib\weblogic_sp.jar;d:\app\wls8\bea\WEBLOG~1\server\lib\weblogic.jar;d:\app\wls8\bea\WEBLOG~1\common\eval\pointbase\lib\pbserver44.jar;d:\app\wls8\bea\WEBLOG~1\common\eval\pointbase\lib\pbclient44.jar;d:\app\wls8\bea\JROCKI~1\jre\lib\rt.jar;d:\app\wls8\bea\WEBLOG~1\server\lib\webservices.jar;

j.lib.path : d:\app\wls8\bea\JROCKI~1\bin;.;C:\WINDOWS\system32;C:\WINDOWS;d:\app\wls8\bea\WEBLOG~1\server\bin;d:\app\wls8\bea\JROCKI~1\jre\bin;d:\app\wls8\bea\JROCKI~1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;d:\BMCSOF~1\Patrol3\bin;d:\XXX\bin\Windows-x86;d:\XXX\bin;d:\BMC Software\Patrol3\Pamo;d:\app\wls8\bea\WEBLOG~1\server\bin\oci920_8

C Heap : Good; no memory allocations have failed

StackOverFlow: 0 StackOverFlowErrors have occured

Registers (from ThreadContext: 0x42F1F1F8 / OS context: 0x42F1F5C4):

eax = 00000000 ecx = 00000008 edx = 00000004 ebx = 00000000

esp = 42f1f890 ebp = 42f1f89c esi = 00000008 edi = 44d67240

es = 00000023 cs = 0000001b ss = 00000023 ds = 00000023

fs = 0000003b gs = 00000000

eip = 7c94a379 eflags = 00010246

Stack:

(* marks the word pointed to by the stack pointer)

42f1f890: 44d67240* 00000000 00000008 42f1f8b8 4b784c36 00000004

42f1f8a8: 44d67264 4b7527af 44d67264 44d67240 42f1f8c8 4b752fdd

42f1f8c0: 44d67264 42546c3c 42f1f904 4b7561fb 44d67240 4b780000

42f1f8d8: 42546c3c 42f1f96c 02ebc670 00000001 004a4182 42f1f8d4

42f1f8f0: 42f1f4bc 42f1ffa8 4b785725 4b7561d8 ffffffff 42f1f920

42f1f908: 4b7561a5 44d67240 42f1f940 00000003 43b30b70 42546c3c

42f1f920: 42f1f938 44b011da 44d67240 42f1f940 42f1f958 42f1f940

42f1f938: 42546af8 72095e75 00000000 42f1f968 44d67240 00000000

42f1f950: 42f1f96c 72091c05 44006ab0 72095e70 42546cf4 42f1f940

42f1f968: 0cc0bdd8 02ebc660 42546af8 72314e71 00b864e0 00000000

42f1f980: 0cc0bdd8 72095d0c 00000001 14c046d8 00000000 44d67240

42f1f998: 02e38308 02e3c390 00000000 02ebc660 02e37450 02e8e1d0

42f1f9b0: 02e8e1d0 72099a1e 000000fa 000000fa 02e37450 00000001

42f1f9c8: 00000001 14c03dc0 000003ec 14c03dc0 02cce6d8 000003ef

42f1f9e0: 00b8b780 76f5c760 02e8e1d0 72074c6b 14c046c0 7209fb25

42f1f9f8: 0cc070a0 0cc070a0 02e370e0 71fffce9 0cc070a0 0cc070a0

42f1fa10: 00000003 02cceab0 02e38308 14c04560 02cceab0 71fffa4b

42f1fa28: 0cc070a0 14c03dc0 00000000 00000001 02e37058 02e370e0

42f1fa40: 02e370e0 14c04560 02cce718 02cceab0 14c04560 7217e978

42f1fa58: 02cceab0 71fb4e8a 14c02830 7218cd93 02cceab0 00000129

42f1fa70: 00000000 04e39a10 0146d478 00d90a98 42546af8 02cce718

42f1fa88: 02cceab0 00000000 02ccea38 02cce718 00000000 02cce718

42f1faa0: 14c02830 04e39a10 02ccea10 42546af8 00d90ed0 0146d478

42f1fab8: 0146d478 02cce970 02cceaa9 42546af8 00000000 02cce718

42f1fad0: 00000061 00d90a98 42546af8 00d90a98 00000000 42546af8

42f1fae8: 00d903d0 00000000 1c8aef41 00000000 14c04560 00000000

42f1fb00: 00d90a98 00d903d0 00000000 42546af8 00000129 fce47b38

42f1fb18: 02cce718 7227c725 02cceab0 00d90ed0 00d90a98 7214a51c

42f1fb30: 02cce718 02cceab0 00d90a98 7211e82d 02e34a48 02e349e8

42f1fb48: 02e34a48 00d90d98 00d90d98 00d903d0 00000000 00000000

42f1fb60: 0146d478 00d90a98 00d90a98 02cce718 baf991cb 71fb54ae

42f1fb78: 02ccea38 720faaea 02e34b10 00d90d98 00000000 00dab010

42f1fb90: 02ccea10 7230b013 00d90ed0 0146d478 0146d478 02cce970

42f1fba8: 02cceaa9 42546af8 00000000 00000000 02e34b20 7229804d

42f1fbc0: 02cceab0 00000000 00000000 720b4b4b 00d903d0 02d23a70

42f1fbd8: 04e39e21 00000000 04e58e88 00000000 00d90a98 00d903d0

42f1fbf0: 02e34af8 42546af8 0000002f 08ce7810 02e34af8 02ccea10

42f1fc08: baf991cb 71fb54ae 02ccea38 720faaea 02e34b38 42546af8

42f1fc20: 0000000a 42546af8 00d90a98 7214a51c 02ccdb39 08ce2510

42f1fc38: 00d90a98 02cce970 02cceaa9 42546af8 00000000 00d90d98

42f1fc50: 00d90a98 00d903d0 0146d478 0146d478 00000001 0146d478

42f1fc68: 42546af8 00d90ed0 00000000 00000000 08dc7dd8 02cceea0

42f1fc80: 00000000 00000005 00000006 04e39a10 04f98f88 42546af8

42f1fc98: 02cce718 02e34af8 02cceca8 7217735e 00000000 720fb105

42f1fcb0: 000003e8 00dac200 00000006 42546af8 00000001 00d90a98

42f1fcc8: 42546af8 720b4a99 00d903d0 720faaea 02e34ab0 00000000

42f1fce0: 7df35078 02e34ab0 00d90a98 00d903d0 02e34b20 04e58e88

42f1fcf8: 02ccec90 08ce2510 00d903d0 72132ba0 02e34b20 00000129

42f1fd10: 42f1fd50 00000000 00dad9e0 08ce2510 02cceab0 42546af8

42f1fd28: 0055257d 00000000 00000000 00000001 14c02800 02cce718

42f1fd40: 42546af8 00000000 0146d478 71c15e8d 42546c3c 02cceaa9

42f1fd58: 00000000 14c02830 02cce970 720b7047 0146d478 0146d478

42f1fd70: 42546af8 0000000d 00000000 02e34b20 08cb4610 00d90e38

42f1fd88: 00000009 0146d47e 0146d478 02cce718 02cceab0 721349a9

42f1fda0: 02cceab0 00000000 42546af8 0146d478 08d4e9b8 71dd4e51

42f1fdb8: 42546af8 42546af8 02cce718 720e87cd 038c3108 71dd4a3e

42f1fdd0: 42546c3c 42546af8 0146d478 71c10014 038c3109 42546af8

42f1fde8: fffffffc 71c11b61 fffffffc 42f1fed4 42f1fe9c 71dd49a0

42f1fe00: 7c959f79 42546c3c 42546af8 42f1fe34 42f1fe9c 0056e8c4

42f1fe18: 42546af8 71dd49a0 42f1fe9c 42f1ff34 00000004 00000004

42f1fe30: 42f1fe9c 4253dda8 0053aabd 71c11b20 42546af8 71dd49a0

42f1fe48: 42f1fe9c 42f1ff34 00b9e230 42546c3c 42f1ff34 42546af8

42f1fe60: 00000000 00000000 00000001 40daf738 00000000 42f1ff08

42f1fe78: 00000001 40d6edbc 00000006 00000001 00000001 00000001

42f1fe90: 00000000 00000001 00000000 42546af8 00000000 00000000

42f1fea8: 00000000 00000000 00000000 00000000 00000000 004fd067

42f1fec0: 42546c3c 778672b0 004a0363 42546c3c 778672b0 77868688

42f1fed8: 42f1ff08 004a049e 42546c3c 00b9e230 4253dda8 42546af8

42f1fef0: 00000000 42f1ff4c 0053a7c0 42f1ff34 42546af8 42f1ff64

42f1ff08: 4253dda8 00000000 00000000 004a229b 00000000 42f1ff4c

42f1ff20: 0053a7c0 00000000 42f1ff34 42546c3c 0007fa4c 00000000

42f1ff38: 00000000 004d4cf2 42546c3c 42546af8 00b9e230 42546af8

42f1ff50: 00000000 00000e30 42546af8 004d469f 00000000 0007f908

42f1ff68: 004d51fa 004d4c90 00000000 00000000 00000000 42f1ffb8

42f1ff80: 42546ad8 00000000 004d4c90 00527997 00b15160 00000000

42f1ff98: 00000000 42546ad8 42f1ff94 42f1f4bc 42f1ffdc 00594072

42f1ffb0: 005af0d8 00000000 42f1ffec 7c82482f 42546ad8 00000000

42f1ffc8: 00000000 42546ad8 c0000005 42f1ffc4 42f1f4bc ffffffff

42f1ffe0: 7c821a60 7c824838 00000000 00000000 00000000 00527960

42f1fff8: Unreadable

42f20010: 00000000 00000000 00000000 00000000 00000000 00000000

42f20028: 00000000 00000000 00000000 00000000 00000000 00000000

42f20040: 00000000 00000000 00000000 00000000 00000000 00000000

42f20058: 00000000 00000000 00000000 00000000 00000000 00000000

42f20070: 00000000 00000000 00000000 00000000 00000000 00000000

42f20088: 00000000 00000000 00000000 00000000 00000000 00000000

Code:

(* marks the word pointed to by the instruction pointer)

7c94a278: 90909090 55ff8b90 ec83ec8b 084d8b08 50f8458d f845c751

7c94a290: 7c9b97a0 00fc45c7 e8000000 000204ac c25de58b 90900004

7c94a2a8: 8b909090 ec8b55ff 38db3353 9b97201d 7d8b577c 3b850f0c

7c94a2c0: 0f0002ca 448d07b7 fe3d0200 0f0000ff 02ca3487 105d3800

7c94a2d8: 08758b56 66fe488d 850f0e89 00019a7c 0fc1b70f 40024eb7

7c94a2f0: 8d0fc13b 0002ca25 5007b70f 8d0477ff 0f500c45 ff5006b7

7c94a308: 66e80476 8b000022 0ffb3bf8 02ca0e8c 0c458b00 d1044e8b

7c94a320: 1c8966e8 5ec03341 c25d5b5f 448d000c 44891024 ed330424

7c94a338: 0149f3e9 8b559000 535756ec 75fff48b 1075ff14 ff0c75ff

7c94a350: e68b0855 5d5e5f5b 900010c2 90909090 8b55ff8b 558b51ec

7c94a368: 728d5608 75895704 0000b8fc 4d8b0000 b30ff0fc* c0920f01

7c94a380: 840fc084 00010d2e 180d8b64 8b000000 895f2441 42c70c42

7c94a398: 00000108 5ec03300 c25de58b 90900004 8b909090 ec8b55ff

7c94a3b0: 087d8b57 75084fff c7565321 00000c47 778d0000 0001bb04

7c94a3c8: 0ff00000 83431ec1 850ffffb 00022f0b c0335b5e 04c25d5f

7c94a3e0: 90c3cc00 c3ccff8b 448bff8b c2cc0424 a1640004 00000018

7c94a3f8: 7c8b57c3 548b0c24 02c70824 00000000 0b047a89 831e74ff

7c94a410: c033ffc9 d1f7aef2 fffff981 05760000 00ffffb9 4a896600

7c94a428: 89664902 08c25f0a 7c8b5700 548b0c24 02c70824 00000000

7c94a440: 0b047a89 831e74ff c033ffc9 d1f7aef2 fffff981 05760000

7c94a458: 00ffffb9 4a896600 89664902 08c25f0a 7c8b5700 548b0c24

7c94a470: 02c70824 00000000 0b047a89 832274ff c033ffc9 f7aff266

Loaded modules:

(* denotes the module causing the exception)

00400000-0040ffff d:\app\wls8\bea\JROCKI~1\bin\java.exe

7c930000-7ca01fff *C:\WINDOWS\system32\ntdll.dll

7c800000-7c92afff C:\WINDOWS\system32\kernel32.dll

77f30000-77fdbfff C:\WINDOWS\system32\ADVAPI32.dll

77c20000-77cbefff C:\WINDOWS\system32\RPCRT4.dll

76eb0000-76ec2fff C:\WINDOWS\system32\Secur32.dll

77b70000-77bc9fff C:\WINDOWS\system32\MSVCRT.dll

00410000-0063bfff d:\app\wls8\bea\JROCKI~1\jre\bin\jrockit\jvm.dll

769e0000-76a09fff C:\WINDOWS\system32\WINMM.dll

77e10000-77e9ffff C:\WINDOWS\system32\USER32.dll

77bd0000-77c18fff C:\WINDOWS\system32\GDI32.dll

71b60000-71b76fff C:\WINDOWS\system32\WS2_32.dll

71b50000-71b57fff C:\WINDOWS\system32\WS2HELP.dll

7c340000-7c395fff d:\app\wls8\bea\JROCKI~1\bin\MSVCR71.dll

76180000-7619cfff C:\WINDOWS\system32\IMM32.DLL

7f000000-7f008fff C:\WINDOWS\system32\LPK.DLL

74ae0000-74b44fff C:\WINDOWS\system32\USP10.dll

71b20000-71b27fff C:\WINDOWS\system32\rdpsnd.dll

77f10000-77f20fff C:\WINDOWS\system32\WINSTA.dll

71ba0000-71bf6fff C:\WINDOWS\system32\NETAPI32.dll

76ab0000-76abafff C:\WINDOWS\system32\PSAPI.DLL

777e0000-777fffff C:\WINDOWS\system32\NTMARTA.DLL

76e70000-76e9dfff C:\WINDOWS\system32\WLDAP32.dll

7e020000-7e02efff C:\WINDOWS\system32\SAMLIB.dll

774b0000-775e8fff C:\WINDOWS\system32\ole32.dll

40e00000-40e18fff d:\app\wls8\bea\JROCKI~1\jre\bin\java.dll

40e20000-40e2dfff d:\app\wls8\bea\JROCKI~1\jre\bin\verify.dll

40ea0000-40ea6fff d:\app\wls8\bea\JROCKI~1\jre\bin\hpi.dll

40e70000-40e7efff D:\app\wls8\bea\jrockit81sp6_142_10\jre\bin\net.dll

71a80000-71abffff C:\WINDOWS\system32\mswsock.dll

69660000-696b6fff C:\WINDOWS\system32\hnetcfg.dll

71a40000-71a47fff C:\WINDOWS\System32\wshtcpip.dll

41eb0000-41edafff C:\WINDOWS\system32\DNSAPI.dll

76ed0000-76ed6fff C:\WINDOWS\System32\winrnr.dll

76ee0000-76ee4fff C:\WINDOWS\system32\rasadhlp.dll

40e90000-40e97fff D:\app\wls8\bea\jrockit81sp6_142_10\jre\bin\nio.dll

420a0000-420a5fff D:\app\wls8\bea\jrockit81sp6_142_10\jre\bin\ioser12.dll

41540000-41544fff D:\app\wls8\bea\weblogic81\server\bin\wlntio.dll

44d10000-44d5dfff C:\WINDOWS\system32\pdh.dll

77eb0000-77f01fff C:\WINDOWS\system32\SHLWAPI.dll

761a0000-761e6fff C:\WINDOWS\system32\comdlg32.dll

77370000-77406fff C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_5.82.3790.3959_x-ww_78FCF8D0\COMCTL32.dll

45320000-45afbfff C:\WINDOWS\system32\SHELL32.dll

44dd0000-44e5afff C:\WINDOWS\system32\OLEAUT32.dll

4b750000-4b78cfff C:\WINDOWS\system32\ODBC32.dll

4d3a0000-4d3a5fff C:\WINDOWS\system32\odbcbcp.dll

77b60000-77b67fff C:\WINDOWS\system32\VERSION.dll

44f00000-44f90fff C:\WINDOWS\system32\CRYPT32.dll

418e0000-418f1fff C:\WINDOWS\system32\MSASN1.dll

77cd0000-77dd2fff C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.3790.3959_x-ww_D8713E55\comctl32.dll

44da0000-44db1fff C:\WINDOWS\system32\odbcint.dll

5e640000-5e64cfff C:\WINDOWS\system32\perfproc.dll

5e650000-5e658fff C:\WINDOWS\system32\perfos.dll

44b00000-44b0bfff D:\app\wls8\bea\jrockit81sp6_142_10\jre\bin\JdbcOdbc.dll

4ebc0000-4ebd9fff C:\WINDOWS\system32\odbccp32.dll

4b000000-4b082fff C:\WINDOWS\system32\CLBCatQ.DLL

4b090000-4b1e9fff C:\WINDOWS\system32\COMRes.dll

4b660000-4b66afff C:\WINDOWS\system32\VBAJET32.DLL

4b890000-4b8d3fff C:\WINDOWS\system32\odbcjt32.dll

45f00000-4606efff C:\WINDOWS\system32\msjet40.dll

45220000-452b4fff C:\WINDOWS\system32\mswstr10.dll

452c0000-452cbfff C:\WINDOWS\system32\odbcji32.dll

452d0000-452dcfff C:\WINDOWS\system32\msjter40.dll

452e0000-452f1fff C:\WINDOWS\system32\MSJINT40.DLL

4af80000-4afb9fff C:\WINDOWS\system32\msjtes40.dll

4b390000-4b3f1fff C:\WINDOWS\system32\expsrv.dll

4b210000-4b2cdfff C:\WINDOWS\system32\arjni60.dll

4b790000-4b889fff C:\WINDOWS\system32\arapi60.dll

45300000-4531afff C:\WINDOWS\system32\arutl60.dll

4b2d0000-4b2f4fff C:\WINDOWS\system32\arrpc60.dll

71b10000-71b1afff C:\WINDOWS\system32\WSOCK32.dll

445f0000-445f7fff C:\WINDOWS\system32\snmpapi.dll

4b680000-4b740fff d:\app\wls8\bea\JROCKI~1\jre\bin\dbghelp.dll

“ExecuteThread: ’18′ for queue: ” id=29 idx=0×40 tid=832 lastJavaFrame=0x42F1F958

Stack 0: start=0x42EE0000, end=0x42F20000, guards=0x42EE3000 (ok), forbidden=0x42EE1000

Thread Stack Trace:

at RtlEnterCriticalSection+25()@0x7C94A379

at SQLConnectA+12024()@0x4B784C36

at MpHeapAlloc+1141()@0x4B752FDD

at SQLAllocStmt+119()@0x4B7561FB

at SQLAllocStmt+33()@0x4B7561A5

at _Java_sun_jdbc_odbc_JdbcOdbc_allocStmt@20+40()@0x44B011DA

– Java stack –

at sun/jdbc/odbc/JdbcOdbc.allocStmt(J[B)J(Native Method)

at sun/jdbc/odbc/JdbcOdbc.SQLAllocStmt(J)J(JdbcOdbc.java:171)

at sun/jdbc/odbc/JdbcOdbcConnection.createStatement(II)Ljava/sql/Statement;(JdbcOdbcConnection.java:413)

at dreamtime/dreamnews/ShowNews.IDToTitle(Ljava/lang/String;I)Ljava/lang/String;(ShowNews.java:304)

at jsp_servlet/__shownews._jspService(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(__shownews.java:174)

at weblogic/servlet/jsp/JspBase.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V(JspBase.java:33)[optimized]

at weblogic/servlet/internal/ServletStubImpl$ServletInvocationAction.run()Ljava/lang/Object;(ServletStubImpl.java:1077)[inlined]

at weblogic/servlet/internal/ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Lweblogic/servlet

/internal/FilterChainImpl;)V(ServletStubImpl.java:370)[optimized]

at weblogic/servlet/internal/ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V(ServletStubImpl.java:348)[inlined]

at weblogic/servlet/internal/WebAppServletContext$ServletInvocationAction.run()Ljava/lang/Object;(WebAppServletContext.java:7046)[optimized]

at weblogic/security/acl/internal/AuthenticatedSubject.doAs(Lweblogic/security/subject/AbstractSubject;Ljava/security/PrivilegedAction;)Ljava/lang/Object;(AuthenticatedSubject.java:321)[optimized]

at weblogic/security/service/SecurityManager.runAs(Lweblogic/security/acl/internal/AuthenticatedSubject;Lweblogic/security/acl/internal/

AuthenticatedSubject;Ljava/security/PrivilegedAction;)Ljava/lang/Object;(SecurityManager.java:121)[inlined]

at weblogic/servlet/internal/WebAppServletContext.invokeServlet(Lweblogic/servlet/internal/ServletRequestImpl;Lweblogic/servlet/internal

/ServletResponseImpl;)V(WebAppServletContext.java:3732)[optimized]

at weblogic/servlet/internal/ServletRequestImpl.execute(Lweblogic/kernel/ExecuteThread;)V(ServletRequestImpl.java:2773)[optimized]

at weblogic/kernel/ExecuteThread.execute(Lweblogic/kernel/ExecuteRequest;)V(ExecuteThread.java:224)[optimized]

at weblogic/kernel/ExecuteThread.run()V(ExecuteThread.java:183)

at jrockit/vm/RNI.c2java(IIII)V(Native Method)

– end of trace

Additional information is available in:

E:\xxxx\jtith\user_projects\domains\p16web\jrockit.4088.dump

E:\xxxx\jtith\user_projects\domains\p16web\jrockit.4088.mdmp

If you see this dump, please open a support case with BEA and

supply as much information as you can on your system setup and

the program you were running. You can also search for solutions

to your problem at http://forums.bea.com in

the forum jrockit.developer.interest.general.

===== END DUMP =======================================================

三、故障分析

从dump文件来看,报错信息跟SUN JDK的一个bug很类似,如下:

Bug ID: 6550430
Synopsis Accessing Access database via JDBC-ODBC bridge

FULL PRODUCT VERSION :

java version “1.6.0″

Java(TM) SE Runtime Environment (build 1.6.0-b105)

Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)

FULL OS VERSION :

customer Windows XP Professional Version 2002 Service Pack 2

A DESCRIPTION OF THE PROBLEM :

I have a class for querying an MS Access database. The database is queryied every one second in a separarate thread, when the user clicks on the “start” button. The program crashes when I call the query method from the run() or the action handler. In other cases works fine.

THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Yes

THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Did not try

ERROR MESSAGES/STACK TRACES THAT OCCUR :

#

# An unexpected error has been detected by Java Runtime Environment:

#

# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c911010, pid=3176, tid=1080

#

# Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing)

# Problematic frame:

# C [ntdll.dll+0x1010]

#

# 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 (0x07f93c00): JavaThread “Thread-2″ [_thread_in_native, id=1080]

siginfo: ExceptionCode=0xc0000005, reading address 0×00000018

Registers:

EAX=0×00000004, EBX=0x269b4e60, ECX=0x7ffd4000, EDX=0×00000004

ESP=0x0301f908, EBP=0x0301f920, ESI=0×00000000, EDI=0x02e11348

EIP=0x7c911010, EFLAGS=0×00010246

Top of Stack: (sp=0x0301f908)

0x0301f908: 74605a16 00000004 02e1136c 745d139f

0x0301f918: 02e1136c 02e11348 0301f930 745d2c5d

0x0301f928: 02e1136c 07f93ce8 0301f944 745d5fa0

0x0301f938: 02e11348 74600000 00000001 0301f960

0x0301f948: 745d740e 02e11348 0301f980 00000003

0x0301f958: 07f91ff8 07f93ce8 0301f978 6d3f124e

0x0301f968: 02e11348 0301f980 07f93c00 269b4e60

0x0301f978: 0301f9bc 0091a430 00000000 0301f9d8

Instructions: (pc=0x7c911010)

0x7c911000: 90 90 90 90 90 64 8b 0d 18 00 00 00 8b 54 24 04

0x7c911010: 83 7a 14 00 75 4f f0 ff 42 04 75 19 8b 41 24 89

Stack: [0x02fd0000,0x03020000), sp=0x0301f908, free space=318k

Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)

C [ntdll.dll+0x1010]

C [ODBC32.dll+0x2c5d]

C [ODBC32.dll+0x5fa0]

C [ODBC32.dll+0x740e]

C [JdbcOdbc.dll+0x124e]

j sun.jdbc.odbc.JdbcOdbc.allocStmt(J[B)J+0

j sun.jdbc.odbc.JdbcOdbc.SQLAllocStmt(J)J+47

j sun.jdbc.odbc.JdbcOdbcConnection.createStatement(II)Ljava/sql/Statement;+27

j sun.jdbc.odbc.JdbcOdbcConnection.createStatement()Ljava/sql/Statement;+7

j Log.getErrorStatus()I+6

我们可以看到,在本次故障的dump文件里,有如下信息

Error Message: Illegal memory access. [54]

Exception Rec: EXCEPTION_ACCESS_VIOLATION (c0000005) at 0x7C94A379 – memory at 0×00000008 could not be written.

结合线程堆栈,跟上述bug十分相似。

四、结论

Jrcokit本身就是基于SUN JDK,虽然上面提到的bug是在SUN JDK发生的,但报错信息和当前堆栈信息都几乎一样,我们有理由确认本次故障也是由于JDBC-ODBC桥接的bug。

1. 使用type4的jdbc driver

2. 升级odbc driver.

Categories: JRockit, weblogic Tags: