Click here to Skip to main content
15,560,600 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have been trying data from C file to java using JNI. But, when I try to pass it, the following error occurs in eclipse.

# A fatal error has been detected by the Java Runtime Environment:
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x62349d97, pid=8260, tid=0x00000684
# JRE version: Java(TM) SE Runtime Environment (8.0_291-b10) (build 1.8.0_291-b10)
# Java VM: Java HotSpot(TM) Client VM (25.291-b10 mixed mode windows-x86 )
# Problematic frame:
# V  [jvm.dll+0x9d97]
# 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:
# 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 (0x010ff000):  JavaThread "main" [_thread_in_native, id=1668, stack(0x02a70000,0x02ac0000)]

siginfo: ExceptionCode=0xc0000005, writing address 0x0000018c

EAX=0x010ff101, EBX=0x00000000, ECX=0x011b2954, EDX=0x6241dbe0
ESP=0x02abf90c, EBP=0x02abf910, ESI=0x00000000, EDI=0x011b2aa4
EIP=0x62349d97, EFLAGS=0x00010246

Top of Stack: (sp=0x02abf90c)
0x02abf90c:   011b2954 02abf968 6241dc28 00000000
0x02abf91c:   00000006 02abfb78 02abf97c 14e90490
0x02abf92c:   cccccccc cccccccc cccccccc cccccccc
0x02abf93c:   cccccccc cccccccc cccccccc cccccccc
0x02abf94c:   cccccccc cccccccc cccccccc cccccccc
0x02abf95c:   00000000 cccccccc cccccccc 02abfb78
0x02abf96c:   6c541b14 011b2aa4 15304e4c 00000000
0x02abf97c:   010ff000 14e90490 14e90490 cccccccc 

Instructions: (pc=0x62349d97)
0x62349d77:   c4 04 8b 45 10 89 86 8c 01 00 00 5e 5d c3 cc cc
0x62349d87:   cc cc cc cc cc cc cc cc cc 55 8b ec 56 8b 75 08
0x62349d97:   c7 86 8c 01 00 00 05 00 00 00 8b 0d 04 b7 6d 62
0x62349da7:   a0 e7 b0 6d 62 83 f9 01 75 04 84 c0 74 22 80 3d 

Register to memory mapping:

EAX=0x010ff101 is an unknown value
EBX=0x00000000 is an unknown value
ECX=0x011b2954 is an unknown value
EDX=0x6241dbe0 is an unknown value
ESP=0x02abf90c is pointing into the stack for thread: 0x010ff000
EBP=0x02abf910 is pointing into the stack for thread: 0x010ff000
ESI=0x00000000 is an unknown value
EDI=0x011b2aa4 is an unknown value

Stack: [0x02a70000,0x02ac0000],  sp=0x02abf90c,  free space=318k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [jvm.dll+0x9d97]
V  [jvm.dll+0xddc28]
C  [WindowsServiceList.dll+0x11b14]  Java_Main_service+0x464
j  Main.service(Ljava/util/HashMap;)V+0
j  Main.main([Ljava/lang/String;)V+9
v  ~StubRoutines::call_stub
V  [jvm.dll+0x1658b4]
V  [jvm.dll+0x23656b]
V  [jvm.dll+0x16545a]
V  [jvm.dll+0xebd95]
V  [jvm.dll+0xe4616]
C  [javaw.exe+0x2322]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  Main.service(Ljava/util/HashMap;)V+0
j  Main.main([Ljava/lang/String;)V+9
v  ~StubRoutines::call_stub

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

Java Threads: ( => current thread )
  0x15320c00 JavaThread "Service Thread" daemon [_thread_blocked, id=9616, stack(0x15690000,0x156e0000)]
  0x011ce800 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=6840, stack(0x15600000,0x15650000)]
  0x011cd400 JavaThread "Attach Listener" daemon [_thread_blocked, id=8832, stack(0x15570000,0x155c0000)]
  0x011c9400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=9064, stack(0x154e0000,0x15530000)]
  0x152ff000 JavaThread "Finalizer" daemon [_thread_blocked, id=9860, stack(0x15220000,0x15270000)]
  0x011b7000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2916, stack(0x15190000,0x151e0000)]
=>0x010ff000 JavaThread "main" [_thread_in_native, id=1668, stack(0x02a70000,0x02ac0000)]

Other Threads:
  0x011b1000 VMThread [stack: 0x15100000,0x15150000] [id=7660]
  0x15330000 WatcherThread [stack: 0x15720000,0x15770000] [id=8816]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

 def new generation   total 4928K, used 534K [0x04c00000, 0x05150000, 0x0a150000)
  eden space 4416K,  12% used [0x04c00000, 0x04c85ac0, 0x05050000)
  from space 512K,   0% used [0x05050000, 0x05050000, 0x050d0000)
  to   space 512K,   0% used [0x050d0000, 0x050d0000, 0x05150000)
 tenured generation   total 10944K, used 0K [0x0a150000, 0x0ac00000, 0x14c00000)
   the space 10944K,   0% used [0x0a150000, 0x0a150000, 0x0a150200, 0x0ac00000)
 Metaspace       used 1634K, capacity 2244K, committed 2368K, reserved 4480K

Card table byte_map: [0x04b60000,0x04bf0000] byte_map_base: 0x04b3a000

Polling page: 0x01290000

CodeCache: size=32768Kb used=679Kb max_used=679Kb free=32088Kb
 bounds [0x02ae0000, 0x02b90000, 0x04ae0000]
 total_blobs=155 nmethods=17 adapters=70
 compilation: enabled

Compilation events (10 events):
Event: 0.118 Thread 0x011ce800   13             java.lang.CharacterDataLatin1::toLowerCase (39 bytes)
Event: 0.118 Thread 0x011ce800 nmethod 13 0x02b87f08 code [0x02b88000, 0x02b880e0]
Event: 0.118 Thread 0x011ce800   14             java.lang.AbstractStringBuilder::ensureCapacityInternal (27 bytes)
Event: 0.119 Thread 0x011ce800 nmethod 14 0x02b881c8 code [0x02b882e0, 0x02b884a8]
Event: 0.119 Thread 0x011ce800   15             java.lang.String::startsWith (72 bytes)
Event: 0.119 Thread 0x011ce800 nmethod 15 0x02b88588 code [0x02b88690, 0x02b887c0]
Event: 0.119 Thread 0x011ce800   16             java.lang.AbstractStringBuilder::append (29 bytes)
Event: 0.119 Thread 0x011ce800 nmethod 16 0x02b88908 code [0x02b88a20, 0x02b88c28]
Event: 0.119 Thread 0x011ce800   17    (336 bytes)
Event: 0.120 Thread 0x011ce800 nmethod 17 0x02b88dc8 code [0x02b88f70, 0x02b89638]

GC Heap History (0 events):
No events

Deoptimization events (0 events):
No events

Classes redefined (0 events):
No events

