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: 4838891
Votes 0
Synopsis ZipFile.getNextEntry JVM crash
Category java:classes_util_jarzip
Reported Against 1.4.1
Release Fixed
State 11-Closed, Not a Defect, bug
Priority: 3-Medium
Related Bugs
Submit Date 27-MAR-2003
Description




FULL PRODUCT VERSION :
c:\java\1.4.1\02\jre\lib>java -version
java version "1.4.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)

FULL OS VERSION :
Microsoft Windows 2000 [Version 5.00.2195]

A DESCRIPTION OF THE PROBLEM :
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6D337A13
Function=ZIP_GetNextEntry+0xE
Library=C:\java\1.4.1\02\jre\bin\zip.dll

Current Java thread:
	at java.util.zip.ZipFile.getNextEntry(Native Method)
	at java.util.zip.ZipFile.access$400(ZipFile.java:26)
	at java.util.zip.ZipFile$2.nextElement(ZipFile.java:313)
	- locked <02A51A60> (a java.util.zip.ZipFile)
	at exploits.PrivateAccess.<init>(PrivateAccess.java:19)
	at exploits.PrivateAccess.main(PrivateAccess.java:30)

Dynamic libraries:
0x00400000 - 0x00407000 	C:\java\1.4.1\02\bin\javaw.exe
0x77880000 - 0x77901000 	C:\WINNT\System32\ntdll.dll
0x77DA0000 - 0x77DFD000 	C:\WINNT\system32\ADVAPI32.dll
0x77E70000 - 0x77F33000 	C:\WINNT\system32\KERNEL32.DLL
0x77D20000 - 0x77D91000 	C:\WINNT\system32\RPCRT4.DLL
0x77E00000 - 0x77E65000 	C:\WINNT\system32\USER32.dll
0x77F40000 - 0x77F7C000 	C:\WINNT\system32\GDI32.DLL
0x78000000 - 0x78046000 	C:\WINNT\system32\MSVCRT.dll
0x6D340000 - 0x6D46A000 	C:\java\1.4.1\02\jre\bin\client\jvm.dll
0x77540000 - 0x77571000 	C:\WINNT\System32\WINMM.dll
0x6D1E0000 - 0x6D1E7000 	C:\java\1.4.1\02\jre\bin\hpi.dll
0x6D310000 - 0x6D31E000 	C:\java\1.4.1\02\jre\bin\verify.dll
0x6D220000 - 0x6D239000 	C:\java\1.4.1\02\jre\bin\java.dll
0x6D330000 - 0x6D33D000 	C:\java\1.4.1\02\jre\bin\zip.dll
0x77910000 - 0x77933000 	C:\WINNT\system32\imagehlp.dll
0x72970000 - 0x7299D000 	C:\WINNT\system32\DBGHELP.dll
0x68F30000 - 0x68F3B000 	C:\WINNT\System32\PSAPI.DLL

Local Time = Fri Mar 21 22:37:17 2003
Elapsed Time = 6
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.1_02-b06 mixed mode)
#


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
package exploits;

import java.lang.reflect.*;
import java.awt.Font;
import java.util.zip.*;
public class PrivateAccess {


  public PrivateAccess() {
    try {
      ZipFile zf = new ZipFile("logs.zip");

      Field fi = zf.getClass().getDeclaredField("jzfile");
      fi.setAccessible(true);
      fi.setLong(zf, Long.MAX_VALUE);

      java.util.Enumeration e = zf.entries();
      while (e.hasMoreElements()) {
        ZipEntry ze = (ZipEntry) e.nextElement();
      }
    }
    catch (Exception e) {
      e.printStackTrace();
    }
    }



  public static void main(String[] args) {
    PrivateAccess privateAccess1 = new PrivateAccess();
  }

}

EXPECTED VERSUS ACTUAL BEHAVIOR :
IllegalArgumentException
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6D337A13
Function=ZIP_GetNextEntry+0xE
Library=C:\java\1.4.1\02\jre\bin\zip.dll

