Bug 1049 - Application Crashes when System.exit() is Called within JOGL callbacks.
Summary: Application Crashes when System.exit() is Called within JOGL callbacks.
Alias: None
Product: Jogl
Classification: JogAmp
Component: opengl (show other bugs)
Version: 2
Hardware: pc_x86_64 linux
: --- normal
Assignee: Sven Gothel
URL: http://forum.jogamp.org/Need-Help-Sol...
Depends on:
Reported: 2014-08-22 10:53 CEST by ray
Modified: 2014-08-22 10:54 CEST (History)
0 users

See Also:
Type: ---
SCM Refs:
Workaround: ---

Output of JStack command on application (10.46 KB, text/x-log)
2014-08-22 10:53 CEST, ray

Note You need to log in before you can comment on or make changes to this bug.
Description ray 2014-08-22 10:53:42 CEST
Created attachment 623 [details]
Output of JStack command on application

When an application executes a System.exit() while inside a JOGL-specific overriden callback (e.g. init(GLAutoDrawable), or display(GLAutoDrawable), etc) the application crashes and even fails to terminate.
When the System.exit() call is made within the overriden JOGL methods, instead of terminating it will crash and hang. The only way to terminate the application at that point is to send it the -SIGKILL signal

I noticed this behavior in the March 2014 release and it's also present in the more recent August 2014 release (v2.2.0).

I've attached the output of jstack for an application showing the symptoms. It was suggested[1] that I try GLProfile.shutdown() prior to System.exit(), but that made no noticeable difference.

A simple way to reproduce the problem is to create a basic application and add the following code:

public void init(GLAutoDrawable auto) {
    // adding/removing the GLProfile line makes no visible difference

It seems exiting under any of the JOGL methods/callbacks, (e.g. display(GLAutoDrawable)) will reliably reproduce the problem. I tested on both init and display methods.

[1] http://forum.jogamp.org/Need-Help-Solving-OpenGL-GLSL-4-4-Issues-td4032557i20.html#a4032887