JDK-8152661 : Crash in memmove when called from libzip
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Affected Version: 8
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: os_x
  • CPU: x86
  • Submitted: 2016-03-22
  • Updated: 2016-04-04
  • Resolved: 2016-04-04
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :


A DESCRIPTION OF THE PROBLEM :
VM crash when running the Scala REPL

THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Did not try

THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Did not try

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See https://gist.github.com/lrytz/b5b611d28094a4efcafe

REPRODUCIBILITY :
This bug can be reproduced always.


stack : 
Stack: [0x000070000011a000,0x000070000061a000],  sp=0x0000700000613a30,  free space=5094k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libsystem_platform.dylib+0x4f49]  _platform_memmove$VARIANT$Haswell+0x29
C  [libzip.dylib+0x302d]  newEntry+0x2c8
C  [libzip.dylib+0x3554]  ZIP_GetEntry2+0xd4
C  [libzip.dylib+0x234f]  Java_java_util_zip_ZipFile_getEntry+0xcf
J 3526  java.util.zip.ZipFile.getEntry(J[BZ)J (0 bytes) @ 0x000000011050640e [0x0000000110506340+0xce]
J 3691 C1 java.util.zip.ZipFile.getInputStream(Ljava/util/zip/ZipEntry;)Ljava/io/InputStream; (304 bytes) @ 0x00000001102e75cc [0x00000001102e7240+0x38c]
j  scala.reflect.io.FileZipArchive$FileEntry$1.input()Ljava/io/InputStream;+8
j  scala.reflect.io.AbstractFile.toByteArray()[B+1
j  scala.tools.nsc.symtab.classfile.AbstractFileReader.<init>(Lscala/reflect/io/AbstractFile;)V+11
j  scala.tools.nsc.symtab.classfile.ClassfileParser.parse(Lscala/reflect/io/AbstractFile;Lscala/reflect/internal/Symbols$Symbol;)V+191
j  scala.tools.nsc.symtab.SymbolLoaders$ClassfileLoader$$anonfun$doComplete$2.apply$mcV$sp()V+18
j  scala.tools.nsc.symtab.SymbolLoaders$ClassfileLoader$$anonfun$doComplete$2.apply()V+1
j  scala.tools.nsc.symtab.SymbolLoaders$ClassfileLoader$$anonfun$doComplete$2.apply()Ljava/lang/Object;+1


Comments
"// At this point, in a separate terminal, run `scalac -d test1.jar B.scala`, i.e., overwrite the .jar file with new content." The test involves overwriting jar files that are in use by the JVM. This type of operation is not supported. There are numerous reports of such cases where bad application code overwrites resources in use. Real fix involves addressing the application code performing such bad operations. This issue has been addressed in JDK 9 via JDK-8145260. Will need to decide if it's suitable for porting to JDK 8u.
04-04-2016

Test Result: ########### OS: OS X version Yosemite Version 10.10.4 Scala: Scala-2.11.8 JDK: 8u60: Fail 8u71: Fail 8u77: Fail ======================================================== Output: ###### BAVAIDYA-Mac:bin dcsuser$ export PATH=/Users/dcsuser/Downloads/MAC_JAVA/jdk1.8.0_77.jdk/Contents/Home/bin:$PATH BAVAIDYA-Mac:bin dcsuser$ java -version java version "1.8.0_77" Java(TM) SE Runtime Environment (build 1.8.0_77-b31) Java HotSpot(TM) 64-Bit Server VM (build 25.77-b31, mixed mode) BAVAIDYA-Mac:bin dcsuser$ ./scalac -d test1.jar /Users/aroy/A.scala BAVAIDYA-Mac:bin dcsuser$ ./scala Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_77). Type in expressions for evaluation. Or try :help. scala> :require test1.jar Added '/Users/aroy/scala-2.11.8/bin/test1.jar' to classpath. BAVAIDYA-Mac:bin dcsuser$ ./scalac -d test1.jar /Users/aroy/B.scala scala> test.Test # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007fff93801fc9, pid=1730, tid=4867 # # JRE version: Java(TM) SE Runtime Environment (8.0_77-b31) (build 1.8.0_77-b31) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.77-b31 mixed mode bsd-amd64 compressed oops) # Problematic frame: # C [libsystem_platform.dylib+0x4fc9] _platform_memmove$VARIANT$Unknown+0x29 # # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again # # An error report file with more information is saved as: # /Users/aroy/scala-2.11.8/bin/hs_err_pid1730.log # # If you would like to submit a bug report, please visit: # http://bugreport.java.com/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # ./scala: line 21: 1730 Abort trap: 6 "$@" BAVAIDYA-Mac:bin dcsuser$
24-03-2016