Login  Register

Re: Two issues: a random seg fault and an ArrayOutOfBoundException when painting GLJPanel

Posted by Cyrille on Jul 21, 2010; 9:47pm
URL: https://forum.jogamp.org/Two-issues-a-random-seg-fault-and-an-ArrayOutOfBoundException-when-painting-GLJPanel-tp977027p985467.html

Hi all,

Well, I am still fighting with my GLJPanel that does not want to display things without raising exceptions.

I have a hint for the second issue, i.e the ArrayOutOfBoundsException raised when my demonstration application's "Rebuild" button is clicked. Recall that this rebuild button removes all components from the parent JFrame and build the same component hierarchy again, reusing the same GLJPanel than before. I noticed that:
- the readBackWidthInPixels and readBackHeightInPixels in GLJPanel.PBufferBackend are zero when the exception is raised. By analyzing the code, this means that these two fields are uninitialized (as the only method that assign them a value is handleReshape(), which guarantees to set at least 1)
- the backend is not the same instance than before clicking on "Rebuild". I guess the backend is destroyed when the GLJPanel is removed from its parent JFrame and a new instance of a backend is created later. This guess is compatible with the first assumption that readBackWidthInPixels and readBackHeightInPixels are used before being initialized.

BTW, I forgot to tell that this exception does not seem to be harmless: it is uncaught and prevents the GLJPanel from displaying anything before it is resized by the user.

I think I'll try to put that together and file bugs in Bugzilla when I have time.

Regards,
Cyrille