glReadPixels crashes when width is not even number

Problems building or running Ardor3D, questions about how to use features, etc.

glReadPixels crashes when width is not even number

Postby runiter » Thu Apr 19, 2012 2:30 pm

I get a JVM crash when using JoglRenderer.grabScreenContents() if the canvas size happen to be odd number. For example of the canvas size is this:
width=953,height=908

I get the following JvM crash:

Code: Select all
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000000075a221c, pid=5596, tid=5552
#
# JRE version: 6.0_27-b07
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.2-b06 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  0x00000000075a221c
#
# 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 (0x000000000b253800):  JavaThread "Energy 3D Application" [_thread_in_native, id=5552, stack(0x000000000e420000,0x000000000e520000)]

siginfo: ExceptionCode=0xc0000005, writing address 0x000000000847b000

Registers:
RAX=0x00000000000000ff, RBX=0x0000000000ffffff, RCX=0x0000000000000004, RDX=0x0000000000ff0000
RSP=0x000000000e51d0a8, RBP=0x0000000000000005, RSI=0x0000000009c38550, RDI=0x000000000847b003
R8 =0x00000000000003b9, R9 =0x000000000847a4e4, R10=0x0000000009c3767c, R11=0x000000000847a4e4
R12=0x0000000010060080, R13=0x0000000000000ee4, R14=0x0000000000000ee4, R15=0x0000000000000001
RIP=0x00000000075a221c, EFLAGS=0x0000000000010207

Top of Stack: (sp=0x000000000e51d0a8)
0x000000000e51d0a8:   0000000000000ee4 0000000000000001
0x000000000e51d0b8:   0000000000000000 0000000009c3767c
0x000000000e51d0c8:   0000000069e206d9 0000000000000000
0x000000000e51d0d8:   0000000000000001 000000000e51d1b0
0x000000000e51d0e8:   0000000000000000 0000000000000000
0x000000000e51d0f8:   0000000000000017 0000000000000000
0x000000000e51d108:   0000038c00000000 0000000000000000
0x000000000e51d118:   00000000000003b9 0000000000000018
0x000000000e51d128:   000000000fefa001 000000000000003c
0x000000000e51d138:   000000000fefa0f8 0000000000000000
0x000000000e51d148:   00000ee400000000 00000000ffffffff
0x000000000e51d158:   000000006a7cbf00 0000004400000001
0x000000000e51d168:   000000000847a4e4 00000000000003b9
0x000000000e51d178:   0000003c00000038 0000000000000004
0x000000000e51d188:   0000000000045ffc 0000000000000000
0x000000000e51d198:   000000000e620000 fffffffffffffffc

Instructions: (pc=0x00000000075a221c)
0x00000000075a21fc:   e0 00 00 ff 00 c1 e8 10 81 e3 00 ff 00 00 0b d8
0x00000000075a220c:   81 e2 ff 00 00 00 c1 e2 10 0b da 8b c3 c1 e8 10
0x00000000075a221c:   66 89 5f fd 88 47 ff ff cd 75 c7 5f 5e 5b 5d c3
0x00000000075a222c:   00 00 00 00 00 00 00 00 00 00 00 00 40 ff ff ff


Register to memory mapping:

RAX=0x00000000000000ff is an unknown value
RBX=0x0000000000ffffff is an unknown value
RCX=0x0000000000000004 is an unknown value
RDX=0x0000000000ff0000 is an unknown value
RSP=0x000000000e51d0a8 is pointing into the stack for thread: 0x000000000b253800
RBP=0x0000000000000005 is an unknown value
RSI=0x0000000009c38550 is an unknown value
RDI=0x000000000847b003 is an unknown value
R8 =0x00000000000003b9 is an unknown value
R9 =0x000000000847a4e4 is an unknown value
R10=0x0000000009c3767c is an unknown value
R11=0x000000000847a4e4 is an unknown value
R12=0x0000000010060080 is an unknown value
R13=0x0000000000000ee4 is an unknown value
R14=0x0000000000000ee4 is an unknown value
R15=0x0000000000000001 is an unknown value


Stack: [0x000000000e420000,0x000000000e520000],  sp=0x000000000e51d0a8,  free space=1012k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  0x00000000075a221c

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  com.sun.opengl.impl.GLImpl.glReadPixels0(IIIIIILjava/lang/Object;I)V+0
j  com.sun.opengl.impl.GLImpl.glReadPixels(IIIIIILjava/nio/Buffer;)V+50
j  com.ardor3d.renderer.jogl.JoglRenderer.grabScreenContents(Ljava/nio/ByteBuffer;Lcom/ardor3d/image/ImageDataFormat;IIII)V+26
j  com.ardor3d.util.screen.ScreenExporter.exportCurrentScreen(Lcom/ardor3d/renderer/Renderer;Lcom/ardor3d/util/screen/ScreenExportable;)V+87
j  org.concord.energy3d.scene.PrintController$2.call()Ljava/lang/Object;+91
j  com.ardor3d.util.GameTask.invoke()V+4
j  com.ardor3d.util.GameTaskQueue.execute(Lcom/ardor3d/renderer/Renderer;)V+80
j  org.concord.energy3d.scene.SceneManager.renderUnto(Lcom/ardor3d/renderer/Renderer;)Z+317
j  com.ardor3d.framework.jogl.JoglCanvasRenderer.draw()Z+104
j  com.ardor3d.framework.jogl.JoglAwtCanvas.draw(Ljava/util/concurrent/CountDownLatch;)V+22
j  com.ardor3d.framework.FrameHandler.updateFrame()V+97
j  org.concord.energy3d.scene.SceneManager.run()V+206
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub

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

Java Threads: ( => current thread )
  0x000000000b255800 JavaThread "TimerQueue" daemon [_thread_blocked, id=2360, stack(0x0000000014cd0000,0x0000000014dd0000)]
  0x000000000b255000 JavaThread "D3D Screen Updater" daemon [_thread_blocked, id=2696, stack(0x000000000e520000,0x000000000e620000)]
  0x000000000b254000 JavaThread "DestroyJavaVM" [_thread_blocked, id=2752, stack(0x0000000002400000,0x0000000002500000)]
=>0x000000000b253800 JavaThread "Energy 3D Application" [_thread_in_native, id=5552, stack(0x000000000e420000,0x000000000e520000)]
  0x000000000add1800 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=5336, stack(0x000000000d350000,0x000000000d450000)]
  0x000000000b10b800 JavaThread "AWT-Shutdown" [_thread_blocked, id=5520, stack(0x000000000a650000,0x000000000a750000)]
  0x0000000008a0d000 JavaThread "Swing-Shell" daemon [_thread_blocked, id=2652, stack(0x0000000007700000,0x0000000007800000)]
  0x00000000088f0800 JavaThread "com.google.common.base.internal.Finalizer" daemon [_thread_blocked, id=2000, stack(0x0000000008c60000,0x0000000008d60000)]
  0x000000000629a000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=5964, stack(0x0000000007800000,0x0000000007900000)]
  0x0000000006285800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=5104, stack(0x0000000007600000,0x0000000007700000)]
  0x00000000061ee000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=1620, stack(0x0000000007270000,0x0000000007370000)]
  0x00000000061e1800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=1124, stack(0x0000000007170000,0x0000000007270000)]
  0x00000000061db000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=4512, stack(0x0000000007070000,0x0000000007170000)]
  0x00000000061d0000 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=5684, stack(0x0000000006f70000,0x0000000007070000)]
  0x00000000061cd000 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=6108, stack(0x0000000006d70000,0x0000000006e70000)]
  0x00000000061cb000 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_blocked, id=3920, stack(0x0000000006ba0000,0x0000000006ca0000)]
  0x0000000000525000 JavaThread "Attach Listener" daemon [_thread_blocked, id=5880, stack(0x0000000006480000,0x0000000006580000)]
  0x0000000000524000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=5584, stack(0x0000000006380000,0x0000000006480000)]
  0x000000000050c000 JavaThread "Finalizer" daemon [_thread_blocked, id=3540, stack(0x0000000006080000,0x0000000006180000)]
  0x0000000000508800 JavaThread "Reference Handler" daemon [_thread_blocked, id=5532, stack(0x0000000005f80000,0x0000000006080000)]

