JDK-4308929 : International versions of Windows 2000 crash appletviewer.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.1.6,1.1.7,1.1.8
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS:
    solaris_2.4,solaris_2.5.1,windows_nt solaris_2.4,solaris_2.5.1,windows_nt
  • CPU: generic,x86,sparc
  • Submitted: 2000-02-01
  • Updated: 2002-11-15
  • Resolved: 2002-11-15
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
1.4.2 mantisFixed
Related Reports
Relates :  
Relates :  
Description
Included is a description from Lotus about how to crash the appletviewer in Windows 2000. This issue has been filed as an RFE 4303460. Please some additional details there. It is also filed against 1.2.2. We are publicly claiming on our Web site to support 1.1.8 on Windows 2000. So I am filing this as a bug against 1.1.8. Please see RFE 4303460 for details on how to fix the problem. 



Here is how to reproduce the crash of appletviewer.

Start Windows 2000.
In the control panel, open Regional Options.
Select Indic in the "Language settings for the system".
Windows 2000 will access the CD to install Indic specific files.  Please
insert the Windows 2000 CD.
You might need to restart the system.
After restarting the system, please go to the Regional Options again.
Select "Hindi" in "Your locale (location)".
Open appletviewer and run any applet.
The applet viewer crashes.


I think you can always reproduct the crash
tom.kincaid@east 2000-02-09

The evaluation called for us to reproduce it on the Kestrel Beta. The bug was not filed on the kestrel beta. It was filed on 1.1.8. The bug is not incomplete.

In the meantime I will see if I can get the customer to reproduce the bug on the Kestrel Beta in order to help debug the problem.


Comments from licensee Oracle::
---
Specifically, this occurs only when a component is displayed.  An
application that simply creates and shows a frame will cause the
crash.

The problem is that awt_Font.cpp->GetCodePageSubkey calls setlocale,
which returns NULL.  The problem isn't that setlocale is failing,
but that the subsequent code then attemps to pass the return value to
strchr, which fails.

The NULL result occurs because there's no ANSI code page for the
Indic locales, which are all Unicode.  I recommend reading the
documentation for GetLocaleInfo, GetLocaleInfoW, setlocale and
_wsetlocale on msdn.microsoft.com.

Note that this only occurs using Windows 2000.  This occurs in 1.1.7
of the JDK, and though I haven't tested in newer versions, the code
is the same.  As long as Windows 2000 is returning a NULL code page,
the crash will occur.

Also, this crash occurs running a simple applet in the Netscape VM,
but does NOT occur using the IE VM.
Bug WorkaroundI have no workaround, other than returning NULL upon failure of
setlocale to return a valid code page.  I don't know if this will
work on Indic versions of Windows 2000, but it does work on English
versions that have been set to an Indic locale.

---

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mantis FIXED IN: mantis INTEGRATED IN: mantis mantis-b08
14-06-2004

SUGGESTED FIX ------- awt_Font.cpp ------- *** /tmp/dNYaqkp Fri Dec 1 17:23:58 2000 --- awt_Font.cpp Fri Dec 1 17:23:50 2000 *************** *** 1733,1739 **** LPSTR lpszLocale = setlocale(LC_CTYPE, ""); // cf lpszLocale = "Japanese_Japan.932" ! DASSERT(lpszLocale); LPSTR lpszCP = strchr(lpszLocale, (int) '.'); if (lpszCP == NULL) return NULL; --- 1733,1740 ---- LPSTR lpszLocale = setlocale(LC_CTYPE, ""); // cf lpszLocale = "Japanese_Japan.932" ! if (lpszLocale == NULL) ! return NULL; LPSTR lpszCP = strchr(lpszLocale, (int) '.'); if (lpszCP == NULL) return NULL; eric.hawkes@eng 2000-12-01
01-12-2000

EVALUATION I would like to know whether this problem is reproducible in Kestrle-RC1 or Merlin-beta. If it is, I need more details about the nature of the crash. I assume that on failure, there is some sort of VM stack trace or other messages which may indicate where the problem lies. It is unlikely that this is a problem attributable directly to AppletViewer, but without further details, I am unable to determine precisely what part of the JDK is causing the problem. iris.garcia@eng 2000-02-02 In the description comments from Oracle, they seem to indicate that the problem lies in awt_Font.cpp. Routing to awt. iris.garcia@eng 2000-10-18 The description seems to say this is a duplicate of 4303460, which was fixed in merlin-beta, and is assigned to classes_util_i18n. However, the problem described seems to be support for Indic, which is not done. eric.hawkes@eng 2000-11-15 As can be seen from the description of the problem, "The problem is that awt_Font.cpp->GetCodePageSubkey calls setlocale, which returns NULL.", it appears that what is happening is that NULL is being returned when the AWT code requests the codepage for the Hindi locale. There is no codepage for Hindi nor will there apparently ever be. The likely solution to this problem is to convert the JDK to a Windows Unicode application to provide the functionality desired or to prevent the crashing at the very least to check the return codes on the Windows API calls. stuart.gill@eng 2000-11-15 Yup, passing NULL to strchr definitely crashes. See suggested fix. eric.hawkes@eng 2000-12-01
15-11-2000