Current Java thread:
	at java.util.zip.ZipFile.getNextEntry(Native Method)
	at java.util.zip.ZipFile.access$400(ZipFile.java:26)
	at java.util.zip.ZipFile$2.nextElement(ZipFile.java:313)
	- locked <02A51A60> (a java.util.zip.ZipFile)
	at exploits.PrivateAccess.<init>(PrivateAccess.java:19)
	at exploits.PrivateAccess.main(PrivateAccess.java:30)

Dynamic libraries:
0x00400000 - 0x00407000 	C:\java\1.4.1\02\bin\javaw.exe
0x77880000 - 0x77901000 	C:\WINNT\System32\ntdll.dll
0x77DA0000 - 0x77DFD000 	C:\WINNT\system32\ADVAPI32.dll
0x77E70000 - 0x77F33000 	C:\WINNT\system32\KERNEL32.DLL
0x77D20000 - 0x77D91000 	C:\WINNT\system32\RPCRT4.DLL
0x77E00000 - 0x77E65000 	C:\WINNT\system32\USER32.dll
0x77F40000 - 0x77F7C000 	C:\WINNT\system32\GDI32.DLL
0x78000000 - 0x78046000 	C:\WINNT\system32\MSVCRT.dll
0x6D340000 - 0x6D46A000 	C:\java\1.4.1\02\jre\bin\client\jvm.dll
0x77540000 - 0x77571000 	C:\WINNT\System32\WINMM.dll
0x6D1E0000 - 0x6D1E7000 	C:\java\1.4.1\02\jre\bin\hpi.dll
0x6D310000 - 0x6D31E000 	C:\java\1.4.1\02\jre\bin\verify.dll
0x6D220000 - 0x6D239000 	C:\java\1.4.1\02\jre\bin\java.dll
0x6D330000 - 0x6D33D000 	C:\java\1.4.1\02\jre\bin\zip.dll
0x77910000 - 0x77933000 	C:\WINNT\system32\imagehlp.dll
0x72970000 - 0x7299D000 	C:\WINNT\system32\DBGHELP.dll
0x68F30000 - 0x68F3B000 	C:\WINNT\System32\PSAPI.DLL

Local Time = Fri Mar 21 22:37:17 2003
Elapsed Time = 6
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.1_02-b06 mixed mode)
#


ERROR MESSAGES/STACK TRACES THAT OCCUR :
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6D337A13
Function=ZIP_GetNextEntry+0xE
Library=C:\java\1.4.1\02\jre\bin\zip.dll

Current Java thread:
	at java.util.zip.ZipFile.getNextEntry(Native Method)
	at java.util.zip.ZipFile.access$400(ZipFile.java:26)
	at java.util.zip.ZipFile$2.nextElement(ZipFile.java:313)
	- locked <02A51A60> (a java.util.zip.ZipFile)
	at exploits.PrivateAccess.<init>(PrivateAccess.java:19)
	at exploits.PrivateAccess.main(PrivateAccess.java:30)

Dynamic libraries:
0x00400000 - 0x00407000 	C:\java\1.4.1\02\bin\javaw.exe
0x77880000 - 0x77901000 	C:\WINNT\System32\ntdll.dll
0x77DA0000 - 0x77DFD000 	C:\WINNT\system32\ADVAPI32.dll
0x77E70000 - 0x77F33000 	C:\WINNT\system32\KERNEL32.DLL
0x77D20000 - 0x77D91000 	C:\WINNT\system32\RPCRT4.DLL
0x77E00000 - 0x77E65000 	C:\WINNT\system32\USER32.dll
0x77F40000 - 0x77F7C000 	C:\WINNT\system32\GDI32.DLL
0x78000000 - 0x78046000 	C:\WINNT\system32\MSVCRT.dll
0x6D340000 - 0x6D46A000 	C:\java\1.4.1\02\jre\bin\client\jvm.dll
0x77540000 - 0x77571000 	C:\WINNT\System32\WINMM.dll
0x6D1E0000 - 0x6D1E7000 	C:\java\1.4.1\02\jre\bin\hpi.dll
0x6D310000 - 0x6D31E000 	C:\java\1.4.1\02\jre\bin\verify.dll
0x6D220000 - 0x6D239000 	C:\java\1.4.1\02\jre\bin\java.dll
0x6D330000 - 0x6D33D000 	C:\java\1.4.1\02\jre\bin\zip.dll
0x77910000 - 0x77933000 	C:\WINNT\system32\imagehlp.dll
0x72970000 - 0x7299D000 	C:\WINNT\system32\DBGHELP.dll
0x68F30000 - 0x68F3B000 	C:\WINNT\System32\PSAPI.DLL

