GLCanvas in SWT, Problem with a Text widget

classic Classic list List threaded Threaded
8 messages Options
Zib
Reply | Threaded
Open this post in threaded view
|

GLCanvas in SWT, Problem with a Text widget

Zib
Hi all!

I am trying to develop an app to display 3D grids and so I use OpenGL binding for this! I was on LWJGL before, but I find it quite complex to setup two different displays at a time, so I thought, why not JOGL ?

And here I am ... because my app crash for a reason I do not understand!

I started from the tutoriel available on the wiki (to display a triangle) and it worked quite well. Then I started adapting it to my needs and here come the problems ... my GUI is now very simple :
screenshot

so two buttons and a Text field in a composite on the left, the GLCanvas on the right ...
Problems arrive when I use setText to set a default text in the Text field : the app crash, not even with a stacktrace :
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f06be507634, pid=8982, tid=139666918373120
#
# JRE version: 6.0_26-b03
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.1-b02 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libpthread.so.0+0x9634]  pthread_mutex_lock+0x4
#
# An error report file with more information is saved as:
# /home/zib/devJava/JMeshingTool/hs_err_pid8982.log
#
# 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.

here is the link to the log file: click!

and here are the classes I use:
main class : http://pastebin.com/WSuERCJU
composite instanciating GLCanvas: http://pastebin.com/vavduZLd

the crash happens when, in the main class, I uncomment one of the line 114 or 115. commented, everything works fine!

did someone already have this problem ? I googled it, but find nothing relevant about this (my googling skills might be bad as well)

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: GLCanvas in SWT, Problem with a Text widget

gouessej
Administrator
Hi

JOGL is an excellent choice, especially when you need nice support for heavyweight components and multiple screens.

Please can you try to reproduce your bug with OpenJDK too? Which version of Eclipse / SWT do you use?

Edit.: As a temporary workaround, you can use the SWT/AWT bridge with the AWT GLCanvas until we fix your bug.

Edit.2: Please don't mix JOGL 2.0 with SWT OpenGL binding, especially under GNU Linux. I know Wade disagrees with me about that but you will only have lots of troubles by doing that. Rather use NewtCanvasSWT, JOGL 2.0 SWT GLCanvas, JOGL 2.0 AWT GLCanvas + SWT/AWT bridge or NewtCanvasAWT + SWT/AWT bridge.
Julien Gouesse | Personal blog | Website
Zib
Reply | Threaded
Open this post in threaded view
|

Re: GLCanvas in SWT, Problem with a Text widget

Zib
Hi!

Thanks for that quick answer!

I'm using eclipse 3.5.2, with swt 3.6.5.

I don't have time to install openjdk this morning, but I'll try this evening, as well as NewtCanvasAWT ... newTCanvasSWT does not exists in my jars.
Reply | Threaded
Open this post in threaded view
|

Re: GLCanvas in SWT, Problem with a Text widget

gouessej
Administrator
Hi

NewtCanvasSWT is only in the latest build and will be soon in the RC10.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: GLCanvas in SWT, Problem with a Text widget

Wade Walker
Administrator
In reply to this post by Zib
Hmm, the mutex problem looks similar to https://jogamp.org/bugzilla/show_bug.cgi?id=603 -- what OS version are you using?
Zib
Reply | Threaded
Open this post in threaded view
|

Re: GLCanvas in SWT, Problem with a Text widget

Zib
Hi,

So I installed the openjdk6 ... I updated the alternatives with sudo update-alternatives --config java etc... but it seems that eclipse is still using jre6 and not openjre6 ... how to fix this ?

Anyway, I tried with the SWT/AWT bridge, with GLCanvas coming AWT, I get the same crash! and my simtoms are quite the same as the ones in the bug reported.

I'm using ubuntu 10.10 (wow, I thought it was 11.04, the last one before unity lol, so not supported any more!)

Is there a tutorial about how to use NewtCanvasAWT(/SWT also!) ?

thank you!
Reply | Threaded
Open this post in threaded view
|

Re: GLCanvas in SWT, Problem with a Text widget

Sven Gothel
Administrator
On 08/05/2012 06:32 PM, Zib [via jogamp] wrote:
> Hi,
>
> So I installed the openjdk6 ... I updated the alternatives with sudo
> update-alternatives --config java etc... but it seems that eclipse is still
> using jre6 and not openjre6 ... how to fix this ?
>
> Anyway, I tried with the SWT/AWT bridge, with GLCanvas coming AWT, I get the
> same crash! and my simtoms are quite the same as the ones in the bug reported.

Sorry, I have no time to dig into this bug .. yet.
Just returned from siggraph.

>
> I'm using ubuntu 10.10 (wow, I thought it was 11.04, the last one before unity
> lol, so not supported any more!)
>
> Is there a tutorial about how to use NewtCanvasAWT(/SWT also!) ?

There are multiple unit tests in jogl/src/test:
sven@risa:~/projects/JOGL$ grep -RIl NewtCanvas jogl/src/test
jogl/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextNewtAWTBug523.java
jogl/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java
jogl/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestNewtCanvasSWTGLn.java
jogl/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTJOGLGLCanvas01GLn.java
jogl/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java
jogl/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01bAWT.java
jogl/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cAWT.java
jogl/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02AWT.java
jogl/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03AWT.java
jogl/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aAWT.java
jogl/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParentingFocusTraversal01AWT.java
jogl/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cSwingAWT.java
jogl/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentParentingAWT.java
jogl/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParentingOffscreenLayer02NewtCanvasAWT.java
jogl/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aSWT.java
jogl/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04AWT.java
jogl/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04SWT.java
jogl/src/test/com/jogamp/opengl/test/junit/newt/TestCloseNewtAWT.java
jogl/src/test/com/jogamp/opengl/test/junit/newt/TestListenerCom01AWT.java
jogl/src/test/com/jogamp/opengl/test/junit/newt/TestEventSourceNotAWTBug.java
jogl/src/test/com/jogamp/opengl/test/junit/newt/TestFocus02SwingAWTRobot.java
jogl/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java
jogl/src/test/com/jogamp/opengl/test/junit/newt/TestFocus01SwingAWTRobot.java

>
> thank you!
>

~Sven


signature.asc (910 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: GLCanvas in SWT, Problem with a Text widget

gouessej
Administrator
In reply to this post by Zib
Hi

You have to go to Window -> Preferences -> Java -> Installed JREs

Then, click on "Add", add OpenJDK.

After that, go to "Debug Configurations..." or "Run Configurations..." -> tab "Main" -> section "Java Runtime Environment", click on "Runtime JRE" -> "Installed JREs..." and select OpenJDK.

You can use NewtCanvasAWT like you already do with SWT/AWT bridge and AWT GLCanvas except that you should use NEWT for the event handling. NewtCanvasSWT doesn't require any bridge, just put it into an SWT Composite. I've just added a suggestion into the bug report as I have never reproduced these crashes under GNU Linux.
Julien Gouesse | Personal blog | Website