Java Error with simxGetFloatSignal

Typically: "How do I... ", "How can I... " questions
Post Reply
blue

Java Error with simxGetFloatSignal

Post by blue » 05 Jul 2014, 14:02

Hey,
I am running V-REP on Windows via the Java Remote Api.
It works ind to send signals to V-REP with simxSetFloatSignal, but when I try to receive signals from V-REP with simxGetFloatSignal,
a fatal error occurs with the following message:


#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006599af45, pid=3636, tid=636
#
# JRE version: Java(TM) SE Runtime Environment (8.0_05-b13) (build 1.8.0_05-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.5-b02 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# V [jvm.dll+0x12af45]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\admin\java\NeuroCopter\hs_err_pid3636.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
#

What can I do to make it work? Any idea what the problem is?
This is the content of the error report file:

Code: Select all

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006599af45, pid=3636, tid=636
#
# JRE version: Java(TM) SE Runtime Environment (8.0_05-b13) (build 1.8.0_05-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.5-b02 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# V  [jvm.dll+0x12af45]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
#

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

Current thread (0x0000000001ddd800):  JavaThread "main" [_thread_in_vm, id=636, stack(0x0000000002340000,0x0000000002440000)]

siginfo: ExceptionCode=0xc0000005, reading address 0x0000000000000000

Registers:
RAX=0x0000000000000000, RBX=0x0000000001ddd800, RCX=0x0000000000000d80, RDX=0x0000000000000000
RSP=0x000000000243f210, RBP=0x0000000056acd830, RSI=0x0000000001ddd9e0, RDI=0x0000000000000000
R8 =0x0000000000000000, R9 =0x000000000000000b, R10=0x000000000044b930, R11=0x0000000000000246
R12=0x0000000000000000, R13=0x0000000054a79068, R14=0x000000000243f358, R15=0x0000000001ddd800
RIP=0x000000006599af45, EFLAGS=0x0000000000010202

Top of Stack: (sp=0x000000000243f210)
0x000000000243f210:   0000000000459b70 000007fef4502500
0x000000000243f220:   000007fef4500500 0000000000000000
0x000000000243f230:   0000000001ddd800 0000000000000000
0x000000000243f240:   0000000054a79068 0000000000000000
0x000000000243f250:   0000000000000000 000007fef44e013d
0x000000000243f260:   0000000000000000 0000000056acd830
0x000000000243f270:   0000000001ddd9e0 0000000001ddd800
0x000000000243f280:   0000000056acd830 000000000243f2c8
0x000000000243f290:   000000000243f368 0000000002722ece
0x000000000243f2a0:   0000000054a79068 000000000243f328
0x000000000243f2b0:   0000000020200021 0000000002717380
0x000000000243f2c0:   0000000000000000 0000000040c83705
0x000000000243f2d0:   0000000020200021 0000000001ddd800
0x000000000243f2e0:   0000000002722bfc 000000000243f2e8
0x000000000243f2f0:   0000000054a79068 000000000243f368
0x000000000243f300:   0000000054a79de0 0000000000000000 

Instructions: (pc=0x000000006599af45)
0x000000006599af25:   89 5c 24 20 48 c7 44 24 28 00 00 00 00 74 0a 48
0x000000006599af35:   8d 4c 24 20 e8 52 10 13 00 80 3d b4 d3 67 00 00
0x000000006599af45:   48 8b 17 74 15 8b 52 08 8b 0d 05 83 61 00 48 d3
0x000000006599af55:   e2 48 03 15 f3 82 61 00 eb 04 48 8b 52 08 48 8b 


Register to memory mapping:

RAX=0x0000000000000000 is an unknown value
RBX=0x0000000001ddd800 is a thread
RCX=0x0000000000000d80 is an unknown value
RDX=0x0000000000000000 is an unknown value
RSP=0x000000000243f210 is pointing into the stack for thread: 0x0000000001ddd800
RBP=0x0000000056acd830 is an unknown value
RSI=0x0000000001ddd9e0 is an unknown value
RDI=0x0000000000000000 is an unknown value
R8 =0x0000000000000000 is an unknown value
R9 =0x000000000000000b is an unknown value
R10=0x000000000044b930 is an unknown value
R11=0x0000000000000246 is an unknown value
R12=0x0000000000000000 is an unknown value
R13=0x0000000054a79068 is an unknown value
R14=0x000000000243f358 is pointing into the stack for thread: 0x0000000001ddd800
R15=0x0000000001ddd800 is a thread


Stack: [0x0000000002340000,0x0000000002440000],  sp=0x000000000243f210,  free space=1020k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [jvm.dll+0x12af45]
C  [remoteApiJava.dll+0x1013d]
C  0x0000000002722ece

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  coppelia.remoteApi.simxGetFloatSignal(ILjava/lang/String;Lcoppelia/FloatW;I)I+0
j  RNNTraining.Test.main([Ljava/lang/String;)V+281
v  ~StubRoutines::call_stub

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

Java Threads: ( => current thread )
  0x0000000056a32800 JavaThread "Service Thread" daemon [_thread_blocked, id=5464, stack(0x0000000056e20000,0x0000000056f20000)]
  0x000000005506c800 JavaThread "C1 CompilerThread2" daemon [_thread_blocked, id=5012, stack(0x00000000562e0000,0x00000000563e0000)]
  0x000000005506b800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=4948, stack(0x00000000568e0000,0x00000000569e0000)]
  0x0000000055063800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=4964, stack(0x00000000567d0000,0x00000000568d0000)]
  0x0000000055062000 JavaThread "Attach Listener" daemon [_thread_blocked, id=1324, stack(0x0000000056600000,0x0000000056700000)]
  0x000000005505f000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=5236, stack(0x0000000056450000,0x0000000056550000)]
  0x0000000055002000 JavaThread "Finalizer" daemon [_thread_blocked, id=4688, stack(0x00000000561d0000,0x00000000562d0000)]
  0x0000000054ff8800 JavaThread "Reference Handler" daemon [_thread_blocked, id=6036, stack(0x00000000560b0000,0x00000000561b0000)]
=>0x0000000001ddd800 JavaThread "main" [_thread_in_vm, id=636, stack(0x0000000002340000,0x0000000002440000)]

Other Threads:
  0x0000000054ff5000 VMThread [stack: 0x0000000055f00000,0x0000000056000000] [id=2540]
  0x0000000056a55800 WatcherThread [stack: 0x00000000570c0000,0x00000000571c0000] [id=2116]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap:
 PSYoungGen      total 1024K, used 740K [0x00000000ebb80000, 0x00000000ebd80000, 0x0000000100000000)
  eden space 512K, 47% used [0x00000000ebb80000,0x00000000ebbbd1c8,0x00000000ebc00000)
  from space 512K, 96% used [0x00000000ebc00000,0x00000000ebc7c010,0x00000000ebc80000)
  to   space 512K, 0% used [0x00000000ebd00000,0x00000000ebd00000,0x00000000ebd80000)
 ParOldGen       total 61952K, used 8K [0x00000000c3200000, 0x00000000c6e80000, 0x00000000ebb80000)
  object space 61952K, 0% used [0x00000000c3200000,0x00000000c3202000,0x00000000c6e80000)
 Metaspace       used 2829K, capacity 4560K, committed 4864K, reserved 1056768K
  class space    used 316K, capacity 388K, committed 512K, reserved 1048576K

Card table byte_map: [0x0000000011ad0000,0x0000000011cc0000] byte_map_base: 0x00000000114b7000

Marking Bits: (ParMarkBitMap*) 0x00000000660213b0
 Begin Bits: [0x0000000012610000, 0x0000000013548000)
 End Bits:   [0x0000000013548000, 0x0000000014480000)

Polling page: 0x0000000000120000

CodeCache: size=245760Kb used=1166Kb max_used=1166Kb free=244593Kb
 bounds [0x0000000002710000, 0x0000000002980000, 0x0000000011710000]
 total_blobs=302 nmethods=50 adapters=167
 compilation: enabled