Local Time = Fri Mar 21 22:37:17 2003
Elapsed Time = 6
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.1_02-b06 mixed mode)
#


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6D337A13
Function=ZIP_GetNextEntry+0xE
Library=C:\java\1.4.1\02\jre\bin\zip.dll

Current Java thread:
	at java.util.zip.ZipFile.getNextEntry(Native Method)
	at java.util.zip.ZipFile.access$400(ZipFile.java:26)
	at java.util.zip.ZipFile$2.nextElement(ZipFile.java:313)
	- locked <02A51A60> (a java.util.zip.ZipFile)
	at exploits.PrivateAccess.<init>(PrivateAccess.java:19)
	at exploits.PrivateAccess.main(PrivateAccess.java:30)

Dynamic libraries:
0x00400000 - 0x00407000 	C:\java\1.4.1\02\bin\javaw.exe
0x77880000 - 0x77901000 	C:\WINNT\System32\ntdll.dll
0x77DA0000 - 0x77DFD000 	C:\WINNT\system32\ADVAPI32.dll
0x77E70000 - 0x77F33000 	C:\WINNT\system32\KERNEL32.DLL
0x77D20000 - 0x77D91000 	C:\WINNT\system32\RPCRT4.DLL
0x77E00000 - 0x77E65000 	C:\WINNT\system32\USER32.dll
0x77F40000 - 0x77F7C000 	C:\WINNT\system32\GDI32.DLL
0x78000000 - 0x78046000 	C:\WINNT\system32\MSVCRT.dll
0x6D340000 - 0x6D46A000 	C:\java\1.4.1\02\jre\bin\client\jvm.dll
0x77540000 - 0x77571000 	C:\WINNT\System32\WINMM.dll
0x6D1E0000 - 0x6D1E7000 	C:\java\1.4.1\02\jre\bin\hpi.dll
0x6D310000 - 0x6D31E000 	C:\java\1.4.1\02\jre\bin\verify.dll
0x6D220000 - 0x6D239000 	C:\java\1.4.1\02\jre\bin\java.dll
0x6D330000 - 0x6D33D000 	C:\java\1.4.1\02\jre\bin\zip.dll
0x77910000 - 0x77933000 	C:\WINNT\system32\imagehlp.dll
0x72970000 - 0x7299D000 	C:\WINNT\system32\DBGHELP.dll
0x68F30000 - 0x68F3B000 	C:\WINNT\System32\PSAPI.DLL

Local Time = Fri Mar 21 22:37:17 2003
Elapsed Time = 6
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.1_02-b06 mixed mode)
#

---------- END SOURCE ----------
(Review ID: 182943) 
======================================================================
Work Around
N/A
Evaluation
Not a bug.  You can do all sorts of nasty things if you use reflection to work
around language protections and go around setting private implementation fields
to bogus values.

--  xxxxx@xxxxx  2003/3/27
Comments
  
  Include a link with my name & email   

Submitted On 10-JUN-2003
sgbarlow1
THIS IS A BUG. I get exactly the same error when running 
javac (1.4.1_03) from ant (1.5.3) on XP professional. If
this bug is due to doing stupid (nasty) things with reflection,
then please dont do them in the javac code. Maybe the
com.sun.tools.javac.v8.code.ClassReader.openArchive
method needs a fix applying. Please see stack trace
below...

An unexpected exception has been detected in native code
outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at
PC=0x6D33797D
Function=ZIP_Open+0x369
Library=C:\j2sdk1.4.1_03\jre\bin\zip.dll

