Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 5007118
Votes 0
Synopsis 5 JCK tests failing with -Xcheck:jni flag
Category java:classes_awt
Reported Against 1.3.1_12
Release Fixed 1.3.1_12
State 10-Fix Delivered, bug
Priority: 3-Medium
Related Bugs 4789983
Submit Date 03-MAR-2004
Description
When running JCK runtime tests on 1.3.1_12 build 1 using the -Xcheck:jni flag 5 tests fail. These are:
api/javax_swing/JPasswordField/descriptions.html#setgetXXX
api/javax_swing/text/DefaultEditorKit/CopyAction/index.html#SubCtors
api/javax_swing/text/DefaultEditorKit/CutAction/index.html#SubCtors
api/javax_swing/text/DefaultEditorKit/PasteAction/index.html#SubCtors
api/javax_swing/text/JTextComponent/index.html#copy_paste

The error that comes up for these tests are:

FATAL ERROR in native method: Bad global or local ref passed to JNI
	at sun.awt.motif.X11Selection.pGetTransferTargets(Native Method)
	at sun.awt.motif.SelectionThread.run(X11Selection.java:302)

I ran the tests on a Solaris 9/x86 update 5.
Work Around
N/A
Evaluation
This problem is as a result of the fix for bugId 4784641 in 1.3.1_10. 

It is not a regression in the true sense of the word, but from a end users point
of view it will look like a regression. The fix for bugId 4784641 simply 
exposed the problem.

All 5 tests are failing with a similar stack:

=>[1] jni_FatalError(0x289d4, 0xff111764, 0x24, 0xffbfc, 0xff156174, 0xffbfcd7c), at 0xfefff7e8
  [2] checked_jni_IsSameObject(0xff16bcc0, 0x28948, 0xb8800, 0x289d4, 0xff156174, 0xde92c), at 0xff014f98
  [3] awt_currentThreadIsPrivileged(0x289d4, 0xf5b8381c, 0x262, 0x4, 0x20, 0x2), at 0xf5a9d3a4
  [4] awt_util_getCurrentServerTime(0xf5b8b4f8, 0xf5b85d64, 0x289d4, 0xf5b8381c, 0x1d0460, 0xff156174), at 0xf5abccac
  [5] Java_sun_awt_motif_X11Selection_pGetSelectionOwnership(0x289d4, 0xffbfd074, 0x289d4, 0xf5b8381c, 0x2, 0x0), at 0xf5ab8670
  [6] 0x4e980(0xf60f8e48, 0xffbfd3b8, 0x28948, 0xff156174, 0xb6, 0xfa21e6c8), at 0x4e97f
  .......

As a result of 4784641 checked_jni_IsSameObject now validates jni handles. One
of the handles being passed to checked_jni_IsSameObject, awt_MainThread is not 
a valid handle. Hence the failure.

The fix is to make awt_MainThread a Global Reference ( see suggested fix ).
This is the Solaris part of 4789983.

This is not an issue in 1.4.2_0x

  xxxxx@xxxxx   2004-03-05
---------------------------------------
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang