United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6599601 Permissions/AWTWindowTest and Permissions/DFLoadTest failed in PIT 7.0 B20 on Windows Vista
6599601 : Permissions/AWTWindowTest and Permissions/DFLoadTest failed in PIT 7.0 B20 on Windows Vista

Details
Type:
Bug
Submit Date:
2007-08-30
Status:
Closed
Updated Date:
2011-05-17
Project Name:
JDK
Resolved Date:
2011-05-17
Component:
client-libs
OS:
windows_vista
Sub-Component:
java.awt
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
7

Related Reports
Backport:
Relates:

Sub Tasks

Description
System Config.:
PIT 7.0 B20, windows-i586 bundle, Windows Vista 32bit
/net/bonsai.sfbay/w/builds/jdk/7/pit/b20/windows-i586

The following two tests only failed on Windows Vista. But they PASS in Windows 32bit system.

Permissions/AWTWindowTest
Permissions/DFLoadTest

Result. Dir.:
=============
http://sqeweb.sfbay.sun.com/net/jsn-sb2500-5/export/sec/test_exec/pit_7.0_dtf_results/08-29-07/sec/rerun/jsn_7.0_int-rerun_7.0_pit_sec_winvista32_part1-2007-08-30-10-22-35-0389/jsnadmin.Windows_Vista.x86/

% cat AWTWindowTest.err

java version "1.7.0-2007-08-28-152720.tbell.j2se"
Java(TM) SE Runtime Environment (build 1.7.0-2007-08-28-152720.tbell.j2se-Administrator_28_aug_2007_08_44-b00)
Java HotSpot(TM) Client VM (build 1.7.0-ea-b18, mixed mode, sharing)
Note: AWTWindowTest.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Exception in thread "main" java.lang.ExceptionInInitializerError
	at sun.awt.Win32GraphicsEnvironment.<clinit>(Win32GraphicsEnvironment.java:63)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:187)
	at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:83)
	at java.awt.Window.init(Window.java:386)
	at java.awt.Window.<init>(Window.java:439)
	at java.awt.Frame.<init>(Frame.java:420)
	at AWTWindowTest.<init>(AWTWindowTest.java:52)
	at AWTWindowTest.main(AWTWindowTest.java:87)
Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission sun.awt.nativedebug read)
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:342)
	at java.security.AccessController.checkPermission(AccessController.java:556)
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:550)
	at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1303)
	at java.lang.System.getProperty(System.java:689)
	at sun.awt.SunToolkit.<clinit>(SunToolkit.java:73)
	... 9 more
This bug was filed by the security PIT group, so I am reassigning to the AWT person who recently added the sun.awt.nativedebug code.

Similar error condition for DFLoadTest.

Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission sun.awt.nativedebug read)

There was a recent putback that is probably causing this error:

4638447: AWT Debugging Support Enhancements (Java level)

No codereviewer was listed in the SCCS comments, so I can't cc them.
Additional Info.:
These two tests originally failed on Windows 2003 machine (DNM-DTF-027).
But they PASSed in the rerun on Windows XP machine (jsn-gtwy-3).
Here is the rerun result directory.:
http://sqeweb/net/jsn-sb2500-5/export/sec/test_exec/pit_7.0_dtf_results/08-29-07/sec/rerun/jsn_7.0_int-rerun_7.0_pit_sec_win_32_part1-2007-08-30-09-47-25-0163/tonga.output/Summary.report

This Windows XP machine has the following Service Pack info.
Version 5.1 (Build 2600.xpsp_sp2_gdr.050301-1519: Service Pack 2)

                                    

Comments
EVALUATION

I can easily reproduce the reported problem on my WinXP desktop, so it is not Vista specific. I have also verified the proposed fix really eliminates the exception.
                                     
2007-09-04
EVALUATION

It's a bit strange that SecurityException is thrown only on Vista. In any case, we must perform reading of sun.awt.nativedebug property in doPrivileged() block.
                                     
2007-08-31
SUGGESTED FIX

--- SunToolkit.java	2007-08-31 10:11:57.000000000 +0400
***************
*** 70,77 ****
  
      /* Load debug settings for native code */
      static {
!         String nativeDebug = System.getProperty("sun.awt.nativedebug");
!         if ("true".equalsIgnoreCase(nativeDebug)) {
              DebugSettings.init();
          }
      };
--- 70,76 ----
  
      /* Load debug settings for native code */
      static {
!         if (AccessController.doPrivileged(new GetBooleanAction("sun.awt.nativedebug"))) {
              DebugSettings.init();
          }
      };
                                     
2007-08-31



Hardware and Software, Engineered to Work Together