Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11997 Posts in 1588 Topics- by 3508 Members - Latest Member: PienueDut

26. May 2012, 11:39:56 am
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)NullPointerException in RenderPeerImpl.java
Pages: [1]
Print
Author Topic: NullPointerException in RenderPeerImpl.java  (Read 847 times)
Agrv
Administrator
Enjoying the stay
*****
Offline Offline

Posts: 64


View Profile
« on: 28. May 2009, 09:38:31 pm »

Hi,

I sometimes get the following exception when a refresh occurs while a JOptionPane is just coming up on screen (through "onIntervalHit"). This is something new probably due to a recent update because it only happens for a few days and has never happened before. I tried to add "setIgnoreRepaint(true)" but it did not help.

Code:
  java.lang.NullPointerException 
  at org.xith3d.render.jsr231.RenderPeerImpl.drawBin(RenderPeerImpl.java:365) 
  at org.xith3d.render.jsr231.RenderPeerImpl.renderMain(RenderPeerImpl.java:652) 
  at org.xith3d.render.jsr231.RenderPeerImpl.renderRenderPass(RenderPeerImpl.java:799) 
  at org.xith3d.render.jsr231.RenderPeerImpl.render(RenderPeerImpl.java:888) 
  at org.xith3d.render.jsr231.CanvasPeerImplBase.doRender(CanvasPeerImplBase.java:340) 
  at org.xith3d.render.jsr231.CanvasPeerImplAWT.display(CanvasPeerImplAWT.java:706) 
  at com.sun.opengl.impl.GLDrawableHelper.display(GLDrawableHelper.java:78) 
  at javax.media.opengl.GLCanvas$DisplayAction.run(GLCanvas.java:435) 
  at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:194) 
  at javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:412) 
  at javax.media.opengl.GLCanvas.display(GLCanvas.java:244) 
  at javax.media.opengl.GLCanvas.paint(GLCanvas.java:277) 
  at sun.awt.RepaintArea.paintComponent(RepaintArea.java:248) 
  at sun.awt.RepaintArea.paint(RepaintArea.java:224) 
  at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:306) 
  at java.awt.Component.dispatchEventImpl(Component.java:4659) 
  at java.awt.Component.dispatchEvent(Component.java:4413) 
  at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) 
  at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) 
  at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) 
  at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178) 
  at java.awt.Dialog$1.run(Dialog.java:1051) 
  at java.awt.Dialog$3.run(Dialog.java:1103) 
  at java.security.AccessController.doPrivileged(Native Method) 
  at java.awt.Dialog.show(Dialog.java:1101) 
  at javax.swing.JOptionPane.showInputDialog(JOptionPane.java:566) 
  at imiuzetna.video.VideoContext.inputBox(VideoContext.java:165) 
  at imiuzetna.Imiuzetna.input(Imiuzetna.java:280) 
  at dragonorder.DragonOrder.message(DragonOrder.java:247) 
  at dragonorder.DragonOrder$1.run(DragonOrder.java:227) 
  at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) 
  at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) 
  at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) 
  at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) 
  at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) 
  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) 
  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) 
  at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) 
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #1 on: 29. May 2009, 12:00:18 am »

Hmm... I didn't touch that code recently. When did you last update. What revision are you using?

Marvin
Logged
Agrv
Administrator
Enjoying the stay
*****
Offline Offline

Posts: 64


View Profile
« Reply #2 on: 29. May 2009, 04:49:45 am »

I am up to date with the SVN, on revision 1711.
I will try to post a minimal test case which reproduces the problem if I can.

Only thing I know for the moment is that sometimes atom is null at RenderPeerImpl.java:365. Still trying to isolate the problem, it may have something to do with my HUD because I have not reproduce the problem yet after removing it (but it does not always occur anyway so nothing is certain).
« Last Edit: 29. May 2009, 05:29:09 am by Agrv » Logged
Agrv
Administrator
Enjoying the stay
*****
Offline Offline

Posts: 64


View Profile
« Reply #3 on: 30. May 2009, 07:30:48 pm »

