Created attachment 294 [details] log file GLWindow.requestFocus() causes a crash of the JVM on Linux. I use Mageia Linux 1, KDE 4.6, the dev build 535 of JOGL 2.0, OpenJDK 1.6, AMD Sempron 2600+ (32 bits), NVIDIA Geforce 7600 GT. The bug is reproducible on Cent OS Linux 5.3 with Intel core duo and NVIDIA Quadro FX 3600 as you can see below: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x8f89d454, pid=28145, tid=2404363120 # # JRE version: 6.0_22-b22 # Java VM: OpenJDK Client VM (20.0-b11 mixed mode linux-x86 ) # Derivative: IcedTea6 1.10.2 # Distribution: Mageia 1, package fedora-14.b22.5.1.mga1-i386 # Problematic frame: # C [libX11.so.6+0x1f454] XGetInputFocus+0x14 # # An error report file with more information is saved as: # /home/gouessej/Documents/programmation/java/workspace/ardor3d-examples/hs_err_pid28145.log # # If you would like to submit a bug report, please include # instructions how to reproduce the bug and visit: # http://icedtea.classpath.org/bugzilla # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Please find enclosed the log file. The crash happens in Java_jogamp_newt_driver_x11_X11Window_requestFocus0 on the call of XGetInputFocus.
All test passed on CentOS 6, see bug 451, comment 3. If the bug still exist, please create a unit test, which I can reproduce on Ubuntu, CentOS 6 or Solaris.
Hi Add this into TestGearsES2NEWT just before calling glWindow.setVisible(true); and Cent OS 5.3 crashes: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x0000003f8642c546, pid=18982, tid=1113909568 # # JRE version: 6.0_17-b17 # Java VM: OpenJDK 64-Bit Server VM (14.0-b16 mixed mode linux-amd64 ) # Derivative: IcedTea6 1.7.5 # Distribution: Custom build (Wed Oct 13 13:04:40 EDT 2010) # Problematic frame: # C [libX11.so.6+0x2c546] XGetInputFocus+0x16 # # An error report file with more information is saved as: # /users/TA/gouesse/git/jogl/make/hs_err_pid18982.log # # If you would like to submit a bug report, please include # instructions how to reproduce the bug and visit: # http://icedtea.classpath.org/bugzilla # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. #
Created attachment 298 [details] log file, crash reproduced on Cent OS 5.3
I have found the root cause of this bug. If GLWindow.requestFocus() is called when GLWindow.isRealized() == false, it crashes. In my humble opinion, a check should be added in this method or the documentation should mention that requestFocus() must not be called when the window is not realized. I reopen this bug report but the fix is quite obvious anyway.
Fixed in commit 035051a686b7652dd14c0a878ebe1fe29f5f11c3 (will be pushed soon). Thx Julien for being persistent and finding the culprit. Hope it works this way now. --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -1576,7 +1576,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer } public void requestFocus(boolean wait) { - if(!focusAction()) { + if(isNativeValid() && !focusAction()) { runOnEDTIfAvail(wait, requestFocusAction); } }
You're welcome. I confirm it works now.