-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
1.4.1
-
generic, x86
-
linux, solaris_8
Name: abR10010 Date: 07/10/2002
Use of JNIEnv in native thread causes assertion failure with java_g:
# HotSpot Virtual Machine Error, assertion failure
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Java VM: Java HotSpot(TM) Client VM (1.4.1-rc-b16-debug mixed mode)
#
# assert(thread != 0, "just checking")
#
# Error ID: /BUILD_AREA/jdk1.4.1/hotspot/src/share/vm/runtime/thread.hpp, 364 [ Patched ]
#
Dumping core....
This failure happens under build 1.4.1-rc-b16 on both Solarises (sparc,x86) and Linux
platforms.
To reproduce the bug run with HS1.4.1
doit.sh $JAVA_HOME [-g] [-options]
in /net/sqesvr.sfbay/export/vsn/GammaBase/Bugs/<this bug number>
where:
JAVA_HOME should point testable JDK
-g run with Java debug binaries
-options Java options (-Xcheck:jni, for example)
Please note that usual java (not java_g) passes the attached test without
the -Xcheck:jni option but with the -Xcheck:jni option gives message:
FATAL ERROR in native method: Using JNIEnv in non-Java thread
and ceases execution of the test with exit code = 1.
See logs:
% doit.sh ~/dest/jdk1.4.1-b16/solaris-sparc -g
cc -G -KPIC -Ijni_include_solsparc -o sparc/libTestAB97_g.so TestAB97.c
~/jdk1.4.1-b16/solaris-sparc/bin/javac TestAB97.java
~/jdk1.4.1-b16/solaris-sparc/bin/java_g -version
java version "1.4.1-rc"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-rc-b16)
Java HotSpot(TM) Client VM (build 1.4.1-rc-b16-debug, mixed mode)
~/jdk1.4.1-b16/solaris-sparc/bin/java_g TestAB97
==> TestAB97: BEFORE createNativeThread() ...
**> TestAB97 (native thread): BEFORE GetVersion()
==> TestAB97: AFTER createNativeThread() ...
#
# HotSpot Virtual Machine Error, assertion failure
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Java VM: Java HotSpot(TM) Client VM (1.4.1-rc-b16-debug mixed mode)
#
# assert(thread != 0, "just checking")
#
# Error ID: /BUILD_AREA/jdk1.4.1/hotspot/src/share/vm/runtime/thread.hpp, 364 [ Patched ]
#
Dumping core....
Abort
exit code = 134
-------------------------
% doit.sh ~/jdk1.4.1-b16/solaris-sparc
cc -G -KPIC -Ijni_include_solsparc -o sparc/libTestAB97.so TestAB97.c
~/jdk1.4.1-b16/solaris-sparc/bin/javac TestAB97.java
~/jdk1.4.1-b16/solaris-sparc/bin/java -version
java version "1.4.1-rc"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-rc-b16)
Java HotSpot(TM) Client VM (build 1.4.1-rc-b16, mixed mode)
~/jdk1.4.1-b16/solaris-sparc/bin/java TestAB97
==> TestAB97: BEFORE createNativeThread() ...
**> TestAB97 (native thread): BEFORE GetVersion()
**> TestAB97 (native thread): AFTER GetVersion(): JNI version = 10004
==> TestAB97: AFTER createNativeThread() ...
==> TestAB97: PASSED
exit code = 95
-------------------------
% doit.sh ~/jdk1.4.1-b16/solaris-sparc -Xcheck:jni
cc -G -KPIC -Ijni_include_solsparc -o sparc/libTestAB97.so TestAB97.c
~/jdk1.4.1-b16/solaris-sparc/bin/javac TestAB97.java
~/jdk1.4.1-b16/solaris-sparc/bin/java -Xcheck:jni -version
java version "1.4.1-rc"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-rc-b16)
Java HotSpot(TM) Client VM (build 1.4.1-rc-b16, mixed mode)
~/jdk1.4.1-b16/solaris-sparc/bin/java -Xcheck:jni TestAB97
==> TestAB97: BEFORE createNativeThread() ...
**> TestAB97 (native thread): BEFORE GetVersion()
FATAL ERROR in native method: Using JNIEnv in non-Java thread
exit code = 1
======================================================================