Other Threads:
  0x0000000000502000 VMThread [stack: 0x0000000005e80000,0x0000000005f80000] [id=6016]
  0x00000000061f9800 WatcherThread [stack: 0x0000000007370000,0x0000000007470000] [id=2632]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 PSYoungGen      total 68544K, used 20653K [0x00000000eab60000, 0x00000000ef380000, 0x0000000100000000)
  eden space 64960K, 26% used [0x00000000eab60000,0x00000000ebc482d8,0x00000000eead0000)
  from space 3584K, 93% used [0x00000000eeee0000,0x00000000ef223130,0x00000000ef260000)
  to   space 4160K, 0% used [0x00000000eead0000,0x00000000eead0000,0x00000000eeee0000)
 PSOldGen        total 43584K, used 12410K [0x00000000c0200000, 0x00000000c2c90000, 0x00000000eab60000)
  object space 43584K, 28% used [0x00000000c0200000,0x00000000c0e1e8d8,0x00000000c2c90000)
 PSPermGen       total 30848K, used 30744K [0x00000000bb000000, 0x00000000bce20000, 0x00000000c0200000)
  object space 30848K, 99% used [0x00000000bb000000,0x00000000bce06150,0x00000000bce20000)

Code Cache  [0x0000000002500000, 0x0000000002770000, 0x0000000005500000)
 total_blobs=1332 nmethods=617 adapters=676 free_code_cache=47895296 largest_free_block=19328

Dynamic libraries:
0x0000000000400000 - 0x000000000042e000    C:\Program Files\Java\jdk1.6.0_27\bin\javaw.exe
0x0000000077980000 - 0x0000000077b29000    C:\Windows\SYSTEM32\ntdll.dll
0x0000000077860000 - 0x000000007797f000    C:\Windows\system32\kernel32.dll
0x000007fefe140000 - 0x000007fefe1ac000    C:\Windows\system32\KERNELBASE.dll
0x000007feff6c0000 - 0x000007feff79b000    C:\Windows\system32\ADVAPI32.dll
0x000007feff450000 - 0x000007feff4ef000    C:\Windows\system32\msvcrt.dll
0x000007fefe420000 - 0x000007fefe43f000    C:\Windows\SYSTEM32\sechost.dll
0x000007feff7a0000 - 0x000007feff8cd000    C:\Windows\system32\RPCRT4.dll
0x0000000077550000 - 0x000000007764a000    C:\Windows\system32\USER32.dll
0x000007feff300000 - 0x000007feff367000    C:\Windows\system32\GDI32.dll
0x000007fefe1b0000 - 0x000007fefe1be000    C:\Windows\system32\LPK.dll
0x000007feff5f0000 - 0x000007feff6b9000    C:\Windows\system32\USP10.dll
0x000007feff2d0000 - 0x000007feff2fe000    C:\Windows\system32\IMM32.DLL
0x000007feffae0000 - 0x000007feffbe9000    C:\Windows\system32\MSCTF.dll
0x000000006d890000 - 0x000000006e048000    C:\Program Files\Java\jdk1.6.0_27\jre\bin\server\jvm.dll
0x000007fefb6c0000 - 0x000007fefb6fb000    C:\Windows\system32\WINMM.dll
0x000000006d800000 - 0x000000006d80e000    C:\Program Files\Java\jdk1.6.0_27\jre\bin\verify.dll
0x000000006d450000 - 0x000000006d477000    C:\Program Files\Java\jdk1.6.0_27\jre\bin\java.dll
0x000000006d4c0000 - 0x000000006d4f4000    C:\Program Files\Java\jdk1.6.0_27\jre\bin\jdwp.dll
0x000000006d6d0000 - 0x000000006d6d8000    C:\Program Files\Java\jdk1.6.0_27\jre\bin\npt.dll
0x000000006d850000 - 0x000000006d862000    C:\Program Files\Java\jdk1.6.0_27\jre\bin\zip.dll
0x000000006d310000 - 0x000000006d319000    C:\Program Files\Java\jdk1.6.0_27\jre\bin\dt_socket.dll
0x000007feff270000 - 0x000007feff2bd000    C:\Windows\system32\WS2_32.dll
0x000007feff2c0000 - 0x000007feff2c8000    C:\Windows\system32\NSI.dll
0x000007fefb980000 - 0x000007fefb995000    C:\Windows\system32\NLAapi.dll
0x000007fef7ed0000 - 0x000007fef7ee5000    C:\Windows\system32\napinsp.dll
0x000007fef7eb0000 - 0x000007fef7ec9000    C:\Windows\system32\pnrpnsp.dll
0x000007fef87b0000 - 0x000007fef87de000    C:\Program Files\Common Files\Microsoft Shared\Windows Live\WLIDNSP.DLL
0x0000000077b40000 - 0x0000000077b47000    C:\Windows\system32\PSAPI.DLL
0x000007feff3d0000 - 0x000007feff441000    C:\Windows\system32\SHLWAPI.dll
0x000007fefd5b0000 - 0x000007fefd605000    C:\Windows\System32\mswsock.dll
0x000007fefd440000 - 0x000007fefd49b000    C:\Windows\system32\DNSAPI.dll
0x000007fef7ea0000 - 0x000007fef7eab000    C:\Windows\System32\winrnr.dll
0x000007fefada0000 - 0x000007fefadc7000    C:\Windows\system32\IPHLPAPI.DLL
0x000007fefbb90000 - 0x000007fefbb9b000    C:\Windows\system32\WINNSI.DLL
0x000007fefa7e0000 - 0x000007fefa833000    C:\Windows\System32\fwpuclnt.dll
0x000007fef87a0000 - 0x000007fef87a8000    C:\Windows\system32\rasadhlp.dll
0x000007fefcfa0000 - 0x000007fefcfa7000    C:\Windows\System32\wshtcpip.dll
0x000000006d0a0000 - 0x000000006d263000    C:\Program Files\Java\jdk1.6.0_27\jre\bin\awt.dll
0x000007fefb1d0000 - 0x000007fefb241000    C:\Windows\system32\WINSPOOL.DRV
0x000007feff8d0000 - 0x000007feffad3000    C:\Windows\system32\ole32.dll
0x000007fefe4e0000 - 0x000007feff268000    C:\Windows\system32\SHELL32.dll
0x000007fefc9e0000 - 0x000007fefcbd4000    C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_fa396087175ac9ac\COMCTL32.dll
0x000007fefc3d0000 - 0x000007fefc3e8000    C:\Windows\system32\DWMAPI.DLL
0x000007fefc800000 - 0x000007fefc856000    C:\Windows\system32\uxtheme.dll
0x000007fefdcd0000 - 0x000007fefdcdf000    C:\Windows\system32\CRYPTBASE.dll
0x000000006d340000 - 0x000000006d3a6000    C:\Program Files\Java\jdk1.6.0_27\jre\bin\fontmanager.dll
0x000000006d6a0000 - 0x000000006d6b7000    C:\Program Files\Java\jdk1.6.0_27\jre\bin\net.dll
0x000007fefd830000 - 0x000007fefd837000    C:\Windows\System32\wship6.dll
0x000000006d6c0000 - 0x000000006d6cb000    C:\Program Files\Java\jdk1.6.0_27\jre\bin\nio.dll
0x000007feef610000 - 0x000007feef80f000    C:\Windows\system32\d3d9.dll
0x000007fefced0000 - 0x000007fefcedc000    C:\Windows\system32\VERSION.dll
0x000007fefc9d0000 - 0x000007fefc9d7000    C:\Windows\system32\d3d8thk.dll
0x000007feeb9c0000 - 0x000007feec857000    C:\Windows\system32\nvd3dumx.dll
0x000007fefbc70000 - 0x000007fefbc9c000    C:\Windows\system32\powrprof.dll
0x000007fefe240000 - 0x000007fefe417000    C:\Windows\system32\SETUPAPI.dll
0x000007fefe060000 - 0x000007fefe096000    C:\Windows\system32\CFGMGR32.dll
0x000007feff4f0000 - 0x000007feff5c7000    C:\Windows\system32\OLEAUT32.dll
0x000007fefe000000 - 0x000007fefe01a000    C:\Windows\system32\DEVOBJ.dll
0x0000000010000000 - 0x000000001005a000    C:\workspace\Energy3D\exe\lib\jogl\native\windows-64\jogl.dll
0x000007feef4f0000 - 0x000007feef60d000    C:\Windows\system32\OPENGL32.dll
0x000007fef8290000 - 0x000007fef82bd000    C:\Windows\system32\GLU32.dll
0x000007feefd00000 - 0x000007feefdf1000    C:\Windows\system32\DDRAW.dll
0x000007fefb5d0000 - 0x000007fefb5d8000    C:\Windows\system32\DCIMAN32.dll
0x0000000073c50000 - 0x0000000073d19000    C:\Windows\WinSxS\amd64_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4940_none_88df89932faf0bf6\MSVCR80.dll
0x000007fefd790000 - 0x000007fefd7a7000    C:\Windows\system32\CRYPTSP.dll
0x000007fefd350000 - 0x000007fefd397000    C:\Windows\system32\rsaenh.dll
0x000007fefd0e0000 - 0x000007fefd0fe000    C:\Windows\system32\USERENV.dll
0x000007fefdde0000 - 0x000007fefddef000    C:\Windows\system32\profapi.dll
0x000000006d570000 - 0x000000006d5a5000    C:\Program Files\Java\jdk1.6.0_27\jre\bin\jpeg.dll
0x000007feffbf0000 - 0x000007feffc89000    C:\Windows\system32\CLBCatQ.DLL
0x000007fefc860000 - 0x000007fefc98c000    C:\Windows\system32\propsys.dll
0x000007fefbb20000 - 0x000007fefbb4d000    C:\Windows\system32\ntmarta.dll
0x000007feff370000 - 0x000007feff3c2000    C:\Windows\system32\WLDAP32.dll
0x000007fefdc70000 - 0x000007fefdcc7000    C:\Windows\system32\apphelp.dll
0x000007fef5f50000 - 0x000007fef60ec000    C:\Windows\system32\NetworkExplorer.dll
0x000007fef6e00000 - 0x000007fef6e34000    C:\Windows\System32\shdocvw.dll
0x000007fefb7c0000 - 0x000007fefb7cb000    C:\Windows\system32\slc.dll
0x000007fefc260000 - 0x000007fefc38a000    C:\Windows\system32\WindowsCodecs.dll
0x000007fef73e0000 - 0x000007fef7415000    C:\Windows\system32\EhStorShell.dll
0x000007fef70d0000 - 0x000007fef714e000    C:\Windows\System32\cscui.dll
0x000007fef73d0000 - 0x000007fef73dc000    C:\Windows\System32\CSCDLL.dll
0x000007fef7ab0000 - 0x000007fef7abf000    C:\Windows\system32\CSCAPI.dll
0x000007fef6fc0000 - 0x000007fef7040000    C:\Windows\system32\ntshrui.dll
0x000007fefd880000 - 0x000007fefd8a3000    C:\Windows\system32\srvcli.dll
0x000007fef7900000 - 0x000007fef7918000    C:\Windows\system32\MPR.dll
0x0000000060f40000 - 0x0000000060f47000    C:\Windows\system32\SnacNp.dll
0x000007fef5ca0000 - 0x000007fef5caa000    C:\Windows\System32\drprov.dll
0x000007fefdd80000 - 0x000007fefddbd000    C:\Windows\System32\WINSTA.dll
0x000007fef1740000 - 0x000007fef1762000    C:\Windows\System32\ntlanman.dll
0x000007fef1720000 - 0x000007fef173c000    C:\Windows\System32\davclnt.dll
0x000007fef3230000 - 0x000007fef323a000    C:\Windows\System32\DAVHLPR.dll
0x000007fefc0f0000 - 0x000007fefc105000    C:\Windows\system32\wkscli.dll
0x000007fefc110000 - 0x000007fefc11c000    C:\Windows\system32\netutils.dll
0x000007feef270000 - 0x000007feef4e1000    C:\Windows\system32\wpdshext.dll
0x000007fefc5e0000 - 0x000007fefc7f5000    C:\Windows\WinSxS\amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.17514_none_2b24536c71ed437a\gdiplus.dll
0x000007fef7fb0000 - 0x000007fef806d000    C:\Windows\system32\PortableDeviceApi.dll
0x000007fefe020000 - 0x000007fefe05a000    C:\Windows\system32\WINTRUST.dll
0x000007fefde90000 - 0x000007fefdff7000    C:\Windows\system32\CRYPT32.dll
0x000007fefde80000 - 0x000007fefde8f000    C:\Windows\system32\MSASN1.dll
0x000007fef82c0000 - 0x000007fef82e7000    C:\Windows\system32\EhStorAPI.dll
0x000007fef6df0000 - 0x000007fef6dfc000    C:\Windows\system32\LINKINFO.dll
0x000007fefda80000 - 0x000007fefda8b000    C:\Windows\system32\Secur32.dll
0x000007fefdc40000 - 0x000007fefdc65000    C:\Windows\system32\SSPICLI.DLL
0x000007fefc0d0000 - 0x000007fefc0e4000    C:\Windows\system32\samcli.dll
0x000007fefc990000 - 0x000007fefc9ad000    C:\Windows\system32\SAMLIB.dll
0x000000006d490000 - 0x000000006d497000    C:\Program Files\Java\jdk1.6.0_27\jre\bin\jawt.dll
0x0000000006ec0000 - 0x0000000006ec7000    C:\workspace\Energy3D\exe\lib\jogl\native\windows-64\jogl_awt.dll
0x0000000069500000 - 0x000000006aa70000    C:\Windows\system32\nvoglv64.DLL
0x000000006d270000 - 0x000000006d2ad000    C:\Program Files\Java\jdk1.6.0_27\jre\bin\cmm.dll

