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

DynComp: a fatal error has been detected by the Java Runtime Environment (ClassNotFoundException) #341

Closed
boyang9602 opened this issue May 19, 2021 · 6 comments

Comments

@boyang9602
Copy link

Hi,

I met another JVM fatal error, different from #340. It only happens to Chart-19. Below is the output

$ java -Xmx43G -cp /home/ubuntu/daikon-5.8.8/daikon.jar:build/:build-tests/:/home/ubuntu/APR_Projects/Chart/19/Chart19f/lib/itext-2.0.2.jar:/home/ubuntu/APR_Projects/Chart/19/Chart19f/lib/itext-2.0.6.jar:/home/ubuntu/APR_Projects/Chart/19/Chart19f/lib/junit.jar:/home/ubuntu/APR_Projects/Chart/19/Chart19f/lib/servlet.jar:/home/ubuntu/launcher/ daikon.DynComp '--ppt-select-pattern=^org\.jfree\.chart\.plot\.CategoryPlot' --output-dir=ft_invariants_files0 TestRunner org.jfree.chart.plot.junit.CategoryPlotTests::testGetRangeAxisIndex org.jfree.chart.plot.junit.CategoryPlotTests::testGetDomainAxisIndex |& tee ft_invariants_files0/dyncomp-output.txt
java.lang.ClassNotFoundException
 - klass: 'java/lang/ClassNotFoundException'
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (exceptions.cpp:460), pid=28779, tid=0x00007f2e6605b700
#  fatal error: ExceptionMark constructor expects no pending exceptions
#
# JRE version: OpenJDK Runtime Environment (8.0_292-b10) (build 1.8.0_292-8u292-b10-0ubuntu1~18.04-b10)
# Java VM: OpenJDK 64-Bit Server VM (25.292-b10 mixed mode linux-amd64 )
# 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/ubuntu/APR_Projects/Chart/19/Chart19f/hs_err_pid28779.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

If I run the tests directly, it works fine,

$ java -Xmx43G -cp /home/ubuntu/daikon-5.8.8/daikon.jar:build/:build-tests/:/home/ubuntu/APR_Projects/Chart/19/Chart19f/lib/itext-2.0.2.jar:/home/ubuntu/APR_Projects/Chart/19/Chart19f/lib/itext-2.0.6.jar:/home/ubuntu/APR_Projects/Chart/19/Chart19f/lib/junit.jar:/home/ubuntu/APR_Projects/Chart/19/Chart19f/lib/servlet.jar:/home/ubuntu/launcher/  TestRun
ner org.jfree.chart.plot.junit.CategoryPlotTests::testGetRangeAxisIndex org.jfree.chart.plot.junit.CategoryPlotTests::testGetDomainAxisIndex
SUCCESS
SUCCESS
ubuntu@repair:~$ java -version
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-8u292-b10-0ubuntu1~18.04-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)

The steps to reproduce the issue:

  1. install defects4j, https://github.com/rjust/defects4j
  2. checkout the Chart-19f using defects4j checkout -p Chart -v 19f -w Chart19f
  3. go to Chart19f and compile the project using defects4j compile
  4. compile the TestRunner
  5. go to Chart19f and run CLASSPATH=$(find "$PWD" -name '*.jar' -type f -printf ':%p\n' | sort -u | tr -d '\n'); java -Xmx43G -cp $DAIKONDIR/daikon.jar:build/:build-tests/$CLASSPATH:<TestRunner path> TestRunner org.jfree.chart.plot.junit.CategoryPlotTests::testGetRangeAxisIndex org.jfree.chart.plot.junit.CategoryPlotTests::testGetDomainAxisIndex
@markro49
Copy link
Contributor