Current Java thread:
	at java.util.zip.ZipFile.getNextEntry(Native Method)
	at java.util.zip.ZipFile.access$400(ZipFile.java:26)
	at java.util.zip.ZipFile$2.nextElement(ZipFile.java:313)
	- locked <02AA0788> (a java.util.zip.ZipFile)
	at
com.sun.tools.javac.v8.code.ClassReader.openArchive(ClassReader.java:972)
	at
com.sun.tools.javac.v8.code.ClassReader.list(ClassReader.java:1199)
	at
com.sun.tools.javac.v8.code.ClassReader.listAll(ClassReader.java:1320)
	at
com.sun.tools.javac.v8.code.ClassReader.fillIn(ClassReader.java:1342)
	at
com.sun.tools.javac.v8.code.ClassReader.complete(ClassReader.java:1049)
	at com.sun.tools.javac.v8.code.Symbol.complete(Symbol.java:332)
	at
com.sun.tools.javac.v8.comp.Enter.visitTopLevel(Enter.java:467)
	at
com.sun.tools.javac.v8.tree.Tree$TopLevel.accept(Tree.java:390)
	at com.sun.tools.javac.v8.comp.Enter.classEnter(Enter.java:442)
	at com.sun.tools.javac.v8.comp.Enter.classEnter(Enter.java:456)
	at com.sun.tools.javac.v8.comp.Enter.complete(Enter.java:588)
	at com.sun.tools.javac.v8.comp.Enter.main(Enter.java:574)
	at
com.sun.tools.javac.v8.JavaCompiler.compile(JavaCompiler.java:334)
	at com.sun.tools.javac.v8.Main.compile(Main.java:520)
	at com.sun.tools.javac.Main.compile(Main.java:36)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at
org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:100)
	at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:842)
	at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:682)
	at org.apache.tools.ant.Task.perform(Task.java:341)

And can you PLEASE fix the formatting of text on the bug
pages. I cannot read the evaluation above in Mozilla or IE
as the text goes off the right side of the page. Looks like
dodgy use of the PRE tag.

And I could not include a full stack trace due to the text
limit.


Submitted On 11-JUN-2003
schonef
still seems to be a bug to me 


Submitted On 03-SEP-2003
artur_b
I ALSO THING THIS IS A BUG

An unexpected exception has been detected in native code
outside the VM.
Unexpected Signal : 11 occurred at PC=0xFF032D9C
Function=[Unknown. Nearest: ZIP_Lock+0x48]
Library=/user1/bea/jdk141_02/jre/lib/sparc/libzip.so

Current Java thread:
	at java.util.zip.ZipFile.getNextEntry(Native Method)
	at java.util.zip.ZipFile.access$400(ZipFile.java:26)
	at java.util.zip.ZipFile$2.nextElement(ZipFile.java:313)
	- locked <ec029200> (a java.util.zip.ZipFile)
	at sun.tools.java.ClassPath.getFiles(ClassPath.java:168)
	at sun.tools.java.Package.exists(Package.java:91)
	at sun.tools.java.Imports.resolve(Imports.java:143)
	- locked <ec028760> (a sun.tools.java.Imports)
	at
sun.tools.javac.SourceClass.basicCheck(SourceClass.java:1072)
	at
sun.tools.java.ClassDeclaration.getClassDefinition(ClassDeclaration.java:130)
	at sun.tools.javac.Main.compile(Main.java:501)
	- locked <ec028908> (a sun.tools.javac.Main)