VM Arguments:
jvm_args: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:55811 -Djava.library.path=C:\workspace\ardor3d-jogl\lib\jogl\native\windows-amd64;C:\workspace\ardor3d-lwjgl\lib\lwjgl\native\windows -Dfile.encoding=Cp1252
java_command: org.concord.energy3d.MainApplication
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=C:\Program Files (x86)\Java\jdk1.6.0_22
PATH=C:\Program Files\Java\jdk1.6.0_27\jre\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Java\jre6\bin\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Java\jdk1.6.0_22\bin;C:\Program Files\SlikSvn\bin\;C:\Program Files\Mercurial;c:\apache-maven-3.0.3\bin;C:\Program Files\SlikSvn\bin
USERNAME=snourian
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, sse4.1

Memory: 4k page, physical 4181932k(1228280k free), swap 8362012k(4629076k free)

vm_info: Java HotSpot(TM) 64-Bit Server VM (20.2-b06) for windows-amd64 JRE (1.6.0_27-b07), built on Jul 19 2011 01:08:22 by "java_re" with MS VC++ 8.0 (VS2005)

time: Thu Apr 19 16:27:25 2012
elapsed time: 53 seconds

Sign this petition to demand Oracle remove Ask Toolbar from Java: https://www.change.org/petitions/oracle ... -installer
User avatar
runiter
regular
 
Posts: 625
Joined: Fri Oct 23, 2009 8:50 am
Location: Boston, MA, USA

Re: glReadPixels crashes when width is not even number

Postby gouessej » Sat Apr 21, 2012 2:02 pm

Hi

At first, you should rather use the renderer based on JOGL 2.0. In this case, JOGL 2.0 performs some other tests and throws an exception instead of crashing. Anyway, I think that no driver accepts odd numbers as a parameter for glReadPixels.

Edit.: you should use the Screenshot class or GLReadBufferUtil to do that.
gouessej
regular
 
Posts: 1392
Joined: Fri May 01, 2009 3:26 am
Location: France

Re: glReadPixels crashes when width is not even number

Postby fuchs » Mon Apr 23, 2012 2:34 am

Anyway, I think that no driver accepts odd numbers as a parameter for glReadPixels.

Independent of the issues that the legacy JOGL 1.x may have, I think this particular fact isn't (or rather shouldn't :roll: ) be the cause. In fact, the OpenGL documentation for this command states that glReadPixels may be used to read arbitrary blocks of bytes from the frame buffer, and that the only error condition related to the widht, height parameters are negative values...
Artificial Intelligence is no match for Natural StupidityTM.
User avatar
fuchs
newcomer
 
Posts: 49
Joined: Tue Apr 21, 2009 2:45 am
Location: Sankt Augustin, Germany

Re: glReadPixels crashes when width is not even number

Postby gouessej » Mon Apr 23, 2012 4:08 am

fuchs wrote:
Anyway, I think that no driver accepts odd numbers as a parameter for glReadPixels.

Independent of the issues that the legacy JOGL 1.x may have, I think this particular fact isn't (or rather shouldn't :roll: ) be the cause. In fact, the OpenGL documentation for this command states that glReadPixels may be used to read arbitrary blocks of bytes from the frame buffer, and that the only error condition related to the widht, height parameters are negative values...

Actually, I was wrong, I checked that, I already succeeded to pass 1 for the width and 1 for the height. However, JOGL 2.0 performs range checks to avoid such crashes. If it still happens with the renderer based on JOGL 2, it means that there is something wrong with the driver, otherwise something is wrong in Ardor3D.

Edit.: Do you reproduce this bug with JOGL 2.0?
gouessej
regular
 
Posts: 1392
Joined: Fri May 01, 2009 3:26 am
Location: France

Re: glReadPixels crashes when width is not even number

Postby runiter » Mon Apr 23, 2012 11:44 am

I didn't have a chance to upgrade to JOGL 2.0 yet. So still using the older JOGL included with Ardor3D.
I'm eager to find some free time to do the upgrade but if renanse include JOGL 2.0 with Ardor3D that sure would make my life easier.
Sign this petition to demand Oracle remove Ask Toolbar from Java: https://www.change.org/petitions/oracle ... -installer
User avatar
runiter
regular
 
Posts: 625
Joined: Fri Oct 23, 2009 8:50 am
Location: Boston, MA, USA

Re: glReadPixels crashes when width is not even number

Postby gouessej » Mon Apr 23, 2012 11:53 am

runiter wrote:I'm eager to find some free time to do the upgrade but if renanse include JOGL 2.0 with Ardor3D that sure would make my life easier.

I already wrote a small tutorial about it and I added an Ant script which will be useful until Maven build will work anew. You don't have to change anything in your source code if you don't plan to switch to NEWT. All dependencies are provided with the renderer. Renanse will integrate this renderer only in Ardor3D 0.9 and Ardor3D 0.8 is not yet out...
gouessej
regular
 
Posts: 1392
Joined: Fri May 01, 2009 3:26 am
Location: France


Return to HELP!

Who is online

Users browsing this forum: No registered users and 1 guest

cron