I was imitating "failed read" by returning -1.
In most cases JVM handled error correctly by throwing the exceptions.
However, if read failure happens on 141th or on 142 invocation of read JVM crashes
with following error:
> jdk_b83_solaris_sparc/bin/java -version
/net/vmsqe-amd-01.russia/export3/vmsqe/jdk-builds/JDK6b83/solaris-sparc/jre/lib/rt.jar: error reading zip file
#
# An unexpected error has been detected by Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0xfea861e4, pid=126, tid=2
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0-beta2-b83 mixed mode)
# Problematic frame:
# V [libjvm.so+0x2861e4]
#
# An error report file with more information is saved as hs_err_pid126.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
Abort (core dumped)
Fastdebug jvm fails with assertion:
> jdk_b83_solaris_sparc/fastdebug/bin/java -version
/net/vmsqe-amd-01.russia/export3/vmsqe/jdk-builds/JDK6b83/solaris-sparc/fastdebug/jre/lib/rt.jar: error reading zi
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc: SuppressErrorAt=/systemDictionary.hpp:218]
#
# An unexpected error has been detected by Java Runtime Environment:
#
# Internal Error (/BUILD_AREA/jdk6.0/hotspot/src/share/vm/memory/systemDictionary.hpp, 218 [ Unknown ]), pid=127,
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0-beta2-fastdebug-b83-debug mixed mode)
#
# Error: assert(k != 0,"preloaded klass not initialized")
# An error report file with more information is saved as hs_err_pid127.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
Current thread is 2
Dumping core ...
Looking at stack trace:
=>[1] read(0x5, 0xfe77ea40, 0x1e, 0x0, 0xff2e8284, 0xff2e8284), at 0xff380410
[2] readFully(0x5, 0xfe77ea40, 0x0, 0x1e, 0x7fffffff, 0x5867b4), at 0xfe7aca80
[3] readFullyAt(0x5, 0xfe77ea40, 0x0, 0x1e, 0x0, 0xfd40492b), at 0xfe7acb24
[4] ZIP_GetEntryDataOffset(0x5d020, 0xa17f8, 0xffffffff, 0x2f64, 0xfe7b0000, 0xfd40492c), at 0xfe7ad0d8
[5] ZIP_Read(0x5d020, 0xa17f8, 0x0, 0x0, 0x951a0, 0x951), at 0xfe7a50f0
[6] ZIP_ReadEntry(0x5d020, 0xa17f8, 0x951a0, 0x0, 0x7fffffff, 0x951), at 0xfe7ad494
[7] ClassPathZipEntry::open_stream(0x356a8, 0x13c00, 0x30400, 0x0, 0xfede8c04, 0x9c28), at 0xfe8d8068
[8] LazyClassPathEntry::open_stream(0x32d98, 0x30988, 0xfede5cc0, 0xfe8d7d7c, 0x9c34, 0x0), at 0xfea17388
[9] ClassLoader::load_classfile(0xfe77ef40, 0xfe77ef3c, 0x30400, 0x32d98, 0x30c64, 0xfeddc000), at 0xfe8d7ad4
[10] SystemDictionary::load_instance_class(0xfe77f034, 0xfe77f030, 0x30400, 0x0, 0x2d608, 0x0), at 0xfe8a040c
[11] SystemDictionary::resolve_instance_class_or_null(0xcc43, 0xfe77f12c, 0xfe77f128, 0x1cc, 0x30400, 0x5ac072), a
[12] SystemDictionary::resolve_or_null(0xfe77f1ac, 0xfe77f1a8, 0xfedff2bc, 0x0, 0x0, 0xfe864f2c), at 0xfe8a3450
[13] SystemDictionary::resolve_or_null(0xfe77f240, 0x30400, 0x30400, 0xfedf2954, 0x16954, 0xfedff2bc), at 0xfe8a2c
[14] SystemDictionary::initialize_preloaded_classes(0x30400, 0x16958, 0x1, 0xfeddc000, 0xfedff028, 0x1695c), at 0x
[15] SystemDictionary::initialize(0x30400, 0x53e214, 0x35b58, 0x35b30, 0x35b08, 0xfeddc000), at 0xfe89dee8
[16] Universe::genesis(0x30400, 0x171a0, 0x2b500, 0xfedf31f4, 0x2c4a0, 0xfeddc000), at 0xfe896330
[17] universe2_init(0xfc428540, 0xfffa8ce4, 0x57000, 0x546ea4, 0xfeddc000, 0x368), at 0xfe895184
[18] init_globals(0x0, 0x1685c, 0x0, 0xfeddc000, 0x58c97c, 0xfed72088), at 0xfe84f72c
[19] Threads::create_vm(0x16c00, 0xfe77ff1b, 0x30400, 0x16bfc, 0xff342400, 0xfeddc000), at 0xfec7fcb4
[20] JNI_CreateJavaVM(0xfe77ff94, 0xfe77ff90, 0xfe77ff80, 0xfedf0234, 0xfe846974, 0xfeddc000), at 0xfe84672c
[21] JavaMain(0xfe84665c, 0x2b1a4, 0x0, 0x0, 0x0, 0x1), at 0x12648
code seems to be not ready to get -1 from 'readFully' (from
j2se_ws/src/share/native/java/util/zip/zip_util.c)
(ClassLoader::load_classfile return NULL, etc.)
Adding some checks may help to avoid crash.
To reproduce the failure:
1. login on solaris machine
2. cp -fr /home/ep155969/work/FaultInjection/read YOUR_LOCAL_DIR
3. cd YOUR_LOCAL_DIR
4. make
5. export LD_PRELOAD=./myread.so
6. export INJECT_FAULT_AT=141
7. JAVA_PATH -version
To see stack trace for particular failure do:
1-6
7. export WAIT_AFTER_INJECTION=1
8. JAVA_PATH -version & JAVA_PID=$!
9. login to another terminal or set LD_PRELOAD=
10. dbx JAVA_PATH $JAVA_PID
You can also inject failures in all places 'read' is called at and see when JVM
does crash. To do it run inject_faults.sh:
bash inject_faults.sh JAVA_PATH INJECTION_START INJECTION_END
The failure results will be stored in ./results dir.
Examples:
bash inject_faults.sh /net/koori.sfbay/onestop/jdk/1.6.0/latest/binaries/solaris-i586/bin/java 1 10
To see how many times read is called set INJECT_FAULT_AT=0 and run
"JAVA_PATH -version".
--------------------
To fix bug 6404463, we used system call "read" directly instead of calling
"JVM_Read()" in readFullyAt function of zip_util.c to work around some
interrupt I/O related issue. You can test the build before b49. I believe we
will see the same crash even by calling JVM_Read. However, in any rate, I do
think we should at least show some meaningful message based on the errno we
get from read when it returns -1 and then die. That at least give some idea
to user why the VM is crashing. Same change has to be made in the code
calling that method in J2SE side.
-Xiaobin
--------------------
In most cases JVM handled error correctly by throwing the exceptions.
However, if read failure happens on 141th or on 142 invocation of read JVM crashes
with following error:
> jdk_b83_solaris_sparc/bin/java -version
/net/vmsqe-amd-01.russia/export3/vmsqe/jdk-builds/JDK6b83/solaris-sparc/jre/lib/rt.jar: error reading zip file
#
# An unexpected error has been detected by Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0xfea861e4, pid=126, tid=2
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0-beta2-b83 mixed mode)
# Problematic frame:
# V [libjvm.so+0x2861e4]
#
# An error report file with more information is saved as hs_err_pid126.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
Abort (core dumped)
Fastdebug jvm fails with assertion:
> jdk_b83_solaris_sparc/fastdebug/bin/java -version
/net/vmsqe-amd-01.russia/export3/vmsqe/jdk-builds/JDK6b83/solaris-sparc/fastdebug/jre/lib/rt.jar: error reading zi
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc: SuppressErrorAt=/systemDictionary.hpp:218]
#
# An unexpected error has been detected by Java Runtime Environment:
#
# Internal Error (/BUILD_AREA/jdk6.0/hotspot/src/share/vm/memory/systemDictionary.hpp, 218 [ Unknown ]), pid=127,
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0-beta2-fastdebug-b83-debug mixed mode)
#
# Error: assert(k != 0,"preloaded klass not initialized")
# An error report file with more information is saved as hs_err_pid127.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
Current thread is 2
Dumping core ...
Looking at stack trace:
=>[1] read(0x5, 0xfe77ea40, 0x1e, 0x0, 0xff2e8284, 0xff2e8284), at 0xff380410
[2] readFully(0x5, 0xfe77ea40, 0x0, 0x1e, 0x7fffffff, 0x5867b4), at 0xfe7aca80
[3] readFullyAt(0x5, 0xfe77ea40, 0x0, 0x1e, 0x0, 0xfd40492b), at 0xfe7acb24
[4] ZIP_GetEntryDataOffset(0x5d020, 0xa17f8, 0xffffffff, 0x2f64, 0xfe7b0000, 0xfd40492c), at 0xfe7ad0d8
[5] ZIP_Read(0x5d020, 0xa17f8, 0x0, 0x0, 0x951a0, 0x951), at 0xfe7a50f0
[6] ZIP_ReadEntry(0x5d020, 0xa17f8, 0x951a0, 0x0, 0x7fffffff, 0x951), at 0xfe7ad494
[7] ClassPathZipEntry::open_stream(0x356a8, 0x13c00, 0x30400, 0x0, 0xfede8c04, 0x9c28), at 0xfe8d8068
[8] LazyClassPathEntry::open_stream(0x32d98, 0x30988, 0xfede5cc0, 0xfe8d7d7c, 0x9c34, 0x0), at 0xfea17388
[9] ClassLoader::load_classfile(0xfe77ef40, 0xfe77ef3c, 0x30400, 0x32d98, 0x30c64, 0xfeddc000), at 0xfe8d7ad4
[10] SystemDictionary::load_instance_class(0xfe77f034, 0xfe77f030, 0x30400, 0x0, 0x2d608, 0x0), at 0xfe8a040c
[11] SystemDictionary::resolve_instance_class_or_null(0xcc43, 0xfe77f12c, 0xfe77f128, 0x1cc, 0x30400, 0x5ac072), a
[12] SystemDictionary::resolve_or_null(0xfe77f1ac, 0xfe77f1a8, 0xfedff2bc, 0x0, 0x0, 0xfe864f2c), at 0xfe8a3450
[13] SystemDictionary::resolve_or_null(0xfe77f240, 0x30400, 0x30400, 0xfedf2954, 0x16954, 0xfedff2bc), at 0xfe8a2c
[14] SystemDictionary::initialize_preloaded_classes(0x30400, 0x16958, 0x1, 0xfeddc000, 0xfedff028, 0x1695c), at 0x
[15] SystemDictionary::initialize(0x30400, 0x53e214, 0x35b58, 0x35b30, 0x35b08, 0xfeddc000), at 0xfe89dee8
[16] Universe::genesis(0x30400, 0x171a0, 0x2b500, 0xfedf31f4, 0x2c4a0, 0xfeddc000), at 0xfe896330
[17] universe2_init(0xfc428540, 0xfffa8ce4, 0x57000, 0x546ea4, 0xfeddc000, 0x368), at 0xfe895184
[18] init_globals(0x0, 0x1685c, 0x0, 0xfeddc000, 0x58c97c, 0xfed72088), at 0xfe84f72c
[19] Threads::create_vm(0x16c00, 0xfe77ff1b, 0x30400, 0x16bfc, 0xff342400, 0xfeddc000), at 0xfec7fcb4
[20] JNI_CreateJavaVM(0xfe77ff94, 0xfe77ff90, 0xfe77ff80, 0xfedf0234, 0xfe846974, 0xfeddc000), at 0xfe84672c
[21] JavaMain(0xfe84665c, 0x2b1a4, 0x0, 0x0, 0x0, 0x1), at 0x12648
code seems to be not ready to get -1 from 'readFully' (from
j2se_ws/src/share/native/java/util/zip/zip_util.c)
(ClassLoader::load_classfile return NULL, etc.)
Adding some checks may help to avoid crash.
To reproduce the failure:
1. login on solaris machine
2. cp -fr /home/ep155969/work/FaultInjection/read YOUR_LOCAL_DIR
3. cd YOUR_LOCAL_DIR
4. make
5. export LD_PRELOAD=./myread.so
6. export INJECT_FAULT_AT=141
7. JAVA_PATH -version
To see stack trace for particular failure do:
1-6
7. export WAIT_AFTER_INJECTION=1
8. JAVA_PATH -version & JAVA_PID=$!
9. login to another terminal or set LD_PRELOAD=
10. dbx JAVA_PATH $JAVA_PID
You can also inject failures in all places 'read' is called at and see when JVM
does crash. To do it run inject_faults.sh:
bash inject_faults.sh JAVA_PATH INJECTION_START INJECTION_END
The failure results will be stored in ./results dir.
Examples:
bash inject_faults.sh /net/koori.sfbay/onestop/jdk/1.6.0/latest/binaries/solaris-i586/bin/java 1 10
To see how many times read is called set INJECT_FAULT_AT=0 and run
"JAVA_PATH -version".
--------------------
To fix bug 6404463, we used system call "read" directly instead of calling
"JVM_Read()" in readFullyAt function of zip_util.c to work around some
interrupt I/O related issue. You can test the build before b49. I believe we
will see the same crash even by calling JVM_Read. However, in any rate, I do
think we should at least show some meaningful message based on the errno we
get from read when it returns -1 and then die. That at least give some idea
to user why the VM is crashing. Same change has to be made in the code
calling that method in J2SE side.
-Xiaobin
--------------------
- duplicates
-
JDK-6425580 JVM crashes on failed 'read' call: Internal Error in exceptions.cpp, 308
-
- Closed
-