I am unable to reproduce this problem. I followed your steps and all looks ok:
[markro@buffalo Chart19f]$ java -cp /scratch/markro/clones/daikon/daikon.jar:build/:build-tests/:$CLASSPATH:. daikon.DynComp '--ppt-select-pattern=^org.jfree.chart.plot.CategoryPlot' --output-dir=ft_invariants_files0 TestRunner org.jfree.chart.plot.junit.CategoryPlotTests::testGetRangeAxisIndex org.jfree.chart.plot.junit.CategoryPlotTests::testGetDomainAxisIndex
SUCCESS
SUCCESS
[markro@buffalo Chart19f]$ l -rt ft_invariants_files0
total 4148
drwxr-xr-x 14 markro rtech_cs 4096 May 25 12:23 ..
drwxr-xr-x 2 markro rtech_cs 4096 May 25 12:23 .
-rw-r--r-- 1 markro rtech_cs 4237887 May 25 12:27 TestRunner.decls-DynComp
[markro@buffalo Chart19f]$
I am using Daikon #338.

@boyang9602
Copy link
Author

Thank you for your reply. Here is my machine info:

Distributor ID: Ubuntu
Description:    Ubuntu 18.04.2 LTS
Release:        18.04
Codename:       bionic

I can always reproduce it on this machine. I'll try if the problem could be reproduced on other machines and update it here.

@markro49
Copy link
Contributor

I was able to reproduce on Ubuntu 18.04. I haven't tried 20.04. Are you able to try 20.04?

@boyang9602
Copy link
Author

Yes, my 20.04 is a windows subsystem, it is a little bit slow. It is compiling DynComp now, I will update it later.

@boyang9602
Copy link
Author

I can reproduce it on Ubuntu 20.04.

bo@LAPTOP-E1MFF41S:/mnt/c/Users/boyan/projects/APR_Projects/Chart19f$ java -cp $DAIKONDIR/daikon.jar:build/:build-tests/:$CLASSPATH:. daikon.DynComp '--ppt-select-pattern=^org.jfree.chart.plot.CategoryPlot' --output-dir=ft_invariants_files0 TestRunner org.jfree.chart.plot.junit.CategoryPlotTests::testGetRangeAxisIndex org.jfree.chart.plot.junit.CategoryPlotTests::testGetDomainAxisIndex
java.lang.ClassNotFoundException
 - klass: 'java/lang/ClassNotFoundException'
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (exceptions.cpp:460), pid=8591, tid=0x00007fc1e8b6f700
#  fatal error: ExceptionMark constructor expects no pending exceptions
#
# JRE version: OpenJDK Runtime Environment (8.0_292-b10) (build 1.8.0_292-8u292-b10-0ubuntu1~20.04-b10)
# Java VM: OpenJDK 64-Bit Server VM (25.292-b10 mixed mode linux-amd64 compressed oops)
# 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:
# /mnt/c/Users/boyan/projects/APR_Projects/Chart19f/hs_err_pid8591.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#
bo@LAPTOP-E1MFF41S:/mnt/c/Users/boyan/projects/APR_Projects/Chart19f$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:        20.04
Codename:       focal

@markro49
Copy link
Contributor

I have found the problem and it appears to be a bug in the Ubuntu JVM. The root cause is that the build of Chart19f fails to build a valid version of lib/itext-2.0.6.jar:

markro ~/defects4j/Chart19f]$ jar -tf lib/itext-2.0.6.jar
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:225)
at java.util.zip.ZipFile.(ZipFile.java:155)
at java.util.zip.ZipFile.(ZipFile.java:126)
at sun.tools.jar.Main.list(Main.java:1115)
at sun.tools.jar.Main.run(Main.java:293)
at sun.tools.jar.Main.main(Main.java:1288)
markro ~/defects4j/Chart19f]$

If you remove this jar from CLASSPATH all works fine. If you leave the bad jar in the classpath both CentOS and Fedora still work fine and output the message:
CLASSPATH component /home/markro/defects4j/Chart19f/lib/itext-2.0.6.jar: java.util.zip.ZipException: error in opening zip file

Ubuntu core dumps instead => I think its a bug in Ubuntu JVM.

Bottom line: remove itext-2.0.6.jar from classpath and/or run on Fedora instead.

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

No branches or pull requests

2 participants