Summary: | GLWindow.requestFocus() causes a crash of the JVM on Linux | ||
---|---|---|---|
Product: | [JogAmp] Newt | Reporter: | Julien Gouesse <gouessej> |
Component: | x11 | Assignee: | Sven Gothel <sgothel> |
Status: | RESOLVED FIXED | ||
Severity: | major | ||
Priority: | --- | ||
Version: | 1 | ||
Hardware: | All | ||
OS: | linux | ||
Type: | --- | SCM Refs: |
035051a686b7652dd14c0a878ebe1fe29f5f11c3
|
Workaround: | --- | ||
Attachments: |
log file
log file, crash reproduced on Cent OS 5.3 |
Description
Julien Gouesse
2011-11-14 13:29:19 CET
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. |