Compilation events (10 events):
Event: 0.141 Thread 0x000000005506c800   46       3       java.lang.System::getSecurityManager (4 bytes)
Event: 0.141 Thread 0x000000005506c800 nmethod 46 0x0000000002832650 code [0x00000000028327a0, 0x00000000028328d0]
Event: 0.142 Thread 0x000000005506c800   47       3       java.lang.AbstractStringBuilder::append (50 bytes)
Event: 0.143 Thread 0x000000005506c800 nmethod 47 0x0000000002831e90 code [0x0000000002832020, 0x0000000002832488]
Event: 0.143 Thread 0x000000005506c800   48       3       java.util.HashMap::newNode (13 bytes)
Event: 0.143 Thread 0x000000005506c800 nmethod 48 0x0000000002831950 code [0x0000000002831ac0, 0x0000000002831d50]
Event: 0.143 Thread 0x000000005506c800   49       3       java.util.HashMap::afterNodeInsertion (1 bytes)
Event: 0.143 Thread 0x000000005506c800 nmethod 49 0x0000000002831650 code [0x00000000028317a0, 0x00000000028318f0]
Event: 7.361 Thread 0x000000005506c800   50       3       java.lang.String::startsWith (72 bytes)
Event: 7.361 Thread 0x000000005506c800 nmethod 50 0x00000000028331d0 code [0x0000000002833340, 0x0000000002833670]

GC Heap History (2 events):
Event: 0.111 GC heap before
{Heap before GC invocations=1 (full 0):
 PSYoungGen      total 1024K, used 512K [0x00000000ebb80000, 0x00000000ebd00000, 0x0000000100000000)
  eden space 512K, 100% used [0x00000000ebb80000,0x00000000ebc00000,0x00000000ebc00000)
  from space 512K, 0% used [0x00000000ebc80000,0x00000000ebc80000,0x00000000ebd00000)
  to   space 512K, 0% used [0x00000000ebc00000,0x00000000ebc00000,0x00000000ebc80000)
 ParOldGen       total 61952K, used 0K [0x00000000c3200000, 0x00000000c6e80000, 0x00000000ebb80000)
  object space 61952K, 0% used [0x00000000c3200000,0x00000000c3200000,0x00000000c6e80000)
 Metaspace       used 2452K, capacity 4480K, committed 4480K, reserved 1056768K
  class space    used 273K, capacity 384K, committed 384K, reserved 1048576K
Event: 0.114 GC heap after
Heap after GC invocations=1 (full 0):
 PSYoungGen      total 1024K, used 496K [0x00000000ebb80000, 0x00000000ebd80000, 0x0000000100000000)
  eden space 512K, 0% used [0x00000000ebb80000,0x00000000ebb80000,0x00000000ebc00000)
  from space 512K, 96% used [0x00000000ebc00000,0x00000000ebc7c010,0x00000000ebc80000)
  to   space 512K, 0% used [0x00000000ebd00000,0x00000000ebd00000,0x00000000ebd80000)
 ParOldGen       total 61952K, used 8K [0x00000000c3200000, 0x00000000c6e80000, 0x00000000ebb80000)
  object space 61952K, 0% used [0x00000000c3200000,0x00000000c3202000,0x00000000c6e80000)
 Metaspace       used 2452K, capacity 4480K, committed 4480K, reserved 1056768K
  class space    used 273K, capacity 384K, committed 384K, reserved 1048576K
}

Deoptimization events (0 events):
No events

Internal exceptions (5 events):
Event: 0.036 Thread 0x0000000001ddd800 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.defineClass(Ljava/lang/String;[BII)Ljava/lang/Class; name or signature does not match> (0x00000000ebb8eb10) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u5\2488\hotspot\srcƒQV_€¢?
Event: 0.036 Thread 0x0000000001ddd800 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.prefetchRead(Ljava/lang/Object;J)V name or signature does not match> (0x00000000ebb8eda0) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u5\2488\hotspot\src\share\vm\prims\jnüÖûùz>À?
Event: 0.127 Thread 0x0000000001ddd800 Exception <a 'java/security/PrivilegedActionException'> (0x00000000ebb98ca8) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u5\2488\hotspot\src\share\vm\prims\jvm.cpp, line 1248]
Event: 0.142 Thread 0x0000000001ddd800 Exception <a 'java/security/PrivilegedActionException'> (0x00000000ebba6230) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u5\2488\hotspot\src\share\vm\prims\jvm.cpp, line 1248]
Event: 7.360 Thread 0x0000000001ddd800 Exception <a 'java/security/PrivilegedActionException'> (0x00000000ebbbbc78) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u5\2488\hotspot\src\share\vm\prims\jvm.cpp, line 1248]

