Crashing with IEventReceiver

Discussion about Irrlicht's Java wrapper
Post Reply
Darth Android
Posts: 2
Joined: Mon Mar 26, 2007 2:15 am

Crashing with IEventReceiver

Post by Darth Android »

Just started playing around with Jirr/IrrLicht a couple days ago and for some reason can't get it to register an IEventReceiver properly. The following error is thrown:

Code: Select all

TEST
TEST2
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x02e694b8, pid=2556, tid=3692
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing)
# Problematic frame:
# C  [irrlicht_wrap.dll+0x494b8]
#
# An error report file with more information is saved as hs_err_pid2556.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
Irrlicht Engine version 1.2
Microsoft Windows XP Professional Service Pack 2 (Build 2600)
Using renderer: OpenGL 1.4.0
Intel 945GM: Intel
OpenGL driver version is 1.2 or better.
I am using Java 6.0 in Eclipse 3.2.2
The TEST and TEST2 printouts indicate that my OnEvent(SEvent) method runs in it's entirety, and the engine is crashing at some point after that. Eclipse is unable to debug to the error, which seems to indicate an exception thrown from native code.

In my code I've only been messing around with GUI stuff, no 3D is in use other than the basic initialization required to get GUI working. Everything works until I added the handler. All that I've made in the GUI so far is a window, two buttons, two editboxes, and two labels.

All help is welcome.
Frodenius
Posts: 64
Joined: Sun Aug 29, 2004 11:24 am
Location: Germany/Frankfurt
Contact:

Post by Frodenius »

the vm did a more detailed description of the error (.log) please post it. or at least the call stack.
worst programming style ever seen...
Darth Android
Posts: 2
Joined: Mon Mar 26, 2007 2:15 am

Post by Darth Android »

Oops, sorry. Here:

Code: Select all

#
# An unexpected error has been detected by Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x02e694b8, pid=2556, tid=3692
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing)
# Problematic frame:
# C  [irrlicht_wrap.dll+0x494b8]
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

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

Current thread (0x00846400):  JavaThread "main" [_thread_in_native, id=3692]

siginfo: ExceptionCode=0xc0000005, reading address 0x000000cd

Registers:
EAX=0x00000000, EBX=0x281142d8, ECX=0x000000cd, EDX=0x28117530
ESP=0x0092f300, EBP=0x0092f308, ESI=0x00000000, EDI=0x00846400
EIP=0x02e694b8, EFLAGS=0x00010202

Top of Stack: (sp=0x0092f300)
0x0092f300:   281142d8 281142d8 0092f344 0096a460
0x0092f310:   008464e8 0092f34c 000000cd 00000000
0x0092f320:   0092f34c 0092f324 00000000 0092f358
0x0092f330:   28117530 00000000 281142d8 00000000
0x0092f340:   0092f354 0092f380 00962d53 281174d0
0x0092f350:   00968419 000000cd 00000000 240e5d68
0x0092f360:   0092f360 2814281a 0092f394 2814c3d0
0x0092f370:   00000000 28142830 0092f354 0092f388 

Instructions: (pc=0x02e694b8)
0x02e694a8:   8b 4d 10 89 74 24 04 31 f6 85 c9 89 1c 24 74 09
0x02e694b8:   8b 01 8b 50 f4 01 d1 89 c8 89 f2 8b 1c 24 8b 74 


Stack: [0x008e0000,0x00930000),  sp=0x0092f300,  free space=316k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [irrlicht_wrap.dll+0x494b8]
j  net.sf.jirr.JirrJNI.SWIGIGUIElementUpcast(J)J+0
j  net.sf.jirr.IGUIElement.<init>(JZ)V+2
j  net.sf.jirr.SEvent.getGUIEventCaller()Lnet/sf/jirr/IGUIElement;+24
j  org.dragonfire.cear.client.GUIManager.OnEvent(Lnet/sf/jirr/SEvent;)Z+1
j  net.sf.jirr.JirrJNI.SwigDirector_IEventReceiver_OnEvent(Lnet/sf/jirr/IEventReceiver;J)Z+10
v  ~StubRoutines::call_stub

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  net.sf.jirr.JirrJNI.SWIGIGUIElementUpcast(J)J+0
j  net.sf.jirr.IGUIElement.<init>(JZ)V+2
j  net.sf.jirr.SEvent.getGUIEventCaller()Lnet/sf/jirr/IGUIElement;+24
j  org.dragonfire.cear.client.GUIManager.OnEvent(Lnet/sf/jirr/SEvent;)Z+1
j  net.sf.jirr.JirrJNI.SwigDirector_IEventReceiver_OnEvent(Lnet/sf/jirr/IEventReceiver;J)Z+10
v  ~StubRoutines::call_stub
j  net.sf.jirr.JirrJNI.IrrlichtDevice_run(J)Z+0
j  net.sf.jirr.IrrlichtDevice.run()Z+4
j  org.dragonfire.cear.client.Client.run()V+72
j  org.dragonfire.cear.client.Client.main([Ljava/lang/String;)V+9
v  ~StubRoutines::call_stub

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

Java Threads: ( => current thread )
  0x0b678000 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=2216]
  0x02b46800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=1980]
  0x02b45c00 JavaThread "AWT-Shutdown" [_thread_blocked, id=2532]
  0x02b44000 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3956]
  0x02acd400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=964]
  0x02ac9400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2976]
  0x02ac7400 JavaThread "Attach Listener" daemon [_thread_blocked, id=3028]
  0x02ac6800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=3748]
  0x02ac1800 JavaThread "Finalizer" daemon [_thread_blocked, id=3820]
  0x02abd400 JavaThread "Reference Handler" daemon [_thread_blocked, id=3228]
=>0x00846400 JavaThread "main" [_thread_in_native, id=3692]

Other Threads:
  0x02ab4000 VMThread [id=3984]
  0x02acf400 WatcherThread [id=1316]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 def new generation   total 960K, used 547K [0x24070000, 0x24170000, 0x24550000)
  eden space 896K,  53% used [0x24070000, 0x240e8e78, 0x24150000)
  from space 64K, 100% used [0x24150000, 0x24160000, 0x24160000)
  to   space 64K,   0% used [0x24160000, 0x24160000, 0x24170000)
 tenured generation   total 4096K, used 540K [0x24550000, 0x24950000, 0x28070000)
   the space 4096K,  13% used [0x24550000, 0x245d71c8, 0x245d7200, 0x24950000)
 compacting perm gen  total 12288K, used 901K [0x28070000, 0x28c70000, 0x2c070000)
   the space 12288K,   7% used [0x28070000, 0x281517f0, 0x28151800, 0x28c70000)
    ro space 8192K,  66% used [0x2c070000, 0x2c5b9920, 0x2c5b9a00, 0x2c870000)
    rw space 12288K,  52% used [0x2c870000, 0x2ceb6130, 0x2ceb6200, 0x2d470000)

Dynamic libraries:
0x00400000 - 0x00423000 	C:\Program Files\Java\jdk1.6.0\bin\javaw.exe
0x7c900000 - 0x7c9b0000 	C:\WINDOWS\system32\ntdll.dll
0x7c800000 - 0x7c8f4000 	C:\WINDOWS\system32\kernel32.dll
0x77dd0000 - 0x77e6b000 	C:\WINDOWS\system32\ADVAPI32.dll
0x77e70000 - 0x77f01000 	C:\WINDOWS\system32\RPCRT4.dll
0x77d40000 - 0x77dd0000 	C:\WINDOWS\system32\USER32.dll
0x77f10000 - 0x77f57000 	C:\WINDOWS\system32\GDI32.dll
0x10000000 - 0x10063000 	C:\WINDOWS\system32\wxvault.dll
0x76bf0000 - 0x76bfb000 	C:\WINDOWS\system32\PSAPI.DLL
0x71b20000 - 0x71b32000 	C:\WINDOWS\system32\MPR.dll
0x77c00000 - 0x77c08000 	C:\WINDOWS\system32\VERSION.dll
0x77f60000 - 0x77fd6000 	C:\WINDOWS\system32\SHLWAPI.dll
0x77c10000 - 0x77c68000 	C:\WINDOWS\system32\msvcrt.dll
0x00360000 - 0x00365000 	C:\WINDOWS\system32\detoured.dll
0x7c9c0000 - 0x7d1d5000 	C:\WINDOWS\system32\SHELL32.dll
0x773d0000 - 0x774d3000 	C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2982_x-ww_ac3f9c03\comctl32.dll
0x5d090000 - 0x5d12a000 	C:\WINDOWS\system32\comctl32.dll
0x7c340000 - 0x7c396000 	C:\Program Files\Java\jdk1.6.0\jre\bin\msvcr71.dll
0x6d7c0000 - 0x6da07000 	C:\Program Files\Java\jdk1.6.0\jre\bin\client\jvm.dll
0x76b40000 - 0x76b6d000 	C:\WINDOWS\system32\WINMM.dll
0x6d310000 - 0x6d318000 	C:\Program Files\Java\jdk1.6.0\jre\bin\hpi.dll
0x6d770000 - 0x6d77c000 	C:\Program Files\Java\jdk1.6.0\jre\bin\verify.dll
0x6d3b0000 - 0x6d3cf000 	C:\Program Files\Java\jdk1.6.0\jre\bin\java.dll
0x6d7b0000 - 0x6d7bf000 	C:\Program Files\Java\jdk1.6.0\jre\bin\zip.dll
0x02e20000 - 0x02ee7000 	C:\Documents and Settings\Darth Android\My Documents\sync\java\libraries\Jirr\irrlicht_wrap.dll
0x02ef0000 - 0x03245000 	C:\Documents and Settings\Darth Android\My Documents\sync\java\workspace\Cear\Irrlicht.dll
0x5ed00000 - 0x5edcc000 	C:\WINDOWS\system32\OPENGL32.DLL
0x68b20000 - 0x68b40000 	C:\WINDOWS\system32\GLU32.dll
0x73760000 - 0x737a9000 	C:\WINDOWS\system32\DDRAW.dll
0x73bc0000 - 0x73bc6000 	C:\WINDOWS\system32\DCIMAN32.dll
0x03250000 - 0x03301000 	C:\Documents and Settings\Darth Android\My Documents\sync\java\workspace\Cear\d3dx81ab.DLL
0x6d000000 - 0x6d1c3000 	C:\Program Files\Java\jdk1.6.0\jre\bin\awt.dll
0x73000000 - 0x73026000 	C:\WINDOWS\system32\WINSPOOL.DRV
0x76390000 - 0x763ad000 	C:\WINDOWS\system32\IMM32.dll
0x774e0000 - 0x7761c000 	C:\WINDOWS\system32\ole32.dll
0x5ad70000 - 0x5ada8000 	C:\WINDOWS\system32\uxtheme.dll
0x6d2b0000 - 0x6d303000 	C:\Program Files\Java\jdk1.6.0\jre\bin\fontmanager.dll
0x74720000 - 0x7476b000 	C:\WINDOWS\system32\MSCTF.dll
0x0b5f0000 - 0x0b603000 	C:\Program Files\powermenu\PowerMenuHook.dll
0x6d570000 - 0x6d583000 	C:\Program Files\Java\jdk1.6.0\jre\bin\net.dll
0x71ab0000 - 0x71ac7000 	C:\WINDOWS\system32\WS2_32.dll
0x71aa0000 - 0x71aa8000 	C:\WINDOWS\system32\WS2HELP.dll
0x6d590000 - 0x6d599000 	C:\Program Files\Java\jdk1.6.0\jre\bin\nio.dll
0x605d0000 - 0x605d9000 	C:\WINDOWS\system32\mslbui.dll
0x0b980000 - 0x0bbb8000 	C:\WINDOWS\system32\iglicd32.dll
0x0bc50000 - 0x0bcd2000 	C:\WINDOWS\system32\igldev32.dll