I have more information about the problem. I am now pretty sure it happens since the last HUD modifications, but I have no real proof about it. Since the new HUD modifications, applications with an HUD (even those in the xith-tk tests) crash on some Intel hardware. Those crashes did not happen before.

Code:
Stack: [0x03330000,0x03380000],  sp=0x0337f010,  free space=316k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [ig4icd32.dll+0x5d98e]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  com.sun.opengl.impl.GLImpl.glCallList(I)V+0
j  org.xith3d.render.jsr231.DisplayListRenderPeer.playbackDisplayList(Ljavax/media/opengl/GL;I)V+2
j  org.xith3d.render.jsr231.DisplayListRenderPeer.renderDisplayList(Ljavax/media/opengl/GL;Lorg/xith3d/render/preprocessing/ShapeAtom;Lorg/xith3d/scenegraph/Geometry;Lorg/xith3d/render/CanvasPeer;Lorg/xith3d/render/OpenGLCapabilities;Lorg/xith3d/render/OpenGLStatesCache;Z)V+149
j  org.xith3d.render.jsr231.ShapeAtomPeer.render(Ljavax/media/opengl/GL;Lorg/xith3d/render/preprocessing/ShapeAtom;Lorg/xith3d/scenegraph/Geometry;Lorg/xith3d/scenegraph/Geometry;Lorg/xith3d/render/CanvasPeer;Lorg/xith3d/render/RenderPeer;Lorg/xith3d/render/OpenGLCapabilities;Lorg/xith3d/render/OpenGLStatesCache;Lorg/xith3d/render/RenderOptions;Z)I+105
j  org.xith3d.render.jsr231.ShapeAtomPeer.renderAtom(Lorg/xith3d/render/preprocessing/RenderAtom;Ljava/lang/Object;Lorg/xith3d/render/RenderPeer;Lorg/xith3d/render/OpenGLCapabilities;Lorg/xith3d/scenegraph/View;Lorg/xith3d/render/RenderOptions;JJLorg/xith3d/render/RenderPeer$RenderMode;J)I+418
J  org.xith3d.render.RenderPeer.renderAtom(Lorg/xith3d/render/preprocessing/RenderAtom;Ljava/lang/Object;Lorg/xith3d/render/CanvasPeer;Lorg/xith3d/render/OpenGLCapabilities;Lorg/xith3d/render/OpenGLStatesCache;Lorg/xith3d/scenegraph/View;Lorg/xith3d/render/RenderOptions;JJLorg/xith3d/render/RenderPeer$RenderMode;J)I
j  org.xith3d.render.jsr231.RenderPeerImpl.drawBin(Ljavax/media/opengl/GL;Lorg/xith3d/render/OpenGLStatesCache;Lorg/xith3d/render/OpenGLCapabilities;Lorg/xith3d/render/RenderOptions;ZZLorg/xith3d/render/preprocessing/RenderBin;Lorg/xith3d/scenegraph/View;JIJJLorg/xith3d/render/RenderPeer$RenderMode;)I+106
j  org.xith3d.render.jsr231.RenderPeerImpl.renderMain(Ljavax/media/opengl/GL;Lorg/xith3d/render/OpenGLCapabilities;Lorg/xith3d/render/OpenGLStatesCache;Lorg/xith3d/render/RenderOptions;ZZLorg/xith3d/scenegraph/View;Lorg/xith3d/render/RenderPass;JIJJLorg/xith3d/render/RenderPeer$RenderMode;)I+100
j  org.xith3d.render.jsr231.RenderPeerImpl.renderRenderPass(Ljava/lang/Object;Lorg/xith3d/render/OpenGLCapabilities;Lorg/xith3d/render/OpenGLStatesCache;Ljava/util/List;Lorg/xith3d/render/RenderPass;IZLorg/xith3d/render/RenderPeer$RenderMode;Lorg/xith3d/scenegraph/View;ZJJJLorg/xith3d/picking/PickRequest;I)I+629
j  org.xith3d.render.jsr231.RenderPeerImpl.render(Ljava/lang/Object;Lorg/xith3d/scenegraph/View;Ljava/util/List;ZJJJLorg/xith3d/picking/PickRequest;)Ljava/lang/Object;+246
j  org.xith3d.render.jsr231.CanvasPeerImplBase.doRender(Lorg/xith3d/scenegraph/View;Ljava/util/List;ZJJJLorg/xith3d/picking/PickRequest;)Ljava/lang/Object;+19
j  org.xith3d.render.jsr231.CanvasPeerImplAWT.display(Ljavax/media/opengl/GLAutoDrawable;)V+162
j  com.sun.opengl.impl.GLDrawableHelper.display(Ljavax/media/opengl/GLAutoDrawable;)V+29
j  javax.media.opengl.GLCanvas$DisplayAction.run()V+80
j  com.sun.opengl.impl.GLDrawableHelper.invokeGL(Ljavax/media/opengl/GLDrawable;Ljavax/media/opengl/GLContext;Ljava/lang/Runnable;Ljava/lang/Runnable;)V+418
j  javax.media.opengl.GLCanvas$DisplayOnEventDispatchThreadAction.run()V+35
j  java.awt.event.InvocationEvent.dispatch()V+11
j  java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+26
j  java.awt.EventDispatchThread.pumpOneEventForFilters(I)Z+204
j  java.awt.EventDispatchThread.pumpEventsForFilter(ILjava/awt/Conditional;Ljava/awt/EventFilter;)V+30
j  java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+11
j  java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4
j  java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3
j  java.awt.EventDispatchThread.run()V+9
v  ~StubRoutines::call_stub

