--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
BUILD FAILED /home/jenkins/workspace/scala-2.11.x-validate-test@2/build.xml:1478: Test scala.collection.immutable.StreamTest failed
You can run this test from the command line with ant test.junit -Dtest.class scala.collection.immutable.StreamTest
.
quick.lib:[quick.library] Compiling 1 file to /Users/msiegel/Documents/workspace/OpenSource/scala/build/quick/classes/library[quick.library] Error: Could not find or load main class scala.tools.nsc.MainBUILD FAILED/Users/msiegel/Documents/workspace/OpenSource/scala/build.xml:1110: The following error occurred while executing this line:/Users/msiegel/Documents/workspace/OpenSource/scala/build-ant-macros.xml:275: The following error occurred while executing this line:/Users/msiegel/Documents/workspace/OpenSource/scala/build-ant-macros.xml:284: The following error occurred while executing this line:/Users/msiegel/Documents/workspace/OpenSource/scala/build-ant-macros.xml:227: Compilation failed because of an internal compiler error; see the error output for details.
I wonder if it is actually the WeakReference itself which is somehow not getting cleared
ant -Dstarr.version=$scalaVersion \-Dscalac.args.optimise=-optimise \-Dlocker.skip=1 -Dstarr.use.released=1 -Dextra.repo.url=$prRepoUrl \$testExtraArgs ${testTarget-test.core docs.done}
Can you just describe what setup you use to see the inconsistency in GC (or loss of GC)? Both filter and withFilter create new objects. That shouldn't be the critical difference.
The solution is probably the same either way: push the JVM hard to want to clean up memory. It has to care enough to recover the memory for the stream, and it has to care enough to null out the weak reference. It doesn't promise when it'll do either.
I'm happy to take a look myself if I know exactly what I should look at.
Incidentally, if you make a stream with vast memory requirements (e.g. 1M length stream containing a 100k array at each spot), do you get an OOME under those conditions where the tests fail?
--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
Thanks for persevering, Marc!Maybe it's one of the crazy options in our JAVA_OPTS? What happens when you run IntelliJ using them? Can you narrow it down to a single culprit? -XX:+UseParNewGC perhaps?
JAVA_OPTS="-Dfile.encoding=UTF-8 -server -XX:+AggressiveOpts -XX:+UseParNewGC -Xmx2G -Xss1M -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=128M -Dpartest.threads=4"
# Get code from PR
git clone https://github.com/ms-tg/scala.git pr-4284
cd pr-4284
git checkout SI-8990-rebase-on-2.12-squashedgit clean -fdx# Reproduce CI environmentexport JAVA_OPTS="-Dfile.encoding=UTF-8 -server -XX:+AggressiveOpts -XX:+UseParNewGC -Xmx2G -Xss1M -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=128M -Dpartest.threads=4"export ANT_OPTS="-Dfile.encoding=UTF-8 -server -XX:+AggressiveOpts -XX:+UseParNewGC -Xmx2G -Xss1M -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=128M -Dpartest.threads=4"export MAVEN_OPTS="-Dfile.encoding=UTF-8 -server -XX:+AggressiveOpts -XX:+UseParNewGC -Xmx2G -Xss1M -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=128M"export prRepoUrl="http://private-repo.typesafe.com/typesafe/scala-pr-validation-snapshots/"export scalaVersion="2.12.0-f894c55-SNAPSHOT"# Run tests as they are run in CI on 2.12.xsource scripts/jobs/validate/test # eventually fails, or kill it firstant test.junit -Dtest.class scala.collection.immutable.StreamTest # NOTICE that this also fails here# Change some line in StreamTest.scala and re-run ant## change something in the test code
ant test.junit -Dtest.class scala.collection.immutable.StreamTest # NOTICE that this now passes
Ah yes, here are the steps to reproduce:# Get code from PRgit clone https://github.com/ms-tg/scala.git pr-4284cd pr-4284git checkout SI-8990-rebase-on-2.12-squashedgit clean -fdx# Reproduce CI environmentexport JAVA_OPTS="-Dfile.encoding=UTF-8 -server -XX:+AggressiveOpts -XX:+UseParNewGC -Xmx2G -Xss1M -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=128M -Dpartest.threads=4"export ANT_OPTS="-Dfile.encoding=UTF-8 -server -XX:+AggressiveOpts -XX:+UseParNewGC -Xmx2G -Xss1M -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=128M -Dpartest.threads=4"export MAVEN_OPTS="-Dfile.encoding=UTF-8 -server -XX:+AggressiveOpts -XX:+UseParNewGC -Xmx2G -Xss1M -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=128M"export prRepoUrl="http://private-repo.typesafe.com/typesafe/scala-pr-validation-snapshots/"export scalaVersion="2.12.0-f894c55-SNAPSHOT"# Run tests as they are run in CI on 2.12.xsource scripts/jobs/validate/test # eventually fails, or kill it firstant test.junit -Dtest.class scala.collection.immutable.StreamTest # NOTICE that this also fails here# Change some line in StreamTest.scala and re-run ant## change something in the test codeant test.junit -Dtest.class scala.collection.immutable.StreamTest # NOTICE that this now passesSo what does this mean? Is this behavior a possible regression the Scala compiler, since I can't actually find any reason that this code should not work, and it works on 2.11.x?
My hunch is that you are witnessing a difference between the regular and optimizing Scala compiler. The optimizer might inline something in StreamTest
that was material to the collectability.
The target test.junit
depends on quick.done
, rather than quick-opt
which will be used by the release and PR validation scripts.
Try:
% touch test/junit/scala/collection/immutable/StreamTest.scala
% ant build-opt # optimized
% echo ':javap -c -private scala.collection.immutable.StreamTest' | qscala -classpath > opt.javap
% touch test/junit/scala/collection/immutable/StreamTest.scala
% ant build # unoptimized
% echo ':javap -c -private scala.collection.immutable.StreamTest' | qscala -classpath > regular.javap
% diff -u {regular,opt}.javap
--
Thank you for your help and being patient with me.I find it frustrating that none of these replies and project links actually write out the `alias qscala=...` line. Is there a reason for that? (/cc Dick Walls)Also of note: libscala.sh is one of many references to qscala and qscalap that show up in Google, but of course no actual definition of it.
Ah, looks like I have them defined locally as:
% type qscala
qscala is a function
qscala ()
{
$(git rev-parse --show-toplevel)/build/quick/bin/scala -nc "$@"
}
% type qscalac
qscalac is a function
qscalac ()
{
$(git rev-parse --show-toplevel)/build/quick/bin/scalac "$@"
}
--