Events (10 events):
Event: 0.142 loading class coppelia/remoteApi
Event: 0.142 loading class coppelia/remoteApi done
Event: 0.144 loading class java/lang/ClassLoaderHelper
Event: 0.145 loading class java/lang/ClassLoaderHelper done
Event: 4.190 Executing VM operation: EnableBiasedLocking
Event: 4.191 Executing VM operation: EnableBiasedLocking done
Event: 5.360 loading class java/util/concurrent/ConcurrentHashMap$ForwardingNode
Event: 5.360 loading class java/util/concurrent/ConcurrentHashMap$ForwardingNode done
Event: 7.360 loading class coppelia/FloatW
Event: 7.360 loading class coppelia/FloatW done


Dynamic libraries:
0x000000013f990000 - 0x000000013f9c4000 	C:\Program Files\Java\jre8\bin\javaw.exe
0x0000000076cf0000 - 0x0000000076e99000 	C:\Windows\SYSTEM32\ntdll.dll
0x0000000076bd0000 - 0x0000000076cef000 	C:\Windows\system32\kernel32.dll
0x000007fefcd70000 - 0x000007fefcddc000 	C:\Windows\system32\KERNELBASE.dll
0x000007fefd670000 - 0x000007fefd74b000 	C:\Windows\system32\ADVAPI32.dll
0x000007fefdd40000 - 0x000007fefdddf000 	C:\Windows\system32\msvcrt.dll
0x000007fefd650000 - 0x000007fefd66f000 	C:\Windows\SYSTEM32\sechost.dll
0x000007fefd900000 - 0x000007fefda2d000 	C:\Windows\system32\RPCRT4.dll
0x0000000076ad0000 - 0x0000000076bca000 	C:\Windows\system32\USER32.dll
0x000007fefef80000 - 0x000007fefefe7000 	C:\Windows\system32\GDI32.dll
0x000007fefeff0000 - 0x000007fefeffe000 	C:\Windows\system32\LPK.dll
0x000007fefeb70000 - 0x000007fefec39000 	C:\Windows\system32\USP10.dll
0x000007fefb1c0000 - 0x000007fefb3b4000 	C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_fa396087175ac9ac\COMCTL32.dll
0x000007fefef00000 - 0x000007fefef71000 	C:\Windows\system32\SHLWAPI.dll
0x000007fefd8d0000 - 0x000007fefd8fe000 	C:\Windows\system32\IMM32.DLL
0x000007fefd220000 - 0x000007fefd329000 	C:\Windows\system32\MSCTF.dll
0x00000000660a0000 - 0x0000000066172000 	C:\Program Files\Java\jre8\bin\msvcr100.dll
0x0000000065870000 - 0x000000006609a000 	C:\Program Files\Java\jre8\bin\server\jvm.dll
0x000007feeea00000 - 0x000007feeea09000 	C:\Windows\system32\WSOCK32.dll
0x000007fefd3d0000 - 0x000007fefd41d000 	C:\Windows\system32\WS2_32.dll
0x000007fefec40000 - 0x000007fefec48000 	C:\Windows\system32\NSI.dll
0x000007fefaa60000 - 0x000007fefaa9b000 	C:\Windows\system32\WINMM.dll
0x0000000076ec0000 - 0x0000000076ec7000 	C:\Windows\system32\PSAPI.DLL
0x0000000066250000 - 0x000000006625f000 	C:\Program Files\Java\jre8\bin\verify.dll
0x0000000066220000 - 0x0000000066248000 	C:\Program Files\Java\jre8\bin\java.dll
0x0000000066200000 - 0x0000000066216000 	C:\Program Files\Java\jre8\bin\zip.dll
0x000007fefdde0000 - 0x000007fefeb68000 	C:\Windows\system32\SHELL32.dll
0x000007fefec50000 - 0x000007fefee53000 	C:\Windows\system32\ole32.dll
0x000007fefcb30000 - 0x000007fefcb3f000 	C:\Windows\system32\profapi.dll
0x000007fefc960000 - 0x000007fefc9b7000 	C:\Windows\system32\apphelp.dll
0x000007fef44d0000 - 0x000007fef450d000 	C:\Windows\System32\remoteApiJava.dll
0x000007fefc300000 - 0x000007fefc355000 	C:\Windows\system32\mswsock.dll
0x000007fefbce0000 - 0x000007fefbce7000 	C:\Windows\System32\wshtcpip.dll
0x000007fefa6d0000 - 0x000007fefa6e5000 	C:\Windows\system32\NLAapi.dll
0x000007feeafa0000 - 0x000007feeafb5000 	C:\Windows\system32\napinsp.dll
0x000007feeafc0000 - 0x000007feeafd9000 	C:\Windows\system32\pnrpnsp.dll
0x000007fefc180000 - 0x000007fefc1db000 	C:\Windows\system32\DNSAPI.dll
0x000007feeaf90000 - 0x000007feeaf9b000 	C:\Windows\System32\winrnr.dll
0x000000006f4f0000 - 0x000000006f516000 	C:\Program Files\Bonjour\mdnsNSP.dll
0x000007fefa280000 - 0x000007fefa2a7000 	C:\Windows\system32\Iphlpapi.DLL
0x000007fefa270000 - 0x000007fefa27b000 	C:\Windows\system32\WINNSI.DLL
0x000007fef42f0000 - 0x000007fef4300000 	C:\Windows\system32\wshbth.dll
0x000007feead00000 - 0x000007feeae25000 	C:\Windows\system32\dbghelp.dll

VM Arguments:
jvm_args: -Dfile.encoding=Cp1252 
java_command: RNNTraining.Test
java_class_path (initial): C:\Users\admin\java\NeuroCopter\bin;C:\Users\admin\java\NeuroCopter\jannlab-0.20-alpha.jar
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 (x86)\Lenovo\Access Connections\;C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\
USERNAME=admin
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 37 Stepping 2, 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 37 stepping 2, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, aes, clmul, ht, tsc, tscinvbit

Memory: 4k page, physical 3985064k(2165684k free), swap 7968264k(5346836k free)

vm_info: Java HotSpot(TM) 64-Bit Server VM (25.5-b02) for windows-amd64 JRE (1.8.0_05-b13), built on Mar 18 2014 01:08:39 by "java_re" with MS VC++ 10.0 (VS2010)

time: Sat Jul 05 14:53:25 2014
elapsed time: 7 seconds

coppelia
Site Admin
Posts: 6261
Joined: 14 Dec 2012, 00:25

Re: Java Error with simxGetFloatSignal

Post by coppelia » 06 Jul 2014, 00:49

Hello,

can you tell me what V-REP version you are using?
And what is the exact call that brings the remote API to crash?

Cheers

blue

Re: Java Error with simxGetFloatSignal

Post by blue » 06 Jul 2014, 10:23

I am using V-REP 3.1.2
This is the call:

Code: Select all

FloatW[] PIDSignal = new FloatW[4];
vrep.simxGetFloatSignal(clientID,"PIDSignal1",PIDSignal[0], remoteApi.simx_opmode_oneshot_wait);
I checked it with the signal monitor, the signal is set. Even if I set the signal to a value with simxSetFloatSignal right before that call, it crashed, though it works to only set the signal.

coppelia
Site Admin
Posts: 6261
Joined: 14 Dec 2012, 00:25

Re: Java Error with simxGetFloatSignal

Post by coppelia » 06 Jul 2014, 21:43

try with:

Code: Select all

float[] PIDSignal = new float[4];
FloatW tmp=new FloatW(0);
vrep.simxGetFloatSignal(clientID,"PIDSignal1",tmp,remoteApi.simx_opmode_oneshot_wait);
PIDSignal[0]=tmp.getValue();
Cheers

blue

Re: Java Error with simxGetFloatSignal

Post by blue » 06 Jul 2014, 21:52

That works fine! Thank you!

johnsonjeven
Posts: 1
Joined: 13 Dec 2017, 06:21

Re: Java Error with simxGetFloatSignal

Post by johnsonjeven » 13 Dec 2017, 07:51

Java applications are only allowed to use a limited amount of memory. This limit is specified during application startup. Java heap space indicates object could not be allocated in the Java heap. With -Xmx you can configure more memory for you JVM. To be sure that you don't leak or waste memory.

example

Starting a JVM like below will start it with 256MB of memory, and will allow the process to use up to 2048MB of memory:

java -Xmx2048m -Xms256m

Post Reply