JDK-6205044 : JCK: FATAL ERROR in native method: Bad global or local ref passed to JNI
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.2_07
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2004-12-07
  • Updated: 2010-05-09
  • Resolved: 2004-12-17
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_08Resolved
Related Reports
Duplicate :  
Relates :  
Description
FULL PORDUCT VERSION :
java version "1.4.2_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_07-b04)
Java HotSpot(TM) Client VM (build 1.4.2_07-b04, mixed mode)

FULL OS
1. WindowsXPPro Version 5.1(Build 2600.xpsp_sp2_rtm.040803-2158: Service Pack 2)
  and
2. WindowsXPPRO Version 5.1(Build 2600.xpsp2.030422-1633: Service Pack 1)

DESCRIPTION
This error occurs when executing JCK-Runtime tests using the flag Xcheck:jni
There is one failure javasoft.sqe.tests.api.java.awt.interactive.DnDComponentTest

could be related to CR6193413 and bug fix 4664556

==========================
Error message
==========================
First you get about 100 lines of this error message

"Warning: Calling other JNI functions in the scope of 
Get/ReleasePrimitiveArrayCritical or Get/ReleaseStringCritical"

Followed by this final message

"FATAL ERROR in native method: 
Bad global or local ref passed to JNI 	
at sun.awt.windows.WToolkit.eventLoop(Native Method) 	
at sun.awt.windows.WToolkit.run(WToolkit.java:262) 	
at java.lang.Thread.run(Thread.java:534)"

==================================================================
To Reproduce Windows only
==================================================================
1. Map z: to \\latte.ireland\JCK
2. set CLASSPATH=Z:\jck\JCK-runtime-14a\classes
3. set PATH=z:/jck/JCK-runtime-14a/lib/windows
4. set SystemRoot=c:\Windows or c:winnt etc..
5. Install the jdk locally on your machine.
   or map j: to /net/latte.ireland/deployment4/jdk/1.4.2_07b04/windows-i586
6. put java in your PATH
7  java -Xcheck:jni -Djava.awt.headless=false -Xfuture -Djava.security.policy=Z:\jck\JCK-runtime-14a\lib\jck.policy javasoft.sqe.tests.api.java.awt.interactive.DnDComponentTest -platform.robotAvailable true -TestCaseID ALL
 




###@###.### 2004-12-07 13:13:47 GMT

Comments
SUGGESTED FIX Corrected fix for 1.4.2_08: 642 % sccs diffs -r1.50 awt_DnDDS.cpp ------- awt_DnDDS.cpp ------- 48c48,50 < StartDragRec sdr = {self, cursor}; --- > StartDragRec* sdrp = new StartDragRec; > sdrp->dragSource = self; > sdrp->cursor = cursor; 52c54 < AwtToolkit::GetInstance().InvokeFunctionLater((void (*)(void *))&AwtDragSource::_DoDragDrop, (void *)&sdr); --- > AwtToolkit::GetInstance().InvokeFunctionLater((void (*)(void *))&AwtDragSource::_DoDragDrop, (void *)sdrp); 54a57 > 68a72,74 > env->DeleteGlobalRef(sdrp->cursor); > delete sdrp; > 1535a1542,1543 > cursor = env->NewGlobalRef(cursor); > ###@###.### 2004-12-17 20:00:06 GMT
07-12-2004

EVALUATION I mis-evaluated this as a duplicate of 5076963, it appears to be a separate bug in DND. The Windows DragNDrop uses Invokelater to schedule the source. This causes a thread switch but the cursor reference is local. Will test new proposed fix soon. ###@###.### 2004-12-16 15:36:59 GMT I believe this bug is a duplicate of 5082481. ###@###.### 2004-12-17 13:22:17 GMT Agreed... thanks Alexander! I hacve corrected the suggested fix to your version from 1.5_01 and tested it. The backported fix works fine. Closing this bug as a dup of 5082481. ###@###.### 2004-12-17 20:00:06 GMT
07-12-2004