JDK-5021755 : Netscape 4.7x browser crashes on Solairs x86
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 5.0
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_8
  • CPU: x86
  • Submitted: 2004-03-27
  • Updated: 2004-04-23
  • Resolved: 2004-04-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 b49Fixed
Related Reports
Duplicate :  
Relates :  
Description
This bug happens on Solaris x86 only. When Netscape 4.x launch plugin, it crashes at Plugin.start() method. By looking into it closely and based on the stack trace on the crash, it shows it crashes at some method called AWTIsHeadless. So this is why I filed the bug to AWT.

This bug shows up since b43. I don't think it is a bug because the same code works for Solaris sparc as well. Also we tried to use b44 plugin with b42 JRE and it doesn't crash but crash when we use b43/b44 JRE.
###@###.### 2004-03-26

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-beta2 FIXED IN: tiger-beta2 INTEGRATED IN: tiger-b49 tiger-beta2
24-08-2004

SUGGESTED FIX Name: atR10251 Date: 04/05/2004 ------- GraphicsEnvironment.java ------- *** /tmp/sccs.TMaqZY Fri Apr 2 17:03:17 2004 --- GraphicsEnvironment.java Fri Apr 2 17:00:20 2004 *************** *** 126,140 **** new java.security.PrivilegedAction() { public Object run() { String nm = System.getProperty("java.awt.headless"); if (nm == null) { ! String osName = System.getProperty("os.name"); ! headless = defaultHeadless = ! ("Linux".equals(osName) || "SunOS".equals(osName)) && ! (System.getenv("DISPLAY") == null) ? ! Boolean.TRUE : Boolean.FALSE; } else if (nm.equals("true")) { headless = Boolean.TRUE; } else { headless = Boolean.FALSE; } --- 126,144 ---- new java.security.PrivilegedAction() { public Object run() { String nm = System.getProperty("java.awt.headless"); if (nm == null) { ! /* No need to ask for DISPLAY when run in a browser */ ! if (System.getProperty("javaplugin.version") != null) { ! headless = defaultHeadless = Boolean.FALSE; ! } else { ! String osName = System.getProperty("os.name"); ! headless = defaultHeadless = ! Boolean.valueOf(("Linux".equals(osName) || "SunOS".equals(osName)) && ! (System.getenv("DISPLAY") == null)); ! } } else if (nm.equals("true")) { headless = Boolean.TRUE; } else { headless = Boolean.FALSE; } ###@###.### 2004-04-05 ======================================================================
05-04-2004

EVALUATION Name: rpR10076 Date: 04/02/2004 I found a problem with System.getenv() use when run in Netscape 4.x on Solaris-sparc/x86. Just to illustrate it I put System.getenv() call in a test applet (with no security checking) and here's what I got: java.lang.ExceptionInInitializerError at java.lang.System.getenv(System.java:795) at TestApplet.start(TestApplet.java:12) at sun.applet.AppletPanel.run(AppletPanel.java:395) at java.lang.Thread.run(Thread.java:570) Caused by: java.lang.NullPointerException at java.lang.String.<init>(String.java:486) at java.lang.ProcessEnvironment$Variable.valueOf(ProcessEnvironment.java:157) at java.lang.ProcessEnvironment.<clinit>(ProcessEnvironment.java:58) ... 4 more System.getenv("DISPLAY") is used in GraphicsEnvironment.getHeadlessProperty() method. It throws unchecked exception that probably follows to the "crash". Instead reassigning this bug (to fix System.getenv) it would be faster and simplier to workaround the problem. This workaround should be based on the fact that DISPLAY can't be NULL when we're run in a browser, and so we don't need to ask for it. Just set headless to false in this case. In order to detect the case of running in a browser we may check for instance if "javaplugin.version" system property is NULL or not. ###@###.### 2004-04-02 ======================================================================
02-04-2004