Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JVM args to fix sbt.ForkMain error #438

Merged
merged 1 commit into from
Sep 30, 2023

Conversation

EnricoMi
Copy link
Contributor

@EnricoMi EnricoMi commented Sep 13, 2023

Trying to fix:

[info] Run completed in 51 seconds, 996 milliseconds.
[info] Total number of tests run: 14
[info] Suites: completed 1, aborted 0
[info] Tests: succeeded 14, failed 0, canceled 0, ignored 0, pending 0
[info] All tests passed.
[error] Error during tests:
[error] 	Running java with options -classpath ... sbt.ForkMain 42361 failed with exit code 134
[error] (test:test) sbt.TestsFailedException: Tests unsuccessful

https://github.com/graphframes/graphframes/actions/runs/6175843274/job/16763535111?pr=437#step:5:722

@codecov-commenter
Copy link

codecov-commenter commented Sep 27, 2023

Codecov Report

Merging #438 (fa5dcb7) into master (1573395) will not change coverage.
The diff coverage is n/a.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@           Coverage Diff           @@
##           master     #438   +/-   ##
=======================================
  Coverage   91.30%   91.30%           
=======================================
  Files          18       18           
  Lines         828      828           
  Branches       55       47    -8     
=======================================
  Hits          756      756           
  Misses         72       72           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
JVM_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
# fixing this error after tests success: sbt.ForkMain failed with exit code 134
# https://stackoverflow.com/questions/33287424/strange-exception-in-sbt-test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linked failed has a segfault in the jvm:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f8514592807, pid=2096, tid=2099
#
# JRE version: OpenJDK Runtime Environment (11.0.2+9) (build 11.0.2+9)
# Java VM: OpenJDK 64-Bit Server VM (11.0.2+9, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x792807]  void G1FullGCMarker::mark_and_push<oopDesc*>(oopDesc**) [clone .isra.112]+0x47
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /home/runner/work/graphframes/graphframes/core.2096)
#
# An error report file with more information is saved as:
# /home/runner/work/graphframes/graphframes/hs_err_pid2096.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#
Exception in thread "Thread-6" java.io.EOFException
	at java.base/java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:3062)
	at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1561)
	at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:430)
	at org.scalatest.tools.Framework$ScalaTestRunner$Skeleton$1$React.react(Framework.scala:822)
	at org.scalatest.tools.Framework$ScalaTestRunner$Skeleton$1.run(Framework.scala:811)
	at java.base/java.lang.Thread.run(Thread.java:834)

so to me it looks very different from the failure in the stackoverflow thread.

Any good arguments why these changes would solve the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say the error in the CI

Exception in thread "Thread-6" java.io.EOFException
at java.base/java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:3062)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1561)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:430)
at org.scalatest.tools.Framework$ScalaTestRunner$Skeleton$1$React.react(Framework.scala:822)
at org.scalatest.tools.Framework$ScalaTestRunner$Skeleton$1.run(Framework.scala:811)
at java.base/java.lang.Thread.run(Thread.java:834)
...
sbt.ForkMain 42361 failed with exit code 134

and the error in Stackoverflow:

Exception in thread "Thread-159" java.io.EOFException
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2601)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1319)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
at sbt.React.react(ForkTests.scala:114)
at sbt.ForkTests$$anonfun$mainTestTask$1$Acceptor$2$.run(ForkTests.scala:74)
at java.lang.Thread.run(Thread.java:745)

sbt.ForkMain 59974 failed with exit code 134

look quite similar.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but the stackoverflow post claims that it is related the classpath being too long:

Almost certainly this is related to the Java classpath being too long when invoking sbt.ForkMain in certain linux distros. To avoid this I added

That seems like something one would be a reproducible errror? And it seems very unlikely that would be the root cause of the segmentation fault?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You would think that should be deterministic, but since GC is involved, this might be probabilistic.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the issue that is mentioned in the stackoverflow post "Java classpath being too long when invoking sbt.ForkMain in certain linux distros" is referring to limits on arguments length of a process (https://www.in-ulm.de/~mascheck/various/argmax/) this is not something that has to do with the JVM or something were the GC would be involved?

@WeichenXu123 WeichenXu123 merged commit 8ede065 into graphframes:master Sep 30, 2023
9 checks passed
@EnricoMi EnricoMi deleted the fix-sbt-forkmain-error branch September 30, 2023 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants