-
Bug
-
Resolution: Fixed
-
P2
-
5.0
-
beta
-
x86, itanium
-
windows_98, windows_nt, windows_2000
-
Verified
Name: vsR10238 Date: 10/23/2003
Filed By : J2SE-SQA [###@###.###
JDK : JDK1.5.0-(b23,b24,b25)
Testbase : Regression-test
Platform[s] : Windows
switch/Mode : -client, -server
Falling test[s]:
java/awt/FileDialog/TestFileDialogJNIRef/TestFileDialogJNIRef.sh
java/net/InetAddress/CheckJNI.java
These 2 Regression-test tests fail on Windows with JDK1.5.0-b23,b24,b25 with the following error:
FATAL ERROR in native method: Bad global or local ref passed to JNI
The tests pass with JDK1.5.0-b22, JDK1.4.2-b28.
The tests pass with JDK1.5.0-b23,b24,b25 on other platforms.
These tests use -Xcheck:jni option. Even a simple code that create java.awt.Frame:
import java.awt.*;
public class Main
{
public static void main(String[] args)
{
Frame frm=new Frame("Main");
}
};
causes the following error starting from JDK1.5.0-b23 when JVM is run with -Xcheck:jni :
FATAL ERROR in native method: Bad global or local ref passed to JNI
at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
Since the tests produce the same error message starting from the same build
I decided to file one bug for both failures. Please let me know if one more
bug should be filed for the second test.
Test source location:
=====================
/java/re/jdk/1.5.0/promoted/all/b24/ws/j2se/test/java/awt/FileDialog/TestFileDialogJNIRef/TestFileDialogJNIRef.sh
/java/re/jdk/1.5.0/promoted/all/b24/ws/j2se/test/java/net/InetAddress/CheckJNI.java
jtr file location:
==================
/net/jtgb4u4c.sfbay/export/sail15/results.2/tiger/b24/regtest/win32/win2000_linux-2/workDir/test/java/awt/FileDialog/TestFileDialogJNIRef/TestFileDialogJNIRef.jtr
/net/jtgb4u4c.sfbay/export/sail15/results.2/tiger/b24/regtest/win32/win2000_linux-2/workDir/test/java/net/InetAddress/CheckJNI.jtr
How to reproduce:
=================
Run the following script (you may need to change its variables)
--- script start ---
#!/bin/sh
RESULT_DIR=`pwd`
WORK_DIR=$RESULT_DIR/workDir/test
REPORT_DIR=$RESULT_DIR/reportDir
#Paths in Java Software:
JT_HOME="z:/jct-tools/3.1.2/archive/fcs/binaries"
JEMMY_JAR="x:/Jemmy/jemmy.jar"
JAVA_HOME="z:/jdk/1.5.0/promoted/all/b24/binaries/windows-i586"
TEST_BASE_PATH="z:/jdk/1.5.0/promoted/all/b24/ws/j2se/test"
#Alternative paths for the NSK site:
#JT_HOME="h:/java/jct"
#JEMMY_JAR="$JT_HOME/jemmy/jemmy.jar"
#JAVA_HOME="h:/java/jdk1.5.0/win32"
#TEST_BASE_PATH="h:/java/regtest.tiger/test"
TESTVMOPTS="-client"
CLASSPATH="$JT_HOME/classes;$JT_HOME/lib/javatest.jar;$JT_HOME/lib/jtreg.jar"
TEST="java/awt/FileDialog/TestFileDialogJNIRef/TestFileDialogJNIRef.sh"
mkdir -p $WORK_DIR/scratch 2>&1
mkdir -p $WORK_DIR/jtData 2>&1
mkdir -p $REPORT_DIR 2>&1
#rm $WORK_DIR/jtData/ResultCache.jtw 2>&1
cd $WORK_DIR/scratch
$JAVA_HOME/bin/java -server -cp $CLASSPATH -DenvVars=TESTJAVAHOME=$JAVA_HOME,TESTVMOPTS=$TESTVMOPTS,DISPLAY=:0,windir=$windir,SystemRoot=$SystemRoot,PATH=${SHELL%/*},CPAPPEND=$JEMMY_JAR,TZ=,LC_ALL=en_US,LC_CTYPE=en_US,LANG=en_US,LPDEST= -DDISPLAY=:0 -DlocalHost="linux-2" -Dprogram=jtreg com.sun.javatest.regtest.Main -a -v default -batch -params -w "$WORK_DIR" -r "$REPORT_DIR" -t "$TEST_BASE_PATH" "$TEST_BASE_PATH/$TEST"
--- script end ---
Test output (java/net/InetAddress/CheckJNI.jtr part):
===========================================================
----------messages:(3/137)----------
command: main -Xcheck:jniCheckJNI
reason: User specified action: run main/othervm -Xcheck:jni CheckJNI
elapsed time (seconds): 0.31
----------System.out:(14/875)----------
FATAL ERROR in native method: Bad global or local ref passed to JNI
at java.lang.ClassLoader.findBootstrapClass(Native Method)
at java.lang.ClassLoader.findBootstrapClass0(ClassLoader.java:852)
at java.lang.ClassLoader.loadClass(ClassLoader.java:284)
- locked <0x02af3298> (a sun.misc.Launcher$ExtClassLoader)
at java.lang.ClassLoader.loadClass(ClassLoader.java:282)
- locked <0x02afa218> (a sun.misc.Launcher$AppClassLoader)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:279)
- locked <0x02afa218> (a sun.misc.Launcher$AppClassLoader)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
- locked <0x02afa218> (a sun.misc.Launcher$AppClassLoader)
at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:74)
at java.lang.Thread.run(Thread.java:549)
----------System.err:(0/0)----------
result: Failed. Unexpected exit from test [exit code: 1]
test result: Failed. Unexpected exit from test [exit code: 1]
Test output (java/awt/FileDialog/TestFileDialogJNIRef/TestFileDialogJNIRef.jtr part):
===========================================================
----------System.out:(0/0)----------
----------System.err:(0/0)----------
result: Passed. Compilation successful
#section:shell
----------messages:(3/139)----------
command: shell TestFileDialogJNIRef.sh
reason: User specified action: run shell TestFileDialogJNIRef.sh
elapsed time (seconds): 0.711
----------System.out:(8/397)----------
JDK under test is: c:/j2sdk1.5.0
FATAL ERROR in native method: Bad global or local ref passed to JNI
at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
The test failed :-(
exit status was 1
----------System.err:(0/0)----------
result: Failed. Execution failed: exit code 1
test result: Failed. Execution failed: exit code 1
Specific machine info:
======================
Hostname: linux-2
OS: Windows 2000 Pro
======================================================================
- duplicates
-
JDK-4944603 REGRESSION: Four JCK1.5 runtime vm/concepts/exceptions/exceptions031 tests fail
- Closed
-
JDK-4946149 (cl) -Xcheck:jni detects error in native ClassLoader method findBootstrapClass
- Closed
-
JDK-4949733 WIN IA64: Out of memory error
- Closed