native code crash in org.lwjgl.opengl.GL11.nglMultMatrixf

Started by anarchotron, May 24, 2004, 02:04:19

Previous topic - Next topic

anarchotron

I just started using jwjgl so I am still learning my way around.  It looks pretty nice.

However I hit a native code crash tonight attempting to use the GL11.glMultMatrix(FloatBuffer) method.  My FloatBuffer is 16 elements long, and is rewound.

The native crash information is below.
Dunno if anyone can suggest anything so alleviate my pain, if not then just consider this a bug report, I suppose.

-A-

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x697F1C62
Function=GetIAtomString+0x41992
Library=C:\WINDOWS\System32\nvoglnt.dll

Current Java thread:
   at org.lwjgl.opengl.GL11.nglMultMatrixf(Native Method)
   at org.lwjgl.opengl.GL11.glMultMatrix(Unknown Source)
   at shared.object.JwObject.render(JwObject.java:120)
   at shared.world.World.render(World.java:32)
   at client.John01.run(John01.java:631)
   at client.John01.main(John01.java:127)

Dynamic libraries:
0x00400000 - 0x00407000    C:\Program Files\Java\j2re1.4.2_04\bin\javaw.exe
0x77F50000 - 0x77FF7000    C:\WINDOWS\System32\ntdll.dll
0x77E60000 - 0x77F46000    C:\WINDOWS\system32\kernel32.dll
0x77DD0000 - 0x77E5D000    C:\WINDOWS\system32\ADVAPI32.dll
0x78000000 - 0x78086000    C:\WINDOWS\system32\RPCRT4.dll
0x77D40000 - 0x77DCC000    C:\WINDOWS\system32\USER32.dll
0x77C70000 - 0x77CB0000    C:\WINDOWS\system32\GDI32.dll
0x77C10000 - 0x77C63000    C:\WINDOWS\system32\MSVCRT.dll
0x76390000 - 0x763AC000    C:\WINDOWS\System32\IMM32.DLL
0x629C0000 - 0x629C8000    C:\WINDOWS\System32\LPK.DLL
0x72FA0000 - 0x72FFA000    C:\WINDOWS\System32\USP10.dll
0x08000000 - 0x08138000    C:\Program Files\Java\j2re1.4.2_04\bin\client\jvm.dll
0x76B40000 - 0x76B6C000    C:\WINDOWS\System32\WINMM.dll
0x10000000 - 0x10007000    C:\Program Files\Java\j2re1.4.2_04\bin\hpi.dll
0x00830000 - 0x0083E000    C:\Program Files\Java\j2re1.4.2_04\bin\verify.dll
0x00840000 - 0x00859000    C:\Program Files\Java\j2re1.4.2_04\bin\java.dll
0x00860000 - 0x0086D000    C:\Program Files\Java\j2re1.4.2_04\bin\zip.dll
0x02C50000 - 0x02C8A000    C:\tools\lwjgl-win32-0.9\lwjgl.dll
0x72280000 - 0x722A8000    C:\WINDOWS\System32\DINPUT.dll
0x5ED00000 - 0x5EDC6000    C:\WINDOWS\System32\OPENGL32.dll
0x68B20000 - 0x68B3E000    C:\WINDOWS\System32\GLU32.dll
0x51000000 - 0x51047000    C:\WINDOWS\System32\DDRAW.dll
0x73BC0000 - 0x73BC6000    C:\WINDOWS\System32\DCIMAN32.dll
0x77C00000 - 0x77C07000    C:\WINDOWS\system32\VERSION.dll
0x5AD70000 - 0x5ADA4000    C:\WINDOWS\System32\uxtheme.dll
0x02D10000 - 0x02D3B000    C:\WINDOWS\System32\msctfime.ime
0x771B0000 - 0x772D1000    C:\WINDOWS\System32\ole32.dll
0x69500000 - 0x699C7000    C:\WINDOWS\System32\nvoglnt.dll
0x688F0000 - 0x688F9000    C:\WINDOWS\System32\HID.DLL
0x76670000 - 0x76757000    C:\WINDOWS\System32\SETUPAPI.DLL
0x03F30000 - 0x03F40000    C:\WINDOWS\System32\ctagent.dll
0x746F0000 - 0x74716000    C:\WINDOWS\System32\Msimtf.dll
0x74720000 - 0x74764000    C:\WINDOWS\System32\MSCTF.dll
0x03FA0000 - 0x040AF000    C:\Program Files\Java\j2re1.4.2_04\bin\awt.dll
0x73000000 - 0x73023000    C:\WINDOWS\System32\WINSPOOL.DRV
0x040C0000 - 0x04110000    C:\Program Files\Java\j2re1.4.2_04\bin\fontmanager.dll
0x5C000000 - 0x5C0C8000    C:\WINDOWS\System32\D3DIM700.DLL
0x76C90000 - 0x76CB2000    C:\WINDOWS\system32\imagehlp.dll
0x6D510000 - 0x6D58D000    C:\WINDOWS\system32\DBGHELP.dll
0x76BF0000 - 0x76BFB000    C:\WINDOWS\System32\PSAPI.DLL

Heap at VM Abort:
Heap
def new generation   total 576K, used 407K [0x10010000, 0x100b0000, 0x104f0000)
 eden space 512K,  79% used [0x10010000, 0x10075ca8, 0x10090000)
 from space 64K,   0% used [0x10090000, 0x10090000, 0x100a0000)
 to   space 64K,   0% used [0x100a0000, 0x100a0000, 0x100b0000)
tenured generation   total 6672K, used 4002K [0x104f0000, 0x10b74000, 0x14010000)
  the space 6672K,  59% used [0x104f0000, 0x108d8a88, 0x108d8c00, 0x10b74000)
compacting perm gen  total 4096K, used 3103K [0x14010000, 0x14410000, 0x18010000)
  the space 4096K,  75% used [0x14010000, 0x14317d20, 0x14317e00, 0x14410000)

Local Time = Sun May 23 21:18:07 2004
Elapsed Time = 1
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode)
#
# An error report file has been saved as hs_err_pid3624.log.
# Please refer to the file for further information.
#
I can no longer sit back and allow, communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy, to sap and impurify all of our precious bodily fluids." - Gen. Jack T. Ripper

anarchotron

For what it's worth, I also get a crash in glLoadMatrix():

   at org.lwjgl.opengl.GL11.nglLoadMatrixf(Native Method)
   at org.lwjgl.opengl.GL11.glLoadMatrix(Unknown Source)

-A-
I can no longer sit back and allow, communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy, to sap and impurify all of our precious bodily fluids." - Gen. Jack T. Ripper

anarchotron

Ahh I figured it out after some  searching through the forums.  Apparently, FloatBuffer.allocate(16) does not return a valid float buffer but ByteBuffer.allocateDirect(16 * 4).asFloatBuffer() does!

-A-
I can no longer sit back and allow, communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy, to sap and impurify all of our precious bodily fluids." - Gen. Jack T. Ripper

cfmdobbie

Yes, float buffers must be direct, defined by the number of elements, and natively ordered.  To save yourself a lot of debugging, please use the BufferUtils utility class to create your buffers.
ellomynameis Charlie Dobbie.

princec

We are going to put in checks to ensure that all buffers passed to LWJGL are direct and throw an appropriate error message, I think, as this error turns up far too often as is a potential security hole.

Cas :)