Internal exceptions (2 events):
Event: 0.043 Thread 0x010ff000 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.defineClass(Ljava/lang/String;[BII)Ljava/lang/Class; name or signature does not match> (0x04c06eb8) thrown at [C:\jenkins\workspace\8-2-build-windows-i586-cygwin\jdk8u291\1294\hotspot\src\
Event: 0.043 Thread 0x010ff000 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.prefetchRead(Ljava/lang/Object;J)V name or signature does not match> (0x04c07188) thrown at [C:\jenkins\workspace\8-2-build-windows-i586-cygwin\jdk8u291\1294\hotspot\src\share\vm\prims\jni

Events (10 events):
Event: 0.123 loading class java/lang/Void
Event: 0.123 loading class java/lang/Void done
Event: 0.123 loading class java/lang/ClassLoaderHelper
Event: 0.123 loading class java/lang/ClassLoaderHelper done
Event: 0.127 loading class java/util/HashMap$KeySet
Event: 0.127 loading class java/util/HashMap$KeySet done
Event: 0.128 loading class java/util/HashMap$KeyIterator
Event: 0.128 loading class java/util/HashMap$HashIterator
Event: 0.128 loading class java/util/HashMap$HashIterator done
Event: 0.128 loading class java/util/HashMap$KeyIterator done

Dynamic libraries:
0x00c60000 - 0x00c9f000 	C:\Program Files (x86)\Java\jre1.8.0_291\bin\javaw.exe
0x77280000 - 0x77423000 	C:\Windows\SYSTEM32\ntdll.dll
0x75db0000 - 0x75ea0000 	C:\Windows\System32\KERNEL32.DLL
0x75fd0000 - 0x761e4000 	C:\Windows\System32\KERNELBASE.dll
0x77050000 - 0x770ca000 	C:\Windows\System32\ADVAPI32.dll
0x75f10000 - 0x75fcf000 	C:\Windows\System32\msvcrt.dll
0x76730000 - 0x767a5000 	C:\Windows\System32\sechost.dll
0x751c0000 - 0x75280000 	C:\Windows\System32\RPCRT4.dll
0x75c10000 - 0x75da6000 	C:\Windows\System32\USER32.dll
0x75ef0000 - 0x75f08000 	C:\Windows\System32\win32u.dll
0x75ec0000 - 0x75ee3000 	C:\Windows\System32\GDI32.dll
0x75a50000 - 0x75b2c000 	C:\Windows\System32\gdi32full.dll
0x75b90000 - 0x75c0b000 	C:\Windows\System32\msvcp_win.dll
0x75760000 - 0x75880000 	C:\Windows\System32\ucrtbase.dll
0x74ef0000 - 0x75100000 	C:\Windows\WinSxS\\COMCTL32.dll
0x76210000 - 0x76235000 	C:\Windows\System32\IMM32.DLL
0x74060000 - 0x74073000 	C:\Program Files (x86)\Java\jre1.8.0_291\bin\vcruntime140.dll
0x6d1c0000 - 0x6d22f000 	C:\Program Files (x86)\Java\jre1.8.0_291\bin\msvcp140.dll
0x62340000 - 0x6271e000 	C:\Program Files (x86)\Java\jre1.8.0_291\bin\client\jvm.dll
0x77260000 - 0x77266000 	C:\Windows\System32\PSAPI.DLL
0x74000000 - 0x74008000 	C:\Windows\SYSTEM32\VERSION.dll
0x75100000 - 0x75128000 	C:\Windows\SYSTEM32\WINMM.dll
0x63cf0000 - 0x63cf8000 	C:\Windows\SYSTEM32\WSOCK32.dll
0x76e20000 - 0x76e83000 	C:\Windows\System32\WS2_32.dll
0x74be0000 - 0x74bef000 	C:\Windows\SYSTEM32\kernel.appcore.dll
0x74050000 - 0x7405d000 	C:\Program Files (x86)\Java\jre1.8.0_291\bin\verify.dll
0x6c570000 - 0x6c594000 	C:\Program Files (x86)\Java\jre1.8.0_291\bin\java.dll
0x6c550000 - 0x6c564000 	C:\Program Files (x86)\Java\jre1.8.0_291\bin\zip.dll
0x767b0000 - 0x76d63000 	C:\Windows\System32\SHELL32.dll
0x745d0000 - 0x74bd9000 	C:\Windows\SYSTEM32\
0x76390000 - 0x76612000 	C:\Windows\System32\combase.dll
0x745a0000 - 0x745c4000 	C:\Windows\SYSTEM32\Wldp.dll
0x76f40000 - 0x76fc7000 	C:\Windows\System32\SHCORE.dll
0x76e90000 - 0x76ed5000 	C:\Windows\System32\shlwapi.dll
0x74580000 - 0x74598000 	C:\Windows\SYSTEM32\profapi.dll
0x6c530000 - 0x6c550000 	C:\Users\HP\source\repos\WindowsServiceList\Debug\WindowsServiceList.dll
0x6c510000 - 0x6c52e000 	C:\Windows\SYSTEM32\VCRUNTIME140D.dll
0x621c0000 - 0x62336000 	C:\Windows\SYSTEM32\ucrtbased.dll
0x71c20000 - 0x71da8000 	C:\Windows\SYSTEM32\dbghelp.dll
0x75b30000 - 0x75b8d000 	C:\Windows\System32\bcryptPrimitives.dll

VM Arguments:
jvm_args: -Djava.library.path=C:\Users\HP\source\repos\WindowsServiceList\Debug -Dfile.encoding=Cp1252 
java_command: Main
java_class_path (initial): C:\Users\HP\eclipse-workspace\HostelBookings\build\classes;C:\mysql-connector-java-8.0.23\mysql-connector-java-8.0.23.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\annotations-api.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\catalina-ant.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\catalina-ha.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\catalina-ssi.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\catalina-storeconfig.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\catalina-tribes.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\catalina.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\ecj-4.18.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\el-api.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\jasper-el.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\jasper.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\jaspic-api.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\jsp-api.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\servlet-api.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\tomcat-api.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\tomcat-coyote.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\tomcat-dbcp.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\tomcat-i18n-cs.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\tomcat-i18n-de.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\tomcat-i18n-es.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\tomcat-i18n-fr.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\tomcat-i18n-ja.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\tomcat-i18n-ko.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\tomcat-i18n-pt-BR.jar;C:\Program Files\Apache Soft
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_201
PATH=C:/eclipse-jee-2021-03-R-win32-x86_64/eclipse//plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_15.0.2.v20210201-0955/jre/bin/server;C:/eclipse-jee-2021-03-R-win32-x86_64/eclipse//plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_15.0.2.v20210201-0955/jre/bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\dotnet\;C:\Program Files\Java\jdk-16\bin;C:\Program Files (x86)\Java\jre1.8.0_291;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;C:\Users\HP\AppData\Local\Microsoft\WindowsApps;C:\Users\HP\.dotnet\tools;C:\eclipse-jee-2021-03-R-win32-x86_64\eclipse;
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 58 Stepping 9, GenuineIntel

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

OS: Windows 10.0 , 64 bit Build 19041 (10.0.19041.928)

CPU:total 4 (initial active 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 4083996k(557396k free), swap 7885084k(2736268k free)

vm_info: Java HotSpot(TM) Client VM (25.291-b10) for windows-x86 JRE (1.8.0_291-b10), built on Apr  9 2021 04:22:09 by "java_re" with MS VC++ 15.9 (VS2017)

time: Fri May 14 21:23:15 2021
timezone: India Standard Time
elapsed time: 0.155701 seconds (0d 0h 0m 0s)

Can anyone tell me the reason and solution for this.

What I have tried:

I have tried updating my jre.
My java version:
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) Client VM (build 25.201-b09, mixed mode)

I'm developing a 32-bit application in visual studio 2019.
Updated 14-May-21 8:04am

1 solution

The cause is in the message :
writing address 0x0000018c
That is obviously an invalid address for a pointer.

There is another clue :
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  Main.service(Ljava/util/HashMap;)V+0
j  Main.main([Ljava/lang/String;)V+9
v  ~StubRoutines::call_stub
That tells you what was going on when the error happened.
Share this answer
[no name] 14-May-21 13:10pm    
So, what should I do now? I couldn't understand the meaning for these errors.
Rick York 14-May-21 15:47pm    
The message say you are not accessing the HashMap and String classes correctly. You have to sort that out.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900