JDK-6570758 : REGRESSION: 1.6 throws InternalError when trying to exit full screen exclusive mode, Linux
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2007-06-18
  • Updated: 2011-02-16
  • Resolved: 2008-05-22
Related Reports
Duplicate :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0-b105, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Linux akio 2.6.17-gentoo-r7 #3 Thu Sep 14 18:51:27 EDT 2006 x86_64 AMD Athlon(tm) 64 Processor 3000+ AuthenticAMD GNU/Linux

EXTRA RELEVANT SYSTEM CONFIGURATION :
Video card:  Nvidia GeForce3 Ti 200 (with Nvidia binary driver, vers. 1.0-8776)

A DESCRIPTION OF THE PROBLEM :
When I attempt to exit Full Screen Exclusive Mode under Java 1.6 by explicitly setting the full-screen window to null, my program crashes with an exception that appears to be related to display modes, even though the program in question never changes the display mode.  The same code, running under 1.5.0_11-b03, throws no exceptions.


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Invoke FSEM and then try to exit it as described above.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The program should exit FSEM after the window is set to null--this was the behaviour in 1.5.
ACTUAL -
The program throws an exception and FSEM remains on until the program is killed.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "main" java.lang.InternalError: Could not set display mode
	at sun.awt.X11GraphicsDevice.configDisplayMode(Native Method)
	at sun.awt.X11GraphicsDevice.setDisplayMode(X11GraphicsDevice.java:382)
	at sun.awt.X11GraphicsDevice.setFullScreenWindow(X11GraphicsDevice.java:298)
	at FullScreenTest.init(FullScreenTest.java:19)
	at FullScreenTest.main(FullScreenTest.java:8)

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.awt.*;

public class FullScreenTest{
	
	GraphicsDevice gDevice = null;
	
	public static void main (String[] args){
		(new FullScreenTest()).init();
	}
	
	void init(){
		gDevice = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
		Frame screen = new Frame();
		screen.setIgnoreRepaint(true);
		screen.setUndecorated(true);
		screen.setResizable(false);
		gDevice.setFullScreenWindow(screen);
		screen.createBufferStrategy(2);
        gDevice.setFullScreenWindow(null);
	}
	
}

When compiled and run under 1.5, the above makes the screen flash briefly grey as FSEM is invoked and then immediately exited.  Under 1.6, the exception is thrown and the screen remains grey.  :(

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
The only known workaround is to revert to a 1.5 JDK.

Release Regression From : 5.0u11
The above release value was the last known release where this 
bug was not reproducible. Since then there has been a regression.

Comments
EVALUATION It's still unclear what it was in the submitter's configuration that was causing setDisplayMode() to fail in the first place. Note that this was on Gentoo, which is not one of our supported platforms. However, the fix for 6459844 will also fix the submitter's testcase here, since setFullScreenWindow() will itself no longer cause a display change. We haven't been able to reproduce the configuration problem, and the specific problem reported is being resolved by the fix for 6459844, so at this point I think we should close this as a duplicate of 6459844. Please open a new bug report if this InternalError can be reproduced on a supported configuration.
22-05-2008

EVALUATION Submitter has provided the following test results *********************************************** Output from the test case was as follows: ge=sun.awt.X11GraphicsEnvironment@2be9cb75 GraphicsDevice: X11GraphicsDevice[screen=0] FS supported?true default DM(1024x768x-1@85) Display modes: dm(1024x768x-1@85) ***********************************************
03-10-2007

EVALUATION This is partially related to 6459844 (we shouldn't try to change the display mode if it's not actually changing) and partially related to 6513886 (looks like some misconfiguration of the native display mode is causing us to fail). This bug will likely go away if we fix 6459844, but we should still try to figure out the underlying cause first. Could the submitter please try the following testcase and report back the output? ---- import java.awt.*; public class GETest { public static void main(String... args) { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); System.err.println("ge="+ge); GraphicsDevice gds[] = ge.getScreenDevices(); for (GraphicsDevice gd : gds) { System.err.println("GraphicsDevice: "+gd); System.err.println("FS supported?"+gd.isFullScreenSupported()); if (gd.getDisplayMode() != null) { DisplayMode dm = gd.getDisplayMode(); System.err.printf("default DM(%dx%dx%d@%d)\n", dm.getWidth(), dm.getHeight(), dm.getBitDepth(), dm.getRefreshRate()); } else { System.err.println("ERROR: default DM is null!"); } DisplayMode dms[] = gd.getDisplayModes(); System.err.println("Display modes:"); for (DisplayMode dm : dms) { System.err.printf(" dm(%dx%dx%d@%d)\n", dm.getWidth(), dm.getHeight(), dm.getBitDepth(), dm.getRefreshRate()); } } } } ---- Marking incomplete pending test results.
20-06-2007