OpenJDK11 crash when call BigDecimal.sqrt - java

I'm using openjdk-11 running my application, bu the jvm frequent unexplained crash. The log mentioned that the method of BigDecimal.sqrt was called and crashed, but this method was not called in my code.
This is my code for getBetweenSeconds method in DateUtil:
public static long getBetweenSeconds(Date from, Date to) {
return Math.abs((to.getTime() - from.getTime()) / 1000);
}
Following is the full log file:
full log file
Following is the crash log:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007eff70883f62, pid=32037, tid=32143
#
# JRE version: OpenJDK Runtime Environment 18.9 (11.0.12+7) (build 11.0.12+7-LTS)
# Java VM: OpenJDK 64-Bit Server VM 18.9 (11.0.12+7-LTS, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# j java.math.BigDecimal.sqrt(Ljava/math/MathContext;)Ljava/math/BigDecimal;+1 java.base#11.0.12
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e" (or dumping to /home/crown/service/core.32037)
#
# If you would like to submit a bug report, please visit:
# https://bugzilla.redhat.com/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%208&component=java-11-openjdk
#
--------------- S U M M A R Y ------------
Command Line: -Xmx5120m -XX:MaxMetaspaceSize=200m -Dserver.port=9090 -Dwebsocket.port=9100 -Dserver.number=S001 -Dspring.profiles.active=prod -Dapplication.exchange=OKEX -Dapplication.get-ticker-info=false -Dlog4j2.formatMsgNoLookups=true /home/crown/service/crown-service-9090.jar
Host: Intel(R) Xeon(R) Platinum 8269CY CPU # 2.50GHz, 2 cores, 7G, Alibaba Cloud Linux release 3 (Soaring Falcon)
Time: Mon Feb 28 22:44:01 2022 CST elapsed time: 115.158780 seconds (0d 0h 1m 55s)
--------------- T H R E A D ---------------
Current thread (0x00007eff896e6800): JavaThread "RBT-SWAP-OKE-s3RXY" [_thread_in_Java, id=32143, stack(0x00007eff0edc9000,0x00007eff0eeca000)]
Stack: [0x00007eff0edc9000,0x00007eff0eeca000], sp=0x00007eff0eec8520, free space=1021k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
j java.math.BigDecimal.sqrt(Ljava/math/MathContext;)Ljava/math/BigDecimal;+1 java.base#11.0.12
j com.liuqi.utils.DateUtil.getBetweenSeconds(Ljava/util/Date;Ljava/util/Date;)J+5
j com.liuqi.robotruntime.robots.AbstractSWAPRobot.handleNewPrice(Lcom/liuqi/robotruntime/ContractOrder;Ljava/math/BigDecimal;Ljava/math/BigDecimal;Ljava/lang/String;Ljava/lang/String;)V+33
J 13459% c2 com.liuqi.robotruntime.robots.AbstractSWAPRobot.lambda$startExecute$2()V (524 bytes) # 0x00007eff78aebae8 [0x00007eff78ae8240+0x00000000000038a8]
j com.liuqi.robotruntime.robots.AbstractSWAPRobot$$Lambda$882.run()V+4
j java.lang.Thread.run()V+11 java.base#11.0.12
v ~StubRoutines::call_stub
V [libjvm.so+0x8c42a9] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x3b9
V [libjvm.so+0x8c268e] JavaCalls::call_virtual(JavaValue*, Handle, Klass*, Symbol*, Symbol*, Thread*)+0x1ae
V [libjvm.so+0x97ce90] thread_entry(JavaThread*, Thread*)+0x80
V [libjvm.so+0xe8f428] JavaThread::thread_main_inner()+0x268
V [libjvm.so+0xe8a6df] Thread::call_run()+0x14f
V [libjvm.so+0xc68886] thread_native_entry(Thread*)+0xf6
siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000017f40c9cbbe
Register to memory mapping:
RAX=0x0 is NULL
RBX=0x0000000000000014 is an unknown value
RCX=0x0000017f40c9cbb6 is an unknown value
RDX=0x0000000040000001 is an unknown value
RSP=0x00007eff0eec8520 is pointing into the stack for thread: 0x00007eff896e6800
RBP=0x00007eff0eec8578 is pointing into the stack for thread: 0x00007eff896e6800
RSI=0x00007eff896e73e0 points into unknown readable memory: 0x0000001e00000003 | 03 00 00 00 1e 00 00 00
RDI={method} {0x00000008000a5390} 'sqrt' '(Ljava/math/MathContext;)Ljava/math/BigDecimal;' in 'java/math/BigDecimal'
R8 =0x00007eff89bc34f0 points into unknown readable memory: 0x0000000800104280 | 80 42 10 00 08 00 00 00
R9 =0x0000000000000004 is an unknown value
R10=0x00007eff8fe9cfa0: <offset 0x0000000001317fa0> in /usr/lib/jvm/java-11-openjdk-11.0.12.0.7-0.1.al8.x86_64/lib/server/libjvm.so at 0x00007eff8eb85000
R11=0x00007eff70889780 is at code_begin+0 in an Interpreter codelet
deoptimization entry points [0x00007eff70889780, 0x00007eff7088b980] 8704 bytes
R12=0x0 is NULL
R13=0x00000008005fd029 is pointing into metadata
R14=0x00007eff0eec8620 is pointing into the stack for thread: 0x00007eff896e6800
R15=0x00007eff896e6800 is a thread

Related

Cygwin compilation error Problematic frame: # C [cygwin1.dll+0xd6d47] using JNI

I've made a simple hello world application using JNI everything works good even the dll for my 64 bit gets created but when i run the app it shows the following error :
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000180116d47, pid=2140, tid=0x0000000000001710
#
# JRE version: Java(TM) SE Runtime Environment (8.0_131-b11) (build 1.8.0_131-b11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C [cygwin1.dll+0xd6d47]
#
# 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.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Here is the complete error report :
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000180116d47, pid=2140, tid=0x0000000000001710
#
# JRE version: Java(TM) SE Runtime Environment (8.0_131-b11) (build 1.8.0_131-b11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C [cygwin1.dll+0xd6d47]
#
# 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.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
--------------- T H R E A D ---------------
Current thread (0x0000000002bd0800): JavaThread "main" [_thread_in_native, id=5904, stack(0x0000000002a10000,0x0000000002b10000)]
siginfo: ExceptionCode=0xc0000005, writing address 0x0000000000000070
Registers:
RAX=0x0000000000000070, RBX=0x0000000017270278, RCX=0x00000004344a3030, RDX=0x0000000002b0f4f8
RSP=0x0000000002b0f430, RBP=0x0000000002b0f460, RSI=0x0000000020000021, RDI=0x00000000ffffffff
R8 =0x0000000000000004, R9 =0x0000000001217f70, R10=0x0000000002b10000, R11=0x00000004344a10ac
R12=0x0000000000000000, R13=0x0000000017270278, R14=0x0000000002b0f4f8, R15=0x0000000002bd0800
RIP=0x0000000180116d47, EFLAGS=0x0000000000010206
Top of Stack: (sp=0x0000000002b0f430)
0x0000000002b0f430: 000000018018c780 0000000180116d5b
0x0000000002b0f440: 0000000002b0f700 0000000002bd0800
0x0000000002b0f450: 0000000017270278 0000000020000021
0x0000000002b0f460: 0000000002b0f4d8 0000000002ce7f74
0x0000000002b0f470: 0000000002bd09f8 0000000002b0f4f8
0x0000000002b0f480: 0000000020000021 0000000002bd0800
0x0000000002b0f490: 0000000002ce7ca2 0000000002b0f498
0x0000000002b0f4a0: 0000000017270278 0000000002b0f4f8
0x0000000002b0f4b0: 0000000017270410 0000000000000000
0x0000000002b0f4c0: 0000000017270278 0000000000000000
0x0000000002b0f4d0: 0000000002b0f4f8 0000000002b0f540
0x0000000002b0f4e0: 0000000002cd835d 0000000000000000
0x0000000002b0f4f0: 0000000002ce19d8 00000000d5e6e2f0
0x0000000002b0f500: 0000000002b0f500 0000000017270317
0x0000000002b0f510: 0000000002b0f550 0000000017270410
0x0000000002b0f520: 0000000000000000 0000000017270320
Instructions: (pc=0x0000000180116d47)
0x0000000180116d27: 04 f3 90 eb e3 48 c7 c0 08 00 00 00 49 0f c1 82
0x0000000180116d37: 50 e4 ff ff 4c 8d 1d 19 00 00 00 4c 87 5c 24 08
0x0000000180116d47: 4c 89 18 41 ff 82 44 e4 ff ff 41 ff 8a 4c e4 ff
0x0000000180116d57: ff 58 ff e0 65 4c 8b 14 25 08 00 00 00 41 bb 01
Register to memory mapping:
RAX=0x0000000000000070 is an unknown value
RBX={method} {0x0000000017270280} 'print' '()V' in 'javatoc'
RCX=0x00000004344a3030 is an unknown value
RDX=0x0000000002b0f4f8 is pointing into the stack for thread: 0x0000000002bd0800
RSP=0x0000000002b0f430 is pointing into the stack for thread: 0x0000000002bd0800
RBP=0x0000000002b0f460 is pointing into the stack for thread: 0x0000000002bd0800
RSI=0x0000000020000021 is an unknown value
RDI=0x00000000ffffffff is an unallocated location in the heap
R8 =0x0000000000000004 is an unknown value
R9 =0x0000000001217f70 is an unknown value
R10=0x0000000002b10000 is pointing into the stack for thread: 0x0000000002bd0800
R11=0x00000004344a10ac is an unknown value
R12=0x0000000000000000 is an unknown value
R13={method} {0x0000000017270280} 'print' '()V' in 'javatoc'
R14=0x0000000002b0f4f8 is pointing into the stack for thread: 0x0000000002bd0800
R15=0x0000000002bd0800 is a thread
Stack: [0x0000000002a10000,0x0000000002b10000], sp=0x0000000002b0f430, free space=1021k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [cygwin1.dll+0xd6d47]
C [cygwin1.dll+0x14c77f]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j javatoc.print()V+0
j javatoc.main([Ljava/lang/String;)V+7
v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x0000000019428800 JavaThread "Service Thread" daemon [_thread_blocked, id=1096, stack(0x0000000019800000,0x0000000019900000)]
0x000000001781f000 JavaThread "C1 CompilerThread2" daemon [_thread_blocked, id=4500, stack(0x0000000019300000,0x0000000019400000)]
0x000000001781a000 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=5164, stack(0x0000000019200000,0x0000000019300000)]
0x0000000017816800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=3924, stack(0x0000000019100000,0x0000000019200000)]
0x0000000017815000 JavaThread "Attach Listener" daemon [_thread_blocked, id=1188, stack(0x0000000019000000,0x0000000019100000)]
0x0000000017812000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=3188, stack(0x0000000018f00000,0x0000000019000000)]
0x0000000002cca800 JavaThread "Finalizer" daemon [_thread_blocked, id=3732, stack(0x0000000018a60000,0x0000000018b60000)]
0x0000000002cbf800 JavaThread "Reference Handler" daemon [_thread_blocked, id=192, stack(0x0000000018960000,0x0000000018a60000)]
=>0x0000000002bd0800 JavaThread "main" [_thread_in_native, id=5904, stack(0x0000000002a10000,0x0000000002b10000)]
Other Threads:
0x00000000177d8000 VMThread [stack: 0x0000000018860000,0x0000000018960000] [id=5348]
0x0000000019452800 WatcherThread [stack: 0x0000000019900000,0x0000000019a00000] [id=5728]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap:
PSYoungGen total 38400K, used 1331K [0x00000000d5e00000, 0x00000000d8880000, 0x0000000100000000)
eden space 33280K, 4% used [0x00000000d5e00000,0x00000000d5f4cce8,0x00000000d7e80000)
from space 5120K, 0% used [0x00000000d8380000,0x00000000d8380000,0x00000000d8880000)
to space 5120K, 0% used [0x00000000d7e80000,0x00000000d7e80000,0x00000000d8380000)
ParOldGen total 87552K, used 0K [0x0000000081a00000, 0x0000000086f80000, 0x00000000d5e00000)
object space 87552K, 0% used [0x0000000081a00000,0x0000000081a00000,0x0000000086f80000)
Metaspace used 2598K, capacity 4486K, committed 4864K, reserved 1056768K
class space used 283K, capacity 386K, committed 512K, reserved 1048576K
Card table byte_map: [0x0000000012090000,0x0000000012490000] byte_map_base: 0x0000000011c83000
Marking Bits: (ParMarkBitMap*) 0x0000000060a0c720
Begin Bits: [0x0000000012b40000, 0x0000000014ad8000)
End Bits: [0x0000000014ad8000, 0x0000000016a70000)
Polling page: 0x0000000001040000
CodeCache: size=245760Kb used=1106Kb max_used=1115Kb free=244653Kb
bounds [0x0000000002cd0000, 0x0000000002f40000, 0x0000000011cd0000]
total_blobs=257 nmethods=26 adapters=145
compilation: enabled
Compilation events (10 events):
Event: 0.059 Thread 0x000000001781f000 21 3 java.io.WinNTFileSystem::isSlash (18 bytes)
Event: 0.059 Thread 0x000000001781f000 nmethod 21 0x0000000002de2910 code [0x0000000002de2a60, 0x0000000002de2c50]
Event: 0.059 Thread 0x000000001781f000 23 3 java.lang.AbstractStringBuilder::append (50 bytes)
Event: 0.059 Thread 0x000000001781a000 24 4 java.lang.String::charAt (29 bytes)
Event: 0.060 Thread 0x000000001781f000 nmethod 23 0x0000000002de2cd0 code [0x0000000002de2ea0, 0x0000000002de35f8]
Event: 0.060 Thread 0x000000001781f000 25 3 java.lang.String::indexOf (7 bytes)
Event: 0.060 Thread 0x000000001781f000 nmethod 25 0x0000000002de3910 code [0x0000000002de3a80, 0x0000000002de3c88]
Event: 0.060 Thread 0x000000001781a000 nmethod 24 0x0000000002de69d0 code [0x0000000002de6b20, 0x0000000002de6bd8]
Event: 0.063 Thread 0x000000001781f000 26 3 java.lang.StringBuilder::append (8 bytes)
Event: 0.063 Thread 0x000000001781f000 nmethod 26 0x0000000002de5e50 code [0x0000000002de5fc0, 0x0000000002de6148]
GC Heap History (0 events):
No events
Deoptimization events (0 events):
No events
Internal exceptions (2 events):
Event: 0.023 Thread 0x0000000002bd0800 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.defineClass(Ljava/lang/String;[BII)Ljava/lang/Class; name or signature does not match> (0x00000000d5e07ca8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u131\8869\hotspot\
Event: 0.023 Thread 0x0000000002bd0800 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.prefetchRead(Ljava/lang/Object;J)V name or signature does not match> (0x00000000d5e07f90) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u131\8869\hotspot\src\share\vm\prims
Events (10 events):
Event: 0.063 loading class java/security/BasicPermissionCollection
Event: 0.063 loading class java/security/BasicPermissionCollection done
Event: 0.063 loading class sun/launcher/LauncherHelper$FXHelper
Event: 0.063 loading class sun/launcher/LauncherHelper$FXHelper done
Event: 0.063 loading class java/lang/Class$MethodArray
Event: 0.063 loading class java/lang/Class$MethodArray done
Event: 0.064 loading class java/lang/Void
Event: 0.064 loading class java/lang/Void done
Event: 0.064 loading class java/lang/ClassLoaderHelper
Event: 0.064 loading class java/lang/ClassLoaderHelper done
Dynamic libraries:
0x00007ff690580000 - 0x00007ff6905b7000 C:\Program Files\Java\jdk1.8.0_131\bin\java.exe
0x00007ffc37930000 - 0x00007ffc37ada000 C:\WINDOWS\SYSTEM32\ntdll.dll
0x00007ffc37230000 - 0x00007ffc3736a000 C:\WINDOWS\system32\KERNEL32.DLL
0x00007ffc350a0000 - 0x00007ffc351af000 C:\WINDOWS\system32\KERNELBASE.dll
0x00007ffc33620000 - 0x00007ffc336a8000 C:\WINDOWS\system32\apphelp.dll
0x00007ffc1cea0000 - 0x00007ffc1ceef000 C:\WINDOWS\AppPatch\AppPatch64\AcGenral.DLL
0x00007ffc35280000 - 0x00007ffc35327000 C:\WINDOWS\system32\msvcrt.dll
0x00007ffc34a70000 - 0x00007ffc34a9b000 C:\WINDOWS\SYSTEM32\SspiCli.dll
0x00007ffc376c0000 - 0x00007ffc37711000 C:\WINDOWS\system32\SHLWAPI.dll
0x00007ffc37540000 - 0x00007ffc376b1000 C:\WINDOWS\system32\USER32.dll
0x00007ffc35a90000 - 0x00007ffc35c08000 C:\WINDOWS\system32\ole32.dll
0x00007ffc35e10000 - 0x00007ffc37227000 C:\WINDOWS\system32\SHELL32.dll
0x00007ffc342b0000 - 0x00007ffc342ce000 C:\WINDOWS\SYSTEM32\USERENV.dll
0x00007ffc351b0000 - 0x00007ffc35255000 C:\WINDOWS\system32\ADVAPI32.dll
0x00007ffc2f320000 - 0x00007ffc2f33b000 C:\WINDOWS\SYSTEM32\MPR.dll
0x00007ffc35760000 - 0x00007ffc35896000 C:\WINDOWS\system32\RPCRT4.dll
0x00007ffc35db0000 - 0x00007ffc35e07000 C:\WINDOWS\SYSTEM32\sechost.dll
0x00007ffc35520000 - 0x00007ffc356f6000 C:\WINDOWS\SYSTEM32\combase.dll
0x00007ffc37370000 - 0x00007ffc374b5000 C:\WINDOWS\system32\GDI32.dll
0x00007ffc34ca0000 - 0x00007ffc34cb4000 C:\WINDOWS\SYSTEM32\profapi.dll
0x00007ffc33140000 - 0x00007ffc331df000 C:\WINDOWS\SYSTEM32\SHCORE.dll
0x00007ffc378e0000 - 0x00007ffc37914000 C:\WINDOWS\system32\IMM32.DLL
0x00007ffc35950000 - 0x00007ffc35a89000 C:\WINDOWS\system32\MSCTF.dll
0x00007ffc32350000 - 0x00007ffc325aa000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.9600.17031_none_6242a4b3ecbb55a1\COMCTL32.dll
0x0000000060a90000 - 0x0000000060b62000 C:\Program Files\Java\jdk1.8.0_131\jre\bin\msvcr100.dll
0x00000000601f0000 - 0x0000000060a8c000 C:\Program Files\Java\jdk1.8.0_131\jre\bin\server\jvm.dll
0x00007ffc32070000 - 0x00007ffc32079000 C:\WINDOWS\SYSTEM32\WSOCK32.dll
0x00007ffc22da0000 - 0x00007ffc22dbf000 C:\WINDOWS\SYSTEM32\WINMM.dll
0x00007ffc2e7c0000 - 0x00007ffc2e7ca000 C:\WINDOWS\SYSTEM32\VERSION.dll
0x00007ffc374d0000 - 0x00007ffc374d7000 C:\WINDOWS\system32\PSAPI.DLL
0x00007ffc35700000 - 0x00007ffc35758000 C:\WINDOWS\system32\WS2_32.dll
0x00007ffc22d70000 - 0x00007ffc22d9a000 C:\WINDOWS\SYSTEM32\WINMMBASE.dll
0x00007ffc35330000 - 0x00007ffc35339000 C:\WINDOWS\system32\NSI.dll
0x00007ffc34d70000 - 0x00007ffc34dba000 C:\WINDOWS\SYSTEM32\cfgmgr32.dll
0x00007ffc33b30000 - 0x00007ffc33b56000 C:\WINDOWS\SYSTEM32\DEVOBJ.dll
0x00000000601e0000 - 0x00000000601ef000 C:\Program Files\Java\jdk1.8.0_131\jre\bin\verify.dll
0x00000000601b0000 - 0x00000000601d9000 C:\Program Files\Java\jdk1.8.0_131\jre\bin\java.dll
0x0000000060190000 - 0x00000000601a6000 C:\Program Files\Java\jdk1.8.0_131\jre\bin\zip.dll
0x00000004344a0000 - 0x00000004344b8000 C:\Program Files\Java\jdk1.8.0_131\bin\javatoc.dll
0x0000000180040000 - 0x0000000180610000 C:\cygwin64\bin\cygwin1.dll
0x00007ffc0b5a0000 - 0x00007ffc0b728000 C:\WINDOWS\SYSTEM32\dbghelp.dll
VM Arguments:
java_command: javatoc
java_class_path (initial): .
Launcher Type: SUN_STANDARD
Environment Variables:
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_131\bin;
PATH=C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\nodejs\;C:\Program Files\Java\jre7\bin;C:\swigwin-3.0.12;C:\Program Files\Java\jdk1.8.0_131\bin;;C:\Program Files\Java\jdk1.8.0_131\lib;C:\Program Files\Java\jdk1.8.0_131\include\win32;C:\Program Files\Java\jdk1.8.0_131\include;;C:\Python27;;C:\Program Files\Java\jdk1.8.0_131\bin;C:\cygwin64\bin;C:\Users\User\AppData\Roaming\npm;C:\Users\User\AppData\Local\atom\bin
USERNAME=User
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 58 Stepping 9, GenuineIntel
--------------- S Y S T E M ---------------
OS: Windows 8.1 , 64 bit Build 9600 (6.3.9600.17056)
CPU:total 4 (initial active 4) (4 cores per cpu, 1 threads per core) family 6 model 58 stepping 9, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, aes, clmul, erms, tsc, tscinvbit, tscinv
Memory: 4k page, physical 8279416k(5777792k free), swap 9655672k(6364908k free)
vm_info: Java HotSpot(TM) 64-Bit Server VM (25.131-b11) for windows-amd64 JRE (1.8.0_131-b11), built on Mar 15 2017 01:23:53 by "java_re" with MS VC++ 10.0 (VS2010)
time: Sat May 20 16:25:17 2017
elapsed time: 0 seconds (0d 0h 0m 0s)
I'm using CYGWIN 64 bit version, but unable to get what the exact error is.
Following is the javatoc.java file code
import java.io.*;
public class javatoc
{
public native void print();
static{
System.loadLibrary("javatoc");
}
public static void main(String args[])
{
new javatoc().print();
}
}
Here is the javatoc.c file code
#include "jni.h"
#include <stdio.h>
JNIEXPORT void JNICALL Java_javatoc_print
(JNIEnv *evn, jobject obj)
{
printf("Hello World");
}
Commands used for execution :
javac javatoc.java
javah -jni javatoc
gcc -I"C:/Program Files/Java/jdk1.8.0_131/include" -I"C:/Program Files/Java/jdk1.8.0_131/include/win32" -Wall -D_JNI_IMPLEMENTATION_ -Wl,--kill-at -shared javatoc.c -o javatoc.dll
Can anyone please help me out with this and let me know what this error is about.
I couldn't get JNI to work with Cygwin's g++ -- that induces a dependency on cygwin1.dll, which clashes with the JNI mechanism, causing a crash. But using /bin/x86_64-w64-mingw32-g++.exe fixed the problem for me.

Calling C# dll (wrapped in C++) in Java / A fatal error has been detected by the Java Runtime Environment

I was following this link how to wrap a c# library for use in java
I think I didn't miss anything but I'm getting a crash.
Here's codes,
Java (project - package - class / jnitest - jni - Test1 )
package jni;
public class Test1 {
static {
System.loadLibrary("Test");
// System.load("/lib/Test.dll");
}
public native void displayHelloWorld();
public static void main (String[] args) {
// System.out.println(System.getProperty("java.library.path"));
Test1 t = new Test1();
t.displayHelloWorld();
}
}
JNI Header file generated from java (using eclipse)
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class jni_Test1 */
#ifndef _Included_jni_Test1
#define _Included_jni_Test1
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: jni_Test1
* Method: displayHelloWorld
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_jni_Test1_displayHelloWorld
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif
HelloWorld.h
#using <mscorlib.dll>
#using "CSharpHelloWorld.netmodule"
using namespace System;
public ref class HelloWorldC
{
public:
// Provide .NET interop and garbage collecting to the pointer.
CSharpHelloWorld^ t;
HelloWorldC() {
t = gcnew CSharpHelloWorld();
// Assign the reference a new instance of the object
}
// This inline function is called from the C++ Code
void callCSharpHelloWorld() {
t->displayHelloWorld();
}
};
HelloWorld.cpp
#include <jni.h>
#include "jni_Test1.h"
#include "HelloWorld.h"
// This is the JNI call to the Managed C++ Class
// NOTE: When the java header was created, the package name was not include in the JNI call.
// This naming convention was corrected by adding the
// "helloworld" name following the following syntax:
// Java_<package name>_<class name>_<method name>
JNIEXPORT void JNICALL Java_jni_Test1_displayHelloWorld(JNIEnv *jn, jobject jobj) {
// Instantiate the MC++ class.
HelloWorldC^ t = gcnew HelloWorldC();
// The actual call is made.
t->callCSharpHelloWorld();
}
I'm using Visual Studio 2013 and when I tried to use * like reference link did, it gives me an error so I had to change in that way it doesn't thrown an error. (such as * -> ^, __gc -> gcnew and so on)
I succeeded to create dll file and put it in classpath and when I launched java file, it gives me error/log below
[error]
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (0xe0434352), pid=8020, tid=14744
#
# JRE version: Java(TM) SE Runtime Environment (8.0_31-b13) (build 1.8.0_31-b13)
# Java VM: Java HotSpot(TM) Client VM (25.31-b07 mixed mode windows-x86 )
# Problematic frame:
# C [KERNELBASE.dll+0xc42d]
#
# 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:\workspace\jnitest\hs_err_pid8020.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
[log]
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (0xe0434352), pid=8020, tid=14744
#
# JRE version: Java(TM) SE Runtime Environment (8.0_31-b13) (build 1.8.0_31-b13)
# Java VM: Java HotSpot(TM) Client VM (25.31-b07 mixed mode windows-x86 )
# Problematic frame:
# C [KERNELBASE.dll+0xc42d]
#
# 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.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
--------------- T H R E A D ---------------
Current thread (0x00ddc800): JavaThread "main" [_thread_in_native, id=14744, stack(0x00f10000,0x00f60000)]
siginfo: ExceptionCode=0xe0434352, ExceptionInformation=0x80070002 0x00000000 0x00000000 0x00000000 0x6e980000
Registers:
EAX=0x00f5e3b0, EBX=0x00000005, ECX=0x00000005, EDX=0x00000000
ESP=0x00f5e3b0, EBP=0x00f5e400, ESI=0x00f5e46c, EDI=0x00000001
EIP=0x76a4c42d, EFLAGS=0x00000212
Top of Stack: (sp=0x00f5e3b0)
0x00f5e3b0: e0434352 00000001 00000000 76a4c42d
0x00f5e3c0: 00000005 80070002 00000000 00000000
0x00f5e3d0: 00000000 6e980000 00f5f578 00000001
0x00f5e3e0: 00000000 006511c4 00004000 00446118
0x00f5e3f0: 00f5e404 758014ad 00412d28 00f5e3b8
0x00f5e400: 00f5e4a0 6ead8fdb e0434352 00000001
0x00f5e410: 00000005 00f5e46c 83662cfd 0043bd10
0x00f5e420: 15a62380 00f5e558 00412d28 00000001
Instructions: (pc=0x76a4c42d)
0x76a4c40d: 02 50 ff 75 14 8d 45 c4 50 e8 57 ad 02 00 83 c4
0x76a4c41d: 0c eb 03 89 45 c0 8d 45 b0 50 ff 15 5c 11 a4 76
0x76a4c42d: c9 c2 10 00 cc cc cc cc cc 8b ff 55 8b ec 56 8b
0x76a4c43d: 75 08 83 fe f4 72 18 83 fe f6 77 13 8d 45 08 50
Register to memory mapping:
EAX=0x00f5e3b0 is pointing into the stack for thread: 0x00ddc800
EBX=0x00000005 is an unknown value
ECX=0x00000005 is an unknown value
EDX=0x00000000 is an unknown value
ESP=0x00f5e3b0 is pointing into the stack for thread: 0x00ddc800
EBP=0x00f5e400 is pointing into the stack for thread: 0x00ddc800
ESI=0x00f5e46c is pointing into the stack for thread: 0x00ddc800
EDI=0x00000001 is an unknown value
Stack: [0x00f10000,0x00f60000], sp=0x00f5e3b0, free space=312k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [KERNELBASE.dll+0xc42d]
C [clr.dll+0x158fdb]
C [clr.dll+0x2cd607]
C [clr.dll+0x2d57bc]
C [clrjit.dll+0x38a6]
C [clrjit.dll+0x2b72c]
C [clrjit.dll+0x3066]
C [clrjit.dll+0x325b]
C [clrjit.dll+0x12fb]
C [clrjit.dll+0x152b]
C [clrjit.dll+0x1668]
C [clrjit.dll+0x17b5]
C [clrjit.dll+0x1802]
C [clr.dll+0x388f9]
C [clr.dll+0x38991]
C [clr.dll+0x389d3]
C [clr.dll+0x38405]
C [clr.dll+0x3878c]
C [clr.dll+0x1497b5]
C [clr.dll+0x1b02b]
C [clr.dll+0x2a0c]
C 0x00f0177f
C 0x0067b3f5
j jni.Test1.displayHelloWorld()V+0
j jni.Test1.main([Ljava/lang/String;)V+9
v ~StubRoutines::call_stub
V [jvm.dll+0x1473e5]
V [jvm.dll+0x20d57e]
V [jvm.dll+0x14747e]
V [jvm.dll+0xd0c27]
V [jvm.dll+0xd91cf]
C [javaw.exe+0x210a]
C [javaw.exe+0xaba1]
C [javaw.exe+0xac2b]
C [kernel32.dll+0x1336a]
C [ntdll.dll+0x39882]
C [ntdll.dll+0x39855]
C 0x00000000
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j jni.Test1.displayHelloWorld()V+0
j jni.Test1.main([Ljava/lang/String;)V+9
v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x14ee0000 JavaThread "Service Thread" daemon [_thread_blocked, id=13880, stack(0x15350000,0x153a0000)]
0x14eb6c00 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=2028, stack(0x152d0000,0x15320000)]
0x14eb5800 JavaThread "Attach Listener" daemon [_thread_blocked, id=9236, stack(0x15230000,0x15280000)]
0x14eb2800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=14804, stack(0x150b0000,0x15100000)]
0x14e80c00 JavaThread "Finalizer" daemon [_thread_blocked, id=14892, stack(0x04910000,0x04960000)]
0x14e7b400 JavaThread "Reference Handler" daemon [_thread_blocked, id=13668, stack(0x002f0000,0x00340000)]
=>0x00ddc800 JavaThread "main" [_thread_in_native, id=14744, stack(0x00f10000,0x00f60000)]
Other Threads:
0x14e78000 VMThread [stack: 0x01090000,0x010e0000] [id=13428]
0x14ee1400 WatcherThread [stack: 0x00920000,0x00970000] [id=13024]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap:
def new generation total 4928K, used 795K [0x04a00000, 0x04f50000, 0x09f50000)
eden space 4416K, 18% used [0x04a00000, 0x04ac6ea8, 0x04e50000)
from space 512K, 0% used [0x04e50000, 0x04e50000, 0x04ed0000)
to space 512K, 0% used [0x04ed0000, 0x04ed0000, 0x04f50000)
tenured generation total 10944K, used 0K [0x09f50000, 0x0aa00000, 0x14a00000)
the space 10944K, 0% used [0x09f50000, 0x09f50000, 0x09f50200, 0x0aa00000)
Metaspace used 1695K, capacity 2242K, committed 2368K, reserved 4480K
Card table byte_map: [0x00f60000,0x00ff0000] byte_map_base: 0x00f3b000
Polling page: 0x000e0000
CodeCache: size=32768Kb used=677Kb max_used=677Kb free=32090Kb
bounds [0x02830000, 0x028e0000, 0x04830000]
total_blobs=156 nmethods=19 adapters=70
compilation: enabled
Compilation events (10 events):
Event: 0.135 Thread 0x14eb6c00 15 java.lang.CharacterDataLatin1::getProperties (11 bytes)
Event: 0.135 Thread 0x14eb6c00 nmethod 15 0x028d7808 code [0x028d7900, 0x028d79a0]
Event: 0.135 Thread 0x14eb6c00 16 java.lang.String::toLowerCase (439 bytes)
Event: 0.136 Thread 0x14eb6c00 nmethod 16 0x028d7a48 code [0x028d7c50, 0x028d8440]
Event: 0.136 Thread 0x14eb6c00 17 java.lang.AbstractStringBuilder::append (29 bytes)
Event: 0.137 Thread 0x14eb6c00 nmethod 17 0x028d8e88 code [0x028d8f90, 0x028d907c]
Event: 0.137 Thread 0x14eb6c00 18 java.lang.Character::toLowerCase (9 bytes)
Event: 0.137 Thread 0x14eb6c00 nmethod 18 0x028d9188 code [0x028d9290, 0x028d9338]
Event: 0.137 Thread 0x14eb6c00 19 java.lang.CharacterDataLatin1::toLowerCase (39 bytes)
Event: 0.137 Thread 0x14eb6c00 nmethod 19 0x028d93c8 code [0x028d94c0, 0x028d95a0]
GC Heap History (0 events):
No events
Deoptimization events (0 events):
No events
Internal exceptions (3 events):
Event: 0.091 Thread 0x00ddc800 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.defineClass(Ljava/lang/String;[BII)Ljava/lang/Class; name or signature does not match> (0x04a0b310) thrown at [C:\re\workspace\8-2-build-windows-i586-cygwin\jdk8u31\2394\hotspot\src\share\vVG½±¡4·?
Event: 0.091 Thread 0x00ddc800 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.prefetchRead(Ljava/lang/Object;J)V name or signature does not match> (0x04a0b590) thrown at [C:\re\workspace\8-2-build-windows-i586-cygwin\jdk8u31\2394\hotspot\src\share\vm\prims\jni.cpp, l>x\b#vÁ?
Event: 0.136 Thread 0x00ddc800 Exception <a 'java/security/PrivilegedActionException'> (0x04abd8e8) thrown at [C:\re\workspace\8-2-build-windows-i586-cygwin\jdk8u31\2394\hotspot\src\share\vm\prims\jvm.cpp, line 1312]
Events (10 events):
Event: 0.139 loading class java/security/AllPermission
Event: 0.139 loading class java/security/AllPermission done
Event: 0.139 loading class java/security/UnresolvedPermission
Event: 0.139 loading class java/security/UnresolvedPermission done
Event: 0.139 loading class java/security/BasicPermissionCollection
Event: 0.139 loading class java/security/BasicPermissionCollection done
Event: 0.140 loading class sun/launcher/LauncherHelper$FXHelper
Event: 0.140 loading class sun/launcher/LauncherHelper$FXHelper done
Event: 0.140 loading class java/lang/Class$MethodArray
Event: 0.140 loading class java/lang/Class$MethodArray done
Dynamic libraries:
0x01130000 - 0x01160000 C:\Program Files (x86)\Java\jre1.8.0_31\bin\javaw.exe
0x776a0000 - 0x77820000 C:\Windows\SysWOW64\ntdll.dll
0x757f0000 - 0x75900000 C:\Windows\syswow64\kernel32.dll
0x76a40000 - 0x76a87000 C:\Windows\syswow64\KERNELBASE.dll
0x771f0000 - 0x77291000 C:\Windows\syswow64\ADVAPI32.dll
0x76790000 - 0x7683c000 C:\Windows\syswow64\msvcrt.dll
0x76750000 - 0x76769000 C:\Windows\SysWOW64\sechost.dll
0x75990000 - 0x75a80000 C:\Windows\syswow64\RPCRT4.dll
0x75010000 - 0x75070000 C:\Windows\syswow64\SspiCli.dll
0x75000000 - 0x7500c000 C:\Windows\syswow64\CRYPTBASE.dll
0x756f0000 - 0x757f0000 C:\Windows\syswow64\USER32.dll
0x769b0000 - 0x76a40000 C:\Windows\syswow64\GDI32.dll
0x76780000 - 0x7678a000 C:\Windows\syswow64\LPK.dll
0x75540000 - 0x755dd000 C:\Windows\syswow64\USP10.dll
0x71420000 - 0x715be000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_41e855142bd5705d\COMCTL32.dll
0x76d70000 - 0x76dc7000 C:\Windows\syswow64\SHLWAPI.dll
0x75690000 - 0x756f0000 C:\Windows\system32\IMM32.DLL
0x77120000 - 0x771ec000 C:\Windows\syswow64\MSCTF.dll
0x779e0000 - 0x77a9f000 C:\Program Files (x86)\Java\jre1.8.0_31\bin\msvcr100.dll
0x530a0000 - 0x53444000 C:\Program Files (x86)\Java\jre1.8.0_31\bin\client\jvm.dll
0x74f40000 - 0x74f47000 C:\Windows\system32\WSOCK32.dll
0x75250000 - 0x75285000 C:\Windows\syswow64\WS2_32.dll
0x75670000 - 0x75676000 C:\Windows\syswow64\NSI.dll
0x6ccf0000 - 0x6cd22000 C:\Windows\system32\WINMM.dll
0x75500000 - 0x75505000 C:\Windows\syswow64\PSAPI.DLL
0x74020000 - 0x7402c000 C:\Program Files (x86)\Java\jre1.8.0_31\bin\verify.dll
0x73ff0000 - 0x74011000 C:\Program Files (x86)\Java\jre1.8.0_31\bin\java.dll
0x73fd0000 - 0x73fe3000 C:\Program Files (x86)\Java\jre1.8.0_31\bin\zip.dll
0x75ad0000 - 0x7671b000 C:\Windows\syswow64\SHELL32.dll
0x76fc0000 - 0x7711c000 C:\Windows\syswow64\ole32.dll
0x77670000 - 0x7767b000 C:\Windows\syswow64\profapi.dll
0x77840000 - 0x77850000 C:\Program Files (x86)\Java\jre1.8.0_31\bin\Test.dll
0x6fb00000 - 0x6fb4a000 C:\Windows\SYSTEM32\MSCOREE.DLL
0x15590000 - 0x1574f000 C:\Windows\system32\MSVCR120D.dll
0x6f9f0000 - 0x6fa6e000 C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscoreei.dll
0x6e980000 - 0x6f01d000 C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
0x6f750000 - 0x6f827000 C:\Windows\system32\MSVCR120_CLR0400.dll
0x6d910000 - 0x6e97b000 C:\Windows\assembly\NativeImages_v4.0.30319_32\mscorlib\d1265d6159ea876f9d63ea4c1361b587\mscorlib.ni.dll
0x6f6d0000 - 0x6f74d000 C:\Windows\Microsoft.NET\Framework\v4.0.30319\clrjit.dll
0x76cd0000 - 0x76d5f000 C:\Windows\syswow64\OLEAUT32.dll
0x5dea0000 - 0x5df71000 C:\Windows\Microsoft.NET\Framework\v4.0.30319\diasymreader.dll
0x6cf70000 - 0x6d90d000 C:\Windows\assembly\NativeImages_v4.0.30319_32\System\d18e2115a3270f89663fce831547f534\System.ni.dll
0x72040000 - 0x7212b000 C:\Windows\system32\dbghelp.dll
VM Arguments:
jvm_args: -Dfile.encoding=Cp1252
java_command: jni.Test1
java_class_path (initial): C:\workspace\jnitest\bin
Launcher Type: SUN_STANDARD
Environment Variables:
JAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_51
PATH=C:/Program Files (x86)/Java/jre1.8.0_31/bin/client;C:/Program Files (x86)/Java/jre1.8.0_31/bin;C:/Program Files (x86)/Java/jre1.8.0_31/lib/i386;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Wizvera\Delfino;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\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 (x86)\Common Files\Ulead Systems\MPEG;C:\SWTOOLS\ReadyApps;C:\Program Files (x86)\Common Files\Lenovo;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Lenovo\Access Connections\;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 (x86)\Java\jre7\bin;C:\Program Files\nodejs\;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Java\jdk1.7.0_51\bin;C:\development\adt-bundle-windows-x86_64\sdk\platform-tools;C:\development\adt-bundle-windows-x86_64\sdk\tools;C:\Program Files\ANT\apache-ant-1.9.3\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\eclipse\mars;
USERNAME=MYUSER
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 58 Stepping 9, GenuineIntel
--------------- S Y S T E M ---------------
OS: Windows 7 , 64 bit Build 7601 Service Pack 1
CPU:total 4 (2 cores per cpu, 2 threads per core) family 6 model 58 stepping 9, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, aes, clmul, erms, ht, tsc, tscinvbit, tscinv
Memory: 4k page, physical 8079004k(1694656k free), swap 16156168k(9124340k free)
vm_info: Java HotSpot(TM) Client VM (25.31-b07) for windows-x86 JRE (1.8.0_31-b13), built on Dec 17 2014 20:46:12 by "java_re" with MS VC++ 10.0 (VS2010)
time: Thu Aug 27 16:38:52 2015
elapsed time: 0 seconds (0d 0h 0m 0s)

Java Out of memory EXCEPTION_ACCESS_VIOLATION (0xc0000005)

I have a java application, it had been running for 1 month.
It suddenly crashes with this error message. I use nssm to create windows service for my application.
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6ecf4803, pid=4484, tid=1040
#
# JRE version: Java(TM) SE Runtime Environment (7.0_79-b15) (build 1.7.0_79-b15)
# Java VM: Java HotSpot(TM) Server VM (24.79-b02 mixed mode windows-x86 )
# Problematic frame:
# V [jvm.dll+0x154803]
#
# Failed to write core dump. Call to MiniDumpWriteDump() failed
#
# An error report file with more information is saved as:
# D:\dir\hs_err_pid4484.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
This is hs_err_pid4484.log (not Full Log)
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6ecf4803, pid=4484, tid=1040
#
# JRE version: Java(TM) SE Runtime Environment (7.0_79-b15) (build 1.7.0_79-b15)
# Java VM: Java HotSpot(TM) Server VM (24.79-b02 mixed mode windows-x86 )
# Problematic frame:
# V [jvm.dll+0x154803]
#
# Failed to write core dump. Call to MiniDumpWriteDump() failed
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
--------------- T H R E A D ---------------
Current thread (0x2be27800): JavaThread "hz.10.252.223.144.cached.thread-7" [_thread_in_vm, id=1040, stack(0x2d0b0000,0x2d100000)]
siginfo: ExceptionCode=0xc0000005, writing address 0x2d0f77f4
Registers:
EAX=0x00006000, EBX=0x2c4cb7e4, ECX=0x2d0f77f4, EDX=0x2d0b9078
ESP=0x2d0fd800, EBP=0x2d0fd864, ESI=0x00000007, EDI=0x2d0fd7f4
EIP=0x6ecf4803, EFLAGS=0x00010202
Top of Stack: (sp=0x2d0fd800)
0x2d0fd800: 2c4cb7e8 2be27800 6ecf4f93 2be27800
0x2d0fd810: 2b3d0748 2d0fd9cc 00000000 00000000
0x2d0fd820: 00000000 07100146 0008fe12 00000060
0x2d0fd830: 010101ec 00e50358 00000000 2be27930
0x2d0fd840: 6ed1635d 00000000 2c39d2e8 00e50048
0x2d0fd850: 00e50170 2d0fd9d4 0000000a 3ab09782
0x2d0fd860: 2c4cb7e4 2d0fd8ac 6edc479e 2d0fd9cc
0x2d0fd870: 010fd8d4 2d0fd940 01625280 1fe13366
Instructions: (pc=0x6ecf4803)
0x6ecf47e3: a9 00 0d 00 be 01 00 00 00 8b f8 39 35 80 65 0a
0x6ecf47f3: 6f 7c 1b e8 15 54 06 00 0f af c6 8b cf 2b c8 46
0x6ecf4803: c7 01 00 00 00 00 3b 35 80 65 0a 6f 7e e5 5f 5e
0x6ecf4813: c3 cc cc cc cc cc cc cc cc cc cc cc cc 55 8b ec
Register to memory mapping:
EAX=0x00006000 is an unknown value
EBX=0x2c4cb7e4 is an unknown value
ECX=0x2d0f77f4 is pointing into the stack for thread: 0x2be27800
EDX=0x2d0b9078 is pointing into the stack for thread: 0x2be27800
ESP=0x2d0fd800 is pointing into the stack for thread: 0x2be27800
EBP=0x2d0fd864 is pointing into the stack for thread: 0x2be27800
ESI=0x00000007 is an unknown value
EDI=0x2d0fd7f4 is pointing into the stack for thread: 0x2be27800
Stack: [0x2d0b0000,0x2d100000], sp=0x2d0fd800, free space=310k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [jvm.dll+0x154803]
V [jvm.dll+0x22479e]
V [jvm.dll+0x15505d]
V [jvm.dll+0xd7152]
V [jvm.dll+0xd8f7f]
C [instrument.dll+0x2e9e]
C [instrument.dll+0x19c1]
V [jvm.dll+0x118d2e]
V [jvm.dll+0x11c824]
V [jvm.dll+0x39640]
V [jvm.dll+0x4c4e7]
V [jvm.dll+0x10381f]
V [jvm.dll+0x103a6b]
C [java.dll+0x166a]
C [zip.dll+0x1b28]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j java.lang.ClassLoader.defineClass1(Ljava/lang/String;[BIILjava/security/ProtectionDomain;Ljava/lang/String;)Ljava/lang/Class;+0
j java.lang.ClassLoader.defineClass(Ljava/lang/String;[BIILjava/security/ProtectionDomain;)Ljava/lang/Class;+30
j java.security.SecureClassLoader.defineClass(Ljava/lang/String;[BIILjava/security/CodeSource;)Ljava/lang/Class;+12
j java.net.URLClassLoader.defineClass(Ljava/lang/String;Lsun/misc/Resource;)Ljava/lang/Class;+220
J 546 C2 java.net.URLClassLoader$1.run()Ljava/lang/Object; (5 bytes) # 0x0178859c [0x01788080+0x51c]
v ~StubRoutines::call_stub
J 966 java.security.AccessController.doPrivileged(Ljava/security/PrivilegedExceptionAction;Ljava/security/AccessControlContext;)Ljava/lang/Object; (0 bytes) # 0x016a3f07 [0x016a3ea0+0x67]
J 544 C2 java.net.URLClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class; (29 bytes) # 0x016d5780 [0x016d5720+0x60]
J 1079 C2 java.lang.ClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class; (122 bytes) # 0x01834128 [0x01833800+0x928]
J 1200 C2 java.lang.ClassLoader.loadClass(Ljava/lang/String;)Ljava/lang/Class; (82 bytes) # 0x0190c148 [0x0190c0a0+0xa8]
v ~StubRoutines::call_stub
j com.hazelcast.instance.OutOfMemoryErrorDispatcher$DefaultOutOfMemoryHandler.onOutOfMemory(Ljava/lang/OutOfMemoryError;[Lcom/hazelcast/core/HazelcastInstance;)V+32
j com.hazelcast.instance.OutOfMemoryErrorDispatcher.onOutOfMemory(Ljava/lang/OutOfMemoryError;)V+46
j com.hazelcast.util.executor.PoolExecutorThreadFactory$ManagedThread.run()V+33
v ~StubRoutines::call_stub
The application can be restarted, but I have to investigate the root cause of this problem.
Thanks.

" The crash happened outside the Java Virtual Machine in native code."how to solve this error (Java)?

Using the library in this link http://www.blog.kslemb.com/doku.php/en/projects/globx/java_hid
I have been modfied this code to write on a HID terminal
if (HIDHandle.equals(WinBase.INVALID_HANDLE_VALUE)) {
return HID_DEVICE_NOT_OPENED;
}
/* Write Feature report */
boolean Status=Kernel32.INSTANCE.WriteFile(HIDHandle, buffer, (int)buffersize, null, null);
if (Status == false) {
debug("Write File: " + getSystemError(Kernel32.INSTANCE.GetLastError()));
return HID_DEVICE_TRANSFER_FAILED;
} else {
return HID_DEVICE_SUCCESS;
}
This code would successfully writes on the HID device but then it would produce this error
A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7600d4d5, pid=4660, tid=3780
#
# JRE version: 6.0_27-b07
# Java VM: Java HotSpot(TM) Client VM (20.2-b06 mixed mode, sharing windows-x86 )
# Problematic frame:
# C [KERNELBASE.dll+0xd4d5]
#
# An error report file with more information is saved as:
# D:\eng\senior_project\usb\NetBeansProjects\USB\hs_err_pid4660.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug
and These what appear in the log file
a#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7600d4d5, pid=180, tid=4348
#
# JRE version: 6.0_27-b07
# Java VM: Java HotSpot(TM) Client VM (20.2-b06 mixed mode, sharing windows-x86 )
# Problematic frame:
# C [KERNELBASE.dll+0xd4d5]
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
--------------- T H R E A D ---------------
Current thread (0x001e9000): JavaThread "main" [_thread_in_native, id=4348, stack(0x001f0000,0x00240000)]
siginfo: ExceptionCode=0xc0000005, writing address 0x00000000
Registers:
EAX=0x00000005, EBX=0x000002f8, ECX=0x001df148, EDX=0x0023f750
ESP=0x0023f738, EBP=0x0023f770, ESI=0x00000000, EDI=0x00000000
EIP=0x7600d4d5, EFLAGS=0x00010246
Top of Stack: (sp=0x0023f738)
0x0023f738: 165f7936 0023f8c0 00000000 00000000
0x0023f748: 0023f77c 00000004 00000000 00000005
0x0023f758: 0023f738 0023f300 0023fdd4 76036590
0x0023f768: 607ff39e fffffffe 0023f78c 76e512cc
0x0023f778: 000002f8 0211c3c8 00000005 00000000
0x0023f788: 00000000 0023f7a8 1000cb77 000002f8
0x0023f798: 0211c3c8 00000005 00000000 00000000
0x0023f7a8: 0023f7e8 1000c7c2 1000c5a0 0023f7d0
Instructions: (pc=0x7600d4d5)
0x7600d4b5: 3d 03 01 00 00 75 12 6a 00 6a 00 53 ff 15 64 10
0x7600d4c5: 00 76 85 c0 7c 0e 8b 45 e0 85 c0 7c 07 8b 45 e4
0x7600d4d5: 89 07 eb c2 8b c8 81 e1 00 00 00 c0 81 f9 00 00
0x7600d4e5: 00 80 75 05 8b 4d e4 89 0f 50 e8 1e 98 02 00 33
Register to memory mapping:
EAX=0x00000005 is an unknown value
EBX=0x000002f8 is an unknown value
ECX=0x001df148 is an unknown value
EDX=0x0023f750 is pointing into the stack for thread: 0x001e9000
ESP=0x0023f738 is pointing into the stack for thread: 0x001e9000
EBP=0x0023f770 is pointing into the stack for thread: 0x001e9000
ESI=0x00000000 is an unknown value
EDI=0x00000000 is an unknown value
Stack: [0x001f0000,0x00240000], sp=0x0023f738, free space=317k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [KERNELBASE.dll+0xd4d5] WriteFile+0x133
C [kernel32.dll+0x112cc] WriteFile+0x4a
C [jna6285930827620941734.dll+0xcb77] Java_com_sun_jna_Native_initialize_1ffi_1type+0x37d7
C [jna6285930827620941734.dll+0xc7c2] Java_com_sun_jna_Native_initialize_1ffi_1type+0x3422
C [jna6285930827620941734.dll+0x4561] Java_com_sun_jna_Pointer__1getString+0xa31
C [jna6285930827620941734.dll+0x4d2e] Java_com_sun_jna_Function_invokeInt+0x2e
j com.sun.jna.Function.invokeInt(I[Ljava/lang/Object;)I+0
j com.sun.jna.Function.invoke([Ljava/lang/Object;Ljava/lang/Class;Z)Ljava/lang/Object;+315
j com.sun.jna.Function.invoke(Ljava/lang/Class;[Ljava/lang/Object;Ljava/util/Map;)Ljava/lang/Object;+214
j com.sun.jna.Library$Handler.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+341
j $Proxy2.WriteFile(Lcom/sun/jna/platform/win32/WinNT$HANDLE;[BILcom/sun/jna/ptr/IntByReference;Lcom/sun/jna/platform/win32/WinBase$OVERLAPPED;)Z+37
j usb.Communication.SetFeatureReport([BS)B+29
j usb.USB.main([Ljava/lang/String;)V+62
v ~StubRoutines::call_stub
V [jvm.dll+0xfac3b]
V [jvm.dll+0x18c391]
V [jvm.dll+0xfacbd]
V [jvm.dll+0x95776]
V [jvm.dll+0x9d5b3]
C [java.exe+0x2155]
C [java.exe+0x85b4]
C [kernel32.dll+0x1339a] BaseThreadInitThunk+0x12
C [ntdll.dll+0x39ef2] RtlInitializeExceptionChain+0x63
C [ntdll.dll+0x39ec5] RtlInitializeExceptionChain+0x36
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j com.sun.jna.Function.invokeInt(I[Ljava/lang/Object;)I+0
j com.sun.jna.Function.invoke([Ljava/lang/Object;Ljava/lang/Class;Z)Ljava/lang/Object;+315
j com.sun.jna.Function.invoke(Ljava/lang/Class;[Ljava/lang/Object;Ljava/util/Map;)Ljava/lang/Object;+214
j com.sun.jna.Library$Handler.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+341
j $Proxy2.WriteFile(Lcom/sun/jna/platform/win32/WinNT$HANDLE;[BILcom/sun/jna/ptr/IntByReference;Lcom/sun/jna/platform/win32/WinBase$OVERLAPPED;)Z+37
j usb.Communication.SetFeatureReport([BS)B+29
j usb.USB.main([Ljava/lang/String;)V+62
v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x020f1c00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2628, stack(0x045e0000,0x04630000)]
0x020ed000 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=3440, stack(0x04550000,0x045a0000)]
0x020ec000 JavaThread "Attach Listener" daemon [_thread_blocked, id=1904, stack(0x044c0000,0x04510000)]
0x020e9000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=4148, stack(0x04430000,0x04480000)]
0x020dec00 JavaThread "Finalizer" daemon [_thread_blocked, id=3336, stack(0x043a0000,0x043f0000)]
0x020dcc00 JavaThread "Reference Handler" daemon [_thread_blocked, id=3196, stack(0x04310000,0x04360000)]
=>0x001e9000 JavaThread "main" [_thread_in_native, id=4348, stack(0x001f0000,0x00240000)]
Other Threads:
0x020a0800 VMThread [stack: 0x04280000,0x042d0000] [id=4704]
0x02100400 WatcherThread [stack: 0x04670000,0x046c0000] [id=4352]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap
def new generation total 4928K, used 2462K [0x241e0000, 0x24730000, 0x29730000)
eden space 4416K, 55% used [0x241e0000, 0x24447bb0, 0x24630000)
from space 512K, 0% used [0x24630000, 0x24630000, 0x246b0000)
to space 512K, 0% used [0x246b0000, 0x246b0000, 0x24730000)
tenured generation total 10944K, used 0K [0x29730000, 0x2a1e0000, 0x341e0000)
the space 10944K, 0% used [0x29730000, 0x29730000, 0x29730200, 0x2a1e0000)
compacting perm gen total 12288K, used 669K [0x341e0000, 0x34de0000, 0x381e0000)
the space 12288K, 5% used [0x341e0000, 0x342877e8, 0x34287800, 0x34de0000)
ro space 10240K, 54% used [0x381e0000, 0x3875f548, 0x3875f600, 0x38be0000)
rw space 12288K, 55% used [0x38be0000, 0x39285140, 0x39285200, 0x397e0000)
Code Cache [0x02170000, 0x02200000, 0x04170000)
total_blobs=201 nmethods=66 adapters=71 free_code_cache=32980800 largest_free_block=0
Dynamic libraries:
0x00400000 - 0x00424000 C:\Program Files (x86)\Java\jdk1.6.0_27\bin\java.exe
0x77420000 - 0x775a0000 C:\Windows\SysWOW64\ntdll.dll
0x76e40000 - 0x76f50000 C:\Windows\syswow64\kernel32.dll
0x76000000 - 0x76046000 C:\Windows\syswow64\KERNELBASE.dll
0x76920000 - 0x769c0000 C:\Windows\syswow64\ADVAPI32.dll
0x76f50000 - 0x76ffc000 C:\Windows\syswow64\msvcrt.dll
0x75d80000 - 0x75d99000 C:\Windows\SysWOW64\sechost.dll
0x767d0000 - 0x768c0000 C:\Windows\syswow64\RPCRT4.dll
0x74f80000 - 0x74fe0000 C:\Windows\syswow64\SspiCli.dll
0x74f70000 - 0x74f7c000 C:\Windows\syswow64\CRYPTBASE.dll
0x7c340000 - 0x7c396000 C:\Program Files (x86)\Java\jdk1.6.0_27\jre\bin\msvcr71.dll
0x6d8a0000 - 0x6db4f000 C:\Program Files (x86)\Java\jdk1.6.0_27\jre\bin\client\jvm.dll
0x76ae0000 - 0x76be0000 C:\Windows\syswow64\USER32.dll
0x76730000 - 0x767c0000 C:\Windows\syswow64\GDI32.dll
0x75ca0000 - 0x75caa000 C:\Windows\syswow64\LPK.dll
0x76da0000 - 0x76e3d000 C:\Windows\syswow64\USP10.dll
0x745c0000 - 0x745f2000 C:\Windows\system32\WINMM.dll
0x76be0000 - 0x76c40000 C:\Windows\system32\IMM32.DLL
0x76050000 - 0x7611c000 C:\Windows\syswow64\MSCTF.dll
0x71540000 - 0x7158c000 C:\Windows\system32\apphelp.dll
0x6d850000 - 0x6d85c000 C:\Program Files (x86)\Java\jdk1.6.0_27\jre\bin\verify.dll
0x6d3d0000 - 0x6d3ef000 C:\Program Files (x86)\Java\jdk1.6.0_27\jre\bin\java.dll
0x6d890000 - 0x6d89f000 C:\Program Files (x86)\Java\jdk1.6.0_27\jre\bin\zip.dll
0x743e0000 - 0x743f6000 C:\Windows\system32\CRYPTSP.dll
0x743a0000 - 0x743db000 C:\Windows\system32\rsaenh.dll
0x71090000 - 0x710a7000 C:\Windows\system32\USERENV.dll
0x74380000 - 0x7438b000 C:\Windows\system32\profapi.dll
0x6d6b0000 - 0x6d6c3000 C:\Program Files (x86)\Java\jdk1.6.0_27\jre\bin\net.dll
0x76120000 - 0x76155000 C:\Windows\syswow64\WS2_32.dll
0x773f0000 - 0x773f6000 C:\Windows\syswow64\NSI.dll
0x74690000 - 0x746cc000 C:\Windows\system32\mswsock.dll
0x72e40000 - 0x72e46000 C:\Windows\System32\wship6.dll
0x746d0000 - 0x746e0000 C:\Windows\system32\NLAapi.dll
0x74620000 - 0x74630000 C:\Windows\system32\napinsp.dll
0x74600000 - 0x74612000 C:\Windows\system32\pnrpnsp.dll
0x745b0000 - 0x745bd000 C:\Windows\system32\wshbth.dll
0x74640000 - 0x74684000 C:\Windows\system32\DNSAPI.dll
0x74630000 - 0x74638000 C:\Windows\System32\winrnr.dll
0x74550000 - 0x74555000 C:\Windows\System32\wshtcpip.dll
0x74740000 - 0x7475c000 C:\Windows\system32\IPHLPAPI.DLL
0x74730000 - 0x74737000 C:\Windows\system32\WINNSI.DLL
0x74560000 - 0x74566000 C:\Windows\system32\rasadhlp.dll
0x74570000 - 0x745a8000 C:\Windows\System32\fwpuclnt.dll
0x10000000 - 0x10055000 C:\Users\mohamed\AppData\Local\Temp\jna6285930827620941734.dll
0x75c90000 - 0x75c95000 C:\Windows\syswow64\PSAPI.DLL
0x74b80000 - 0x74b89000 C:\Windows\system32\hid.dll
0x76160000 - 0x762fd000 C:\Windows\syswow64\setupapi.dll
0x75d40000 - 0x75d67000 C:\Windows\syswow64\CFGMGR32.dll
0x76500000 - 0x7658f000 C:\Windows\syswow64\OLEAUT32.dll
0x76c40000 - 0x76d9c000 C:\Windows\syswow64\ole32.dll
0x77000000 - 0x77012000 C:\Windows\syswow64\DEVOBJ.dll
0x75c60000 - 0x75c8d000 C:\Windows\syswow64\WINTRUST.dll
0x769c0000 - 0x76add000 C:\Windows\syswow64\CRYPT32.dll
0x767c0000 - 0x767cc000 C:\Windows\syswow64\MSASN1.dll
VM Arguments:
jvm_args: -Dfile.encoding=UTF-8
java_command: usb.USB
Launcher Type: SUN_STANDARD
Environment Variables:
PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Lenovo\Bluetooth Software\;C:\Program Files\Lenovo\Bluetooth Software\syswow64;
USERNAME=mohamed
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 23 Stepping 10, GenuineIntel
--------------- S Y S T E M ---------------
OS: Windows 7 , 64 bit 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 3105384k(1019428k free), swap 6208920k(4162952k free)
vm_info: Java HotSpot(TM) Client VM (20.2-b06) for windows-x86 JRE (1.6.0_27-b07), built on Jul 19 2011 01:04:42 by "java_re" with MS VC++ 7.1 (VS2003)
time: Fri Feb 10 17:48:29 2012
elapsed time: 0 seconds
i have found the solution to this problem ,
boolean Status=Kernel32.INSTANCE.WriteFile(HIDHandle, buffer, (int)buffersize, null, null);
the function doesn't accept two nulls , only one null can be passed to the function , so the correction example would be :
IntByReference bWritten = new IntByReference();
/* Write Feature report */
boolean Status=Kernel32.INSTANCE.WriteFile(HIDHandle, buffer, (int)buffersize, bWritten, null);
I'm guessing you're using a Java library that has portions of it written in C (Java Native Interface). The error is happening in one of those C portions. Unless that library is something you have source code for that library, your only option would be to contact the vendor or look for an updated version.
But check this and see if it's related.
I reinstalled Eclipse.
Installed a different version of JDK.
Launched Eclipse as admin.
None of the above worked.
Finally I found the solution from Richard Ayotte here:
https://bugs.launchpad.net/ubuntu-gnome/+bug/1163501
Apparently, the tool tip window is the main culprit.
Solution:
Locate the file eclipse.ini in your Eclipse installation directory.
Put the following line in your eclipse.ini file (or AptanaStudio3.ini, if that is applicable to you) :
-Dorg.eclipse.swt.browser.DefaultType=mozilla
Save the file and restart Eclipse. Thank you, Rich !

Create a playlist in iTunes with COM and Java

How do I create a playlist in iTunes from Java, using COM (on windows i.e. no AppleScript)?
I have found a library here that does most of what I need, and I have added some code to ITPlaylist.java, to call the "AddTrack" method (mentioned in the docs) on the iTunes object ITPlaylist :
public void addTrack(ITTrack track) {
ITPlaylistKind k = getKind();
if (k == ITPlaylistKindUser) {
Dispatch.put(object, "AddTrack", track);
} else
throw new UnsupportedOperationException("can only add track to user playlists - kind : " + k);
}
But I get an error :
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x1000e150, pid=3184, tid=3896
#
# JRE version: 6.0_15-b03
# Java VM: Java HotSpot(TM) Client VM (14.1-b02 mixed mode, sharing windows-x86)
# Problematic frame:
# C [jacob-1.14.3-x86.dll+0xe150]
#
# An error report file with more information is saved as:
# Z:\\hs_err_pid3184.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
when I try and call this method. The log file contains:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x1000e150, pid=3040, tid=3756
#
# JRE version: 6.0_15-b03
# Java VM: Java HotSpot(TM) Client VM (14.1-b02 mixed mode, sharing windows-x86 )
# Problematic frame:
# C [jacob-1.14.3-x86.dll+0xe150]
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
--------------- T H R E A D ---------------
Current thread (0x01ed1400): JavaThread "main" [_thread_in_native, id=3756, stack(0x003b0000,0x00400000)]
siginfo: ExceptionCode=0xc0000005, reading address 0x00000005
Registers:
EAX=0x00000000, EBX=0x0490f6f8, ECX=0x003ffd8c, EDX=0x240b14e8
ESP=0x003ff9d0, EBP=0x003ffa14, ESI=0x01ed1510, EDI=0x00000005
EIP=0x1000e150, EFLAGS=0x00010246
Top of Stack: (sp=0x003ff9d0)
0x003ff9d0: 01ed1400 28404d90 28404d90 01fd9e27
0x003ff9e0: 01ed1510 003ffa28 003ffa24 01ed1400
0x003ff9f0: 2840bbaf 003ff9f4 00000000 003ffa28
0x003ffa00: 28409fb8 00000000 28404d90 00000000
0x003ffa10: 003ffa24 003ffa4c 01fd2da1 00000000
0x003ffa20: 01fd8259 240b14e8 240b39d8 003ffa2c
0x003ffa30: 2840401a 003ffa58 28409fb8 00000000
0x003ffa40: 28404040 003ffa24 003ffa54 003ffa7c
Instructions: (pc=0x1000e150)
0x1000e140: 1d 53 ff 15 20 01 01 10 66 c7 03 09 00 89 7b 08
0x1000e150: 8b 0f 8b 51 04 57 ff d2 5f 5e 5b c2 0c 00 6a ff
Stack: [0x003b0000,0x00400000], sp=0x003ff9d0, free space=318k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [jacob-1.14.3-x86.dll+0xe150]
j com.jacob.com.Variant.putObject(Ljava/lang/Object;)V+2
j com.jacob.com.VariantUtilities.populateVariant(Lcom/jacob/com/Variant;Ljava/lang/Object;Z)V+511
j com.jacob.com.VariantUtilities.objectToVariant(Ljava/lang/Object;)Lcom/jacob/com/Variant;+248
j com.jacob.com.VariantUtilities.objectsToVariants([Ljava/lang/Object;)[Lcom/jacob/com/Variant;+19
j com.jacob.com.Dispatch.invoke(Lcom/jacob/com/Dispatch;Ljava/lang/String;I[Ljava/lang/Object;[I)Lcom/jacob/com/Variant;+8
j com.jacob.com.Dispatch.put(Lcom/jacob/com/Dispatch;Ljava/lang/String;Ljava/lang/Object;)V+18
j com.dt.iTunesController.ITPlaylist.addTrack(Lcom/dt/iTunesController/ITTrack;)V+19
j uk.co.teamnomad.itunes.WindowsLibraryImpl.savePlaylist(Ljava/util/List;Luk/co/teamnomad/itunes/PlayList;)V+46
j uk.co.teamnomad.bpm.main.Main.<init>(Luk/co/teamnomad/bpm/system/OperatingSystem;)V+309
j uk.co.teamnomad.bpm.main.Main.getInstance()Luk/co/teamnomad/bpm/main/Main;+16
j uk.co.teamnomad.bpm.main.Main.main([Ljava/lang/String;)V+8
v ~StubRoutines::call_stub
V [jvm.dll+0xecfac]
V [jvm.dll+0x1741d1]
V [jvm.dll+0xed02d]
V [jvm.dll+0xf5bf5]
V [jvm.dll+0xfd84d]
C [java.exe+0x2155]
C [java.exe+0x82ce]
C [kernel32.dll+0x44911]
C [ntdll.dll+0x3e4b6]
C [ntdll.dll+0x3e489]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j com.jacob.com.Variant.putVariantDispatch(Ljava/lang/Object;)V+0
j com.jacob.com.Variant.putObject(Ljava/lang/Object;)V+2
j com.jacob.com.VariantUtilities.populateVariant(Lcom/jacob/com/Variant;Ljava/lang/Object;Z)V+511
j com.jacob.com.VariantUtilities.objectToVariant(Ljava/lang/Object;)Lcom/jacob/com/Variant;+248
j com.jacob.com.VariantUtilities.objectsToVariants([Ljava/lang/Object;)[Lcom/jacob/com/Variant;+19
j com.jacob.com.Dispatch.invoke(Lcom/jacob/com/Dispatch;Ljava/lang/String;I[Ljava/lang/Object;[I)Lcom/jacob/com/Variant;+8
j com.jacob.com.Dispatch.put(Lcom/jacob/com/Dispatch;Ljava/lang/String;Ljava/lang/Object;)V+18
j com.dt.iTunesController.ITPlaylist.addTrack(Lcom/dt/iTunesController/ITTrack;)V+19
j uk.co.teamnomad.itunes.WindowsLibraryImpl.savePlaylist(Ljava/util/List;Luk/co/teamnomad/itunes/PlayList;)V+46
j uk.co.teamnomad.bpm.main.Main.<init>(Luk/co/teamnomad/bpm/system/OperatingSystem;)V+309
j uk.co.teamnomad.bpm.main.Main.getInstance()Luk/co/teamnomad/bpm/main/Main;+16
j uk.co.teamnomad.bpm.main.Main.main([Ljava/lang/String;)V+8
v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x043a4800 JavaThread "MerapiBridgeSocket" [_thread_in_native, id=3664, stack(0x04800000,0x04850000)]
0x01f4c800 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2440, stack(0x04160000,0x041b0000)]
0x01f47c00 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3628, stack(0x04110000,0x04160000)]
0x01f47400 JavaThread "Attach Listener" daemon [_thread_blocked, id=3584, stack(0x040c0000,0x04110000)]
0x01f3ac00 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2968, stack(0x04070000,0x040c0000)]
0x01ef8c00 JavaThread "Finalizer" daemon [_thread_blocked, id=3724, stack(0x04020000,0x04070000)]
0x01ef7800 JavaThread "Reference Handler" daemon [_thread_blocked, id=3324, stack(0x03fd0000,0x04020000)]
=>0x01ed1400 JavaThread "main" [_thread_in_native, id=3756, stack(0x003b0000,0x00400000)]
Other Threads:
0x01ef6000 VMThread [stack: 0x01180000,0x011d0000] [id=2836]
0x01f5f000 WatcherThread [stack: 0x041b0000,0x04200000] [id=3528]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap
def new generation total 960K, used 794K [0x24000000, 0x24100000, 0x244e0000)
eden space 896K, 81% used [0x24000000, 0x240b7510, 0x240e0000)
from space 64K, 95% used [0x240f0000, 0x240ff450, 0x24100000)
to space 64K, 0% used [0x240e0000, 0x240e0000, 0x240f0000)
tenured generation total 4096K, used 876K [0x244e0000, 0x248e0000, 0x28000000)
the space 4096K, 21% used [0x244e0000, 0x245bb318, 0x245bb400, 0x248e0000)
compacting perm gen total 12288K, used 4255K [0x28000000, 0x28c00000, 0x2c000000)
the space 12288K, 34% used [0x28000000, 0x28427cb8, 0x28427e00, 0x28c00000)
ro space 8192K, 63% used [0x2c000000, 0x2c519920, 0x2c519a00, 0x2c800000)
rw space 12288K, 53% used [0x2c800000, 0x2ce74dd0, 0x2ce74e00, 0x2d400000)
Dynamic libraries:
0x00400000 - 0x00424000 C:\Windows\system32\java.exe
0x771a0000 - 0x772c7000 C:\Windows\system32\ntdll.dll
0x75a20000 - 0x75afb000 C:\Windows\system32\kernel32.dll
0x75ee0000 - 0x75fa6000 C:\Windows\system32\ADVAPI32.dll
0x772e0000 - 0x773a3000 C:\Windows\system32\RPCRT4.dll
0x7c340000 - 0x7c396000 C:\Program Files\Java\jre6\bin\msvcr71.dll
0x6d800000 - 0x6da8b000 C:\Program Files\Java\jre6\bin\client\jvm.dll
0x77060000 - 0x770fd000 C:\Windows\system32\USER32.dll
0x773b0000 - 0x773fb000 C:\Windows\system32\GDI32.dll
0x744f0000 - 0x74522000 C:\Windows\system32\WINMM.dll
0x76f30000 - 0x76fda000 C:\Windows\system32\msvcrt.dll
0x76d20000 - 0x76e64000 C:\Windows\system32\ole32.dll
0x75d20000 - 0x75dad000 C:\Windows\system32\OLEAUT32.dll
0x744b0000 - 0x744e9000 C:\Windows\system32\OLEACC.dll
0x77100000 - 0x7711e000 C:\Windows\system32\IMM32.DLL
0x76c00000 - 0x76cc8000 C:\Windows\system32\MSCTF.dll
0x75820000 - 0x7584c000 C:\Windows\system32\apphelp.dll
0x772d0000 - 0x772d9000 C:\Windows\system32\LPK.DLL
0x77120000 - 0x7719d000 C:\Windows\system32\USP10.dll
0x6d7b0000 - 0x6d7bc000 C:\Program Files\Java\jre6\bin\verify.dll
0x6d330000 - 0x6d34f000 C:\Program Files\Java\jre6\bin\java.dll
0x6d290000 - 0x6d298000 C:\Program Files\Java\jre6\bin\hpi.dll
0x75a10000 - 0x75a17000 C:\Windows\system32\PSAPI.DLL
0x6d7f0000 - 0x6d7ff000 C:\Program Files\Java\jre6\bin\zip.dll
0x6d610000 - 0x6d623000 C:\Program Files\Java\jre6\bin\net.dll
0x76e70000 - 0x76e9d000 C:\Windows\system32\WS2_32.dll
0x75fb0000 - 0x75fb6000 C:\Windows\system32\NSI.dll
0x75030000 - 0x7506b000 C:\Windows\system32\mswsock.dll
0x75090000 - 0x75095000 C:\Windows\System32\wship6.dll
0x74cf0000 - 0x74cf5000 C:\Windows\System32\wshtcpip.dll
0x10000000 - 0x10019000 C:\Windows\System32\jacob-1.14.3-x86.dll
0x72640000 - 0x726db000 C:\Windows\WinSxS\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.1434_none_d08b6002442c891f\MSVCR80.dll
0x76ea0000 - 0x76f24000 C:\Windows\system32\CLBCatQ.DLL
0x74db0000 - 0x74deb000 C:\Windows\system32\rsaenh.dll
VM Arguments:
java_command: bpm-0.0.13-jar-with-dependencies.jar
Launcher Type: SUN_STANDARD
Environment Variables:
CLASSPATH=.;C:\Program Files\QuickTime\QTSystem\QTJava.zip
PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\QuickTime\QTSystem\
USERNAME=ed
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 6 Model 23 Stepping 6, GenuineIntel
--------------- S Y S T E M ---------------
OS: Windows Vista Build 6001 Service Pack 1
CPU:total 1 (2 cores per cpu, 1 threads per core) family 6 model 23 stepping 6, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1
Memory: 4k page, physical 2097151k(1656488k free), swap 4194303k(4092420k free)
vm_info: Java HotSpot(TM) Client VM (14.1-b02) for windows-x86 JRE (1.6.0_15-b03), built on Jul 25 2009 01:22:46 by "java_re" with MS VC++ 7.1
time: Mon Aug 31 20:14:48 2009
elapsed time: 7 seconds
What am I doing wrong ?
I havent done any iTunes stuff in Java for a while, but from what experience I have I remember that the interface can be rather fickle.
I don't have any definitive answer, but in attempt to provide at least a shot in the dark, maybe you should try casting the ITPlaylist you're working with to an ITUserPlaylist (if that's the correct type, of course) and then calling its addTrack method. That way you'd be using the function provided by the library, and if that doesn't work you can get in touch with the developer because there may be a more serious problem occurring.
From the dump you provided, it looks as though the underlying C in JACOB is trying to modify the equivalent ITPlaylist via the iTunes COM interface. This could be because of the way the inheritance is working? IE: ITPlaylist doesn't support addTrack (the underlying C is trying to call a nonexistent function) but ITUserPlaylist does? Just a thought.
Suggested correction:
public void addTrack(ITTrack track) {
ITPlaylistKind k = getKind();
if (k == ITPlaylistKindUser) {
Dispatch.put( ((ITUserPlaylist)this).object, "AddTrack", track);
} else
throw new UnsupportedOperationException("can only add track to user playlists - kind : " + k);
}
Again I'm certainly not the expert here so if anyone has any better ideas, please go ahead and post over me :)
Let me know if that offers you any success!
Edit
After re-reading my post, I realized I forgot this approach, which could arguably be better as it keeps the JACOB COM bridge out of the higher level stuff:
((ITUserPlaylist)this).addTrack(track);
The answer for me was to contact the developer of the library I was using, getting him to release a new version of the library. If you want to do this then use at least version 0.2, which will correctly differentiate between ITPlaylist objects and ITUserPlaylist ones, which (as mentioned by lurkingfridge79 are the only types of playlist that can have tracks added to them by the COM API.

Categories

Resources