Dynamic libraries:
0x10000 	javacommon/database/core.ins
0xff350000 	/usr/lib/libthread.so.1
0xff390000 	/usr/lib/libdl.so.1
0xff200000 	/usr/lib/libc.so.1
0xff330000 	/usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1
0xfe000000 	/user1/bea/jdk141_02/jre/lib/sparc/client/libjvm.so
0xff2e0000 	/usr/lib/libCrun.so.1
0xff1e0000 	/usr/lib/libsocket.so.1
0xff100000 	/usr/lib/libnsl.so.1
0xff0d0000 	/usr/lib/libm.so.1
0xff310000 	/usr/lib/libw.so.1
0xff0b0000 	/usr/lib/libmp.so.2
0xff080000 
/user1/bea/jdk141_02/jre/lib/sparc/native_threads/libhpi.so
0xff050000 	/user1/bea/jdk141_02/jre/lib/sparc/libverify.so
0xfe7c0000 	/user1/bea/jdk141_02/jre/lib/sparc/libjava.so
0xff030000 	/user1/bea/jdk141_02/jre/lib/sparc/libzip.so
0xfa100000 	/usr/lib/locale/en_US.UTF-8/en_US.UTF-8.so.2
0xfe4e0000 	/usr/lib/locale/en_US.UTF-8/methods_en_US.UTF-8.so.2
0xfc7d0000 	/user1/bea/jdk141_02/jre/lib/sparc/libnet.so
0xfc450000 	/user1/bea/jdk141_02/jre/lib/sparc/libnio.so
0xfc430000 	/usr/lib/librt.so.1
0xfa3e0000 	/usr/lib/libaio.so.1
0xfa2e0000 	/user1/bea/jdk141_02/jre/lib/sparc/libioser12.so
0xe1e90000 
/user1/bea/weblogic81/server/lib/solaris/libstackdump.so
0xe1cc0000 	/user1/bea/weblogic81/server/lib/solaris/libmuxer.so
0xe1ca0000 	/usr/ucblib/libucb.so.1
0xe1bb0000 	/usr/lib/libresolv.so.2
0xe1ac0000 	/usr/lib/libelf.so.1
0xe1b90000 	/user1/bea/jdk141_02/jre/lib/sparc/librmi.so

Local Time = Fri Aug 29 13:27:11 2003
Elapsed Time = 1979
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.1_02-ea-b01 mixed
mode)
#


Submitted On 04-SEP-2003
mvlopez
And what a balls are?


Submitted On 12-NOV-2003
lynchwu2002
Indeed this should be regarded as a bug. Could someone 
reopen and fix it? And can anyone point out any workaround?


Submitted On 16-JAN-2004
eeaston
Reopen this PLEASE Sun!

While spurious, it is still very reproducible in the field.  
This problem seems to be something entirely out of 
the hands of developers who use Java and something 
the the JVM vendor has to fix.


Submitted On 12-APR-2004
bgw2
Just hit this crash myself.  On Solaris 5.8, running 
JBoss 3.0.7, JRE 1.4.2-b28:

An unexpected exception has been detected in native 
code outside the VM.
Unexpected Signal : 10 occurred at PC=0xFF022DA0
Function=[Unknown. Nearest: ZIP_Lock+0x4C]
Library=/export/home/ems/jre/lib/sparc/libzip.so

Current Java thread:
        at java.util.zip.ZipFile.getNextEntry(Native Method)
        at java.util.zip.ZipFile.access$400(Unknown 
Source)
        at java.util.zip.ZipFile$2.nextElement(Unknown 
Source)
        - locked <0xc3fbb1b8> (a java.util.jar.JarFile)
        at java.util.jar.JarFile$1.nextElement(Unknown 
Source)
        at 
org.jboss.deployment.SubDeployerSupport.addDeploy
ableJar(SubDeployerSupport.java:288)
        at 
org.jboss.deployment.SubDeployerSupport.processNe
stedDeployments(SubDeployerSupport.java:201)
        at org.jboss.ejb.EJBDeployer.init
(EJBDeployer.java:303)

Doesn't appear that the code is doing anything 
unusual, it's just
trying to read a jar file to deploy an EJB.  Seems to
me the JVM should print some intelligible message
instead of just crashing !


Submitted On 15-SEP-2005
I had it myself [SunOS 5.8 jvm 1.4.2_08 ].
It is actually bug in libzip. Has nothing to do with reflection.
What happend I think is application has run out memory
(machine memory not JVM max size) and looks like method of libzip
does not check return value of malloc and receive signal 11.
I expect wrapping method to catch this situation and java throw OutOfMemoryExeption instead of crash.



PLEASE NOTE: JDK6 is formerly known as Project Mustang