VM Arguments:
jvm_args: -Djava.library.path=C:\Documents and Settings\Darth Android\My Documents\sync\java\libraries\Jirr;C:\Documents and Settings\Darth Android\My Documents\sync\java\libraries\Jirr;C:\Documents and Settings\Darth Android\My Documents\sync\java\libraries\Jirr
java_command: org.dragonfire.cear.client.Client
Launcher Type: SUN_STANDARD

Environment Variables:
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Wave Systems Corp\Dell Preboot Manager\Access Client\v5\;C:\Program Files\Java\jdk1.6.0\bin\
USERNAME=Darth Android
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 6, GenuineIntel



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

OS: Windows XP Build 2600 Service Pack 2

CPU:total 2 family 6, cmov, cx8, fxsr, mmx, sse, sse2

Memory: 4k page, physical 514096k(69732k free), swap 1256444k(614088k free)

vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310
Note that if I try the following:

Code: Select all

env.setUserEventReceiver(new IEventReceiver());
(Where

Code: Select all

env
is an IGUIEnvironment), it throws the following exception:

Code: Select all

Exception in thread "main" java.lang.RuntimeException: Attempted to invoke pure virtual method irr::IEventReceiver::OnEvent.
	at net.sf.jirr.JirrJNI.IrrlichtDevice_run(Native Method)
	at net.sf.jirr.IrrlichtDevice.run(IrrlichtDevice.java:41)
	at org.dragonfire.cear.client.Client.run(Client.java:72)
	at org.dragonfire.cear.client.Client.main(Client.java:33)
jirr
Posts: 36
Joined: Sat Feb 19, 2005 8:05 am

Post by jirr »

OnEvent should work (in most cases). As we can see from the error log the crash happens after entering your own OnEvent method.

Without knowing your dedicated code in org.dragonfire.cear.client.GUIManager.OnEvent(Lnet/sf/jirr/SEvent; it is impossible to say why it crashes here. Always keep in mind that calling irrlicht code from java does not stop you from being as careful as in c++.
Post Reply