If I remove the HUD, there is no crash any more. If I add "canvas.getRenderOptions().setDisplayListsEnabled(false);" the crash is no more present too. The NullPointerException (on my nVidia hardware) I mentioned above follows the same scheme : does not happen if I remove the HUD or if I deactivate the display lists.

Sadly I have no test case which gives the NullPointerException always yet on my nVidia hardware, but on my Intel hardware the crash is always reproducible. It seems that on some hardware there is sometimes a NullPointerException in drawBin from RenderPeerImpl, and on some other hardware no NullPointerException in drawBin but a crash in the following glCallList. I am still trying to create a small test case that always throws this NullPointerException on my nVidia or this crash on my Intel.
Logged
Agrv
Administrator
Enjoying the stay
*****
Offline Offline

Posts: 64


View Profile
« Reply #4 on: 30. May 2009, 08:50:42 pm »

OK, my mistake.
The crash on Intel hardware is once again due to VBOs, I had commented out the "canvas.getRenderOptions().setVBOsEnabled(false);" because I thought you added it to Xith automatically on Intel hardware. When I tested "canvas.getRenderOptions().setDisplayListsEnabled(false);" I also added the VBOs deactivation again.

As for the NullPointerException, it only happens sometimes when a JOptionPane pops up while the player was doing something (like moving forward), and as I plan to replace all my JOptionPane with widgets I guess it is not worth the work to find where the issue lies as long as no proper test case is available.
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #5 on: 31. May 2009, 12:12:09 pm »

The crash on Intel hardware is once again due to VBOs, I had commented out the "canvas.getRenderOptions().setVBOsEnabled(false);" because I thought you added it to Xith automatically on Intel hardware.

Actually I did. What does the following line return for you on your intel hardware?
Code:
canvas.getPeer().getOpenGLInfo().getVendor()

The workaround doesn't filter out NVidia cards, since there haven't been any problems of that kind. Do you have the latest drivers installed?

Marvin
Logged
Agrv
Administrator
Enjoying the stay
*****
Offline Offline

Posts: 64


View Profile
« Reply #6 on: 31. May 2009, 06:47:32 pm »

Code:
canvas.getPeer().getOpenGLInfo().getVendor()
returns "Intel"

If I add the following code in my app, everything works fine, without, it crashes with the stack posted above.
Code:
if(canvas.getPeer().getOpenGLInfo().getVendor().toLowerCase().contains("intel"))
canvas.getRenderOptions().setVBOsEnabled(false);
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #7 on: 31. May 2009, 11:15:14 pm »

If I add the following code in my app, everything works fine, without, it crashes with the stack posted above.
Code:
if(canvas.getPeer().getOpenGLInfo().getVendor().toLowerCase().contains("intel"))
canvas.getRenderOptions().setVBOsEnabled(false);

Oh! then I misunderstood you. The internal workaround just bypasses fast-DisplayLists (using a slower variant). Dammn Intel cards. They only cause problems. I will internally disable VBOs for Intel cards then.

Marvin
Logged
ford.304
Enjoying the stay
*
Offline Offline

Posts: 30


View Profile Email
« Reply #8 on: 04. June 2009, 08:24:42 pm »

I am getting what seems to be a similar problem on an ATI 3450. I get a null render atom crash occasionally when the window is moved or resized, although not consistently. I get very occasional crashes in this same location on an nvidia machine, but not reliably enough that I have been able to track down the cause yet.

Turning off VBOs caused all of my textures to disappear... I am using a fair amount of geometry primitives, I imagine that it is an issue with the differing construction methods when one does or does not have VBO's enabled.

I am using the Canvas3DJPanel. I am attempting to transition to the AWT Panel since I read that was preferred (and is the only way to attempt LWJGL to see if it does better than JOGL). I will see if that changes anything.
Logged
Deimon
Just dropped in

Offline Offline

Posts: 10


View Profile
« Reply #9 on: 08. July 2009, 02:07:43 pm »

Same problem on Radeon X1650.
Code:
java.lang.NullPointerException
at org.xith3d.render.jsr231.RenderPeerImpl.drawBin(RenderPeerImpl.java:375)
at org.xith3d.render.jsr231.RenderPeerImpl.renderMain(RenderPeerImpl.java:662)
at org.xith3d.render.jsr231.RenderPeerImpl.renderRenderPass(RenderPeerImpl.java:805)
at org.xith3d.render.jsr231.RenderPeerImpl.render(RenderPeerImpl.java:898)
at org.xith3d.render.jsr231.CanvasPeerImplBase.doRender(CanvasPeerImplBase.java:338)
at org.xith3d.render.jsr231.CanvasPeerImplAWT.display(CanvasPeerImplAWT.java:706)
at com.sun.opengl.impl.GLDrawableHelper.display(GLDrawableHelper.java:78)
at javax.media.opengl.GLCanvas$DisplayAction.run(GLCanvas.java:435)
at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:194)
at javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:412)
at javax.media.opengl.GLCanvas.display(GLCanvas.java:244)
at javax.media.opengl.GLCanvas.paint(GLCanvas.java:277)
at javax.media.opengl.GLCanvas.update(GLCanvas.java:354)
at sun.awt.RepaintArea.updateComponent(RepaintArea.java:239)
at sun.awt.RepaintArea.paint(RepaintArea.java:216)
at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:306)
at java.awt.Component.dispatchEventImpl(Component.java:4577)
at java.awt.Component.dispatchEvent(Component.java:4331)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
I'm using Canvas3DPanel with JOGL_AWT. As in ford.304's case, there are a lot (about 10000) geometry primitives in my scene. It crashes every 2-3 runs. Looking for clue...
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #10 on: 08. July 2009, 08:31:48 pm »

If you don't find a solution, it would help, if you would post a short example, where it happens, if possible. I just don't have a testcase, where this happens.

Marvin
Logged
shatterblast
Enjoying the stay
*
Offline Offline

Posts: 45


View Profile
« Reply #11 on: 09. July 2009, 12:37:00 am »

I personally have no issues with any of the Xith-TK test cases, but my preference has been towards LWJGL only.  I might have a slightly biased opinion with that in mind.  I run moderately high-end specs for an Intel single core machine with a PCI-Express video card of the nVidia variety in an Ubuntu Linux environment.  I think I updated my version of SVN on Monday of this week, 7/6/2009.

This is before testing out LWJGL 2.2 with Xith and FengGUI.  Version 7 of Java sits in active development I believe.  I'm not sure if that influences JOGL.
« Last Edit: 09. July 2009, 12:47:00 am by shatterblast » Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic