JDK-6625467 : The Excelsior Runtime abruptly terminates with access violation when passing api/java_awt/TrayIcon
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6.0a
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-11-02
  • Updated: 2012-03-22
  • Resolved: 2007-11-06
Related Reports
Duplicate :  
Description
Test Challenger Name and Company:

   Vitaly Mikheev, Excelsior LLC

Specification Name and Version:

   The Java Language Specification, 3rd Edition; Java Platform Standard Ed 6.0

Test Suite Name and Version:

   JCK 6a (29-May-2007, build b14)

TestName:
   api/java_awt/TrayIcon

COMPLAINT:

The Excelsiro Runtime abruptly terminates with access violation when passing these tests.

HOW TO REPRODUCE ON THE RI

It does not appear under HotSpot by a lucky accidence.

ROOT CAUSE ANALYSIS:

The native method Java_sun_awt_windows_WToolkit_isProtectedMode() introduced in version 1.6.0_02, uses the IEIsProtectedModeProcessFunc winapi function declaring it as

   typedef HRESULT IEIsProtectedModeProcessFunc(BOOL *);

It effectively means that the function will be called with the C (cdecl) calling convension whereas it's actually coded with the stdcall calling convension.

As a result, a call to the function breaks stack balance and provokes various unpredictable crashes.

See "Suggested fix" for more information how to fix the problem.

Comments
EVALUATION 'isProtectedMode' method is absent in JDK7, while in JDK6 this problem has been already fixed by 6587371. In JDK5 there is no TrayIcon and SystemTray classes at all.
06-11-2007

SUGGESTED FIX The location of the file is j2se\src\windows\native\sun\windows\awt_Toolkit.cpp See in attachment section both original and fixed source code. <<Bugs.awt_Toolkit.cpp>> <<awt_Toolkit_fixed.cpp>>
02-11-2007