You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#!/usr/bin/env scalafor (i <-Range(1, 100000)) {
vall=Array[Byte](-1, -1, -1, -1).foldLeft(0L) { case(l, b) =>
b &0xFF
}
if (l !=255) {
println(s"FAIL: got $l after $i iterations")
sys.exit(1)
}
}
println("PASS")
OS X + Sun 1.8.0_25 #1 - incorrect return value or crash
$ sw_vers
ProductName:MacOSXProductVersion:10.11.4BuildVersion:15E65
$ uname -a
Darwin freya.local 15.4.0DarwinKernelVersion15.4.0:FriFeb2622:08:05PST2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64
$ java -version
java version "1.8.0_25"Java(TM) SERuntimeEnvironment (build 1.8.0_25-b17)
JavaHotSpot(TM) 64-BitServerVM (build 25.25-b02, mixed mode)
$ ./break-the-scala.scala
FAIL: got -1 after 4691 iterations
$ ./break-the-scala.scala
FAIL: got -1 after 3861 iterations
$ ./break-the-scala.scala
##A fatal error has been detected by the JavaRuntimeEnvironment:##SIGSEGV (0xb) at pc=0x000000010f3455af, pid=32384, tid=5891##JREversion: Java(TM) SERuntimeEnvironment (8.0_25-b17) (build 1.8.0_25-b17)
#JavaVM:JavaHotSpot(TM) 64-BitServerVM (25.25-b02 mixed mode bsd-amd64 compressed oops)
#Problematicframe:
#J505C2Main$$anon$1$$anonfun$1$$anonfun$2.apply(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; (16 bytes) @0x000000010f3455af [0x000000010f345520+0x8f]
##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/jaka/Development/hs_err_pid32384.log
Compiled method (c2) 6535054Main$$anon$1$$anonfun$1$$anonfun$2::apply (16 bytes)
total in heap [0x000000010f3453d0,0x000000010f345828] =1112
relocation [0x000000010f3454f8,0x000000010f345520] =40
main code [0x000000010f345520,0x000000010f345640] =288
stub code [0x000000010f345640,0x000000010f345658] =24
oops [0x000000010f345658,0x000000010f345670] =24
metadata [0x000000010f345670,0x000000010f3456b0] =64
scopes data [0x000000010f3456b0,0x000000010f345798] =232
scopes pcs [0x000000010f345798,0x000000010f345808] =112
dependencies [0x000000010f345808,0x000000010f345810] =8
nul chk table [0x000000010f345810,0x000000010f345828] =24##If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
#/Users/jaka/opt/scala/bin/scala: line 21:32384Aborttrap: 6"$@"
$ ./break-the-scala.scala
FAIL: got -1 after 3303 iterations
Linux + OpenJDK 1.7.0_95 - passes
$ cat /etc/debian_version
8.4
$ uname -a
Linux vm-debian 3.16.0-4-amd64 #1SMPDebian3.16.7-ckt25-2 (2016-04-08) x86_64 GNU/Linux
$ java -version
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
java version "1.7.0_95"OpenJDKRuntimeEnvironment (IcedTea2.6.4) (7u95-2.6.4-1~deb8u1)
OpenJDK64-BitServerVM (build 24.95-b01, mixed mode)
$ ./break-the-scala.scala
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=truePASS
$ ./break-the-scala.scala
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=truePASS
$ ./break-the-scala.scala
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=truePASS
Linux + OpenJDK 1.8.0_102 - passes
$ cat /etc/debian_version
8.5
$ uname -a
Linux debianapejcic 3.16.0-4-amd64 #1SMPDebian3.16.7-ckt20-1+deb8u3 (2016-01-17) x86_64 GNU/Linux
$ java -version
openjdk version "1.8.0_102"OpenJDKRuntimeEnvironment (build 1.8.0_102-8u102-b14.1-1~bpo8+1-b14)
OpenJDK64-BitServerVM (build 25.102-b14, mixed mode)
$ ./break-the-scala.scala
PASS
Linux + OpenJDK 1.7.0_111 - always crashes
// same machine as above, just switched JVM
$ java -version
java version "1.7.0_111"OpenJDKRuntimeEnvironment (IcedTea2.6.7) (7u111-2.6.7-1~deb8u1)
OpenJDK64-BitServerVM (build 24.111-b01, mixed mode)
$ ./break-the-scala.scala
PASS
$ ./break-the-scala.scala
##A fatal error has been detected by the JavaRuntimeEnvironment:##SIGSEGV (0xb) at pc=0x00007f97b1070347, pid=24295, tid=140289702053632##JREversion: OpenJDKRuntimeEnvironment (7.0_111-b01) (build 1.7.0_111-b01)
#JavaVM:OpenJDK64-BitServerVM (24.111-b01 mixed mode linux-amd64 compressed oops)
#Derivative:IcedTea2.6.7#Distribution:DebianGNU/Linux8.5 (jessie), package 7u111-2.6.7-1~deb8u1#Problematicframe:
#J47C2 scala.collection.IndexedSeqOptimized$class.foldl(Lscala/collection/IndexedSeqOptimized;IILjava/lang/Object;Lscala/Function2;)Ljava/lang/Object; (34 bytes) @0x00007f97b1070347 [0x00007f97b10702c0+0x87]
##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:
#/home/aleksanderpejcic/hs_err_pid24295.log
##If you would like to submit a bug report, please include
# instructions on how to reproduce the bug and visit:
# http://icedtea.classpath.org/bugzilla
#/usr/bin/scala: line 21:24295Aborted"$@"
The text was updated successfully, but these errors were encountered:
Arjan Topolovec (arjan) said:
Since this happens so randomly it was a prime candidate for some JIT related JVM bug.
I ran the code using -XX:+PrintCompilation and there is a clear pattern:
Main$$anonfun$main$1$$anonfun$1::apply v4 is compiled
Main$$anonfun$main$1$$anonfun$1::apply v3 is made not entrant
And at the point of v3 being made not entrant it always crashes the JVM or produces an incorrect result.
Not sure if this is JVM or Scala compiler issue:
OS X + Sun 1.8.0_25 #1 - incorrect return value or crash
Linux + OpenJDK 1.7.0_95 - passes
Linux + OpenJDK 1.8.0_102 - passes
Linux + OpenJDK 1.7.0_111 - always crashes
The text was updated successfully, but these errors were encountered: