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

"Java heap space" error in Fortran calltrace without any fortran code to analyze #74

Open
bgoglin opened this issue Jan 4, 2021 · 0 comments
Labels

Comments

@bgoglin
Copy link

bgoglin commented Jan 4, 2021

Hello

My sonar-scanner analysis fails with "Java heap space" with F90 or F77 in the calltrace while there's no fortran at all in my code.

Our IT recently upgraded to sonarqube 7.9.5, and I had to upgrade my sonar-scanner from 3.2.0.1227 to 4.5.0.2216 to get it to work (Java was too old in sonar-scanner 3.2). First I got the following backtrace (full log at the end of https://ci.inria.fr/hwloc/job/extended/job/master/285/execution/node/418/log/)

12:35:44.178 ERROR: Error during SonarScanner execution
java.lang.OutOfMemoryError: Java heap space
	at fr.cnes.icode.fortran90.rules.F90DATAConstantFloat.zzUnpackCMap(F90DATAConstantFloat.java:364)
	at fr.cnes.icode.fortran90.rules.F90DATAConstantFloat.<clinit>(F90DATAConstantFloat.java:77)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Unknown Source)
	at fr.cnes.icode.data.xml.XmlHandler.classFromString(XmlHandler.java:87)
	at fr.cnes.icode.data.xml.XmlHandler.unmarshal(XmlHandler.java:53)
	at fr.cnes.icode.data.CheckersDefinition.addFromResources(CheckersDefinition.java:108)
	at fr.cnes.icode.fortran90.rules.Fortran90RulesDefinition.define(Fortran90RulesDefinition.java:27)
	at fr.cnes.icode.data.CheckersDefinition.list(CheckersDefinition.java:45)
	at fr.cnes.icode.services.checkers.CheckerService.getCheckers(CheckerService.java:60)
	at fr.cnes.icode.services.checkers.CheckerService.getCheckers(CheckerService.java:166)
	at fr.cnes.icode.Analyzer.stableCheck(Analyzer.java:91)
	at fr.cnes.sonar.plugins.icode.check.ICodeSensor.executeEmbeddedICode(ICodeSensor.java:187)
	at fr.cnes.sonar.plugins.icode.check.ICodeSensor.execute(ICodeSensor.java:109)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)

This is running in a VM with 2GB of RAM so I added -Xmx1800m and got a slightly different failure (full log at the end of https://ci.inria.fr/hwloc/job/extended/job/master/286/execution/node/430/log/)

java.lang.OutOfMemoryError: Java heap space
	at fr.cnes.icode.fortran77.rules.F77ERROpenRead.zzUnpackCMap(F77ERROpenRead.java:431)
	at fr.cnes.icode.fortran77.rules.F77ERROpenRead.<clinit>(F77ERROpenRead.java:76)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Unknown Source)
	at fr.cnes.icode.data.xml.XmlHandler.classFromString(XmlHandler.java:87)
	at fr.cnes.icode.data.xml.XmlHandler.unmarshal(XmlHandler.java:53)
	at fr.cnes.icode.data.CheckersDefinition.addFromResources(CheckersDefinition.java:108)
	at fr.cnes.icode.fortran77.rules.Fortran77RulesDefinition.define(Fortran77RulesDefinition.java:27)
	at fr.cnes.icode.data.CheckersDefinition.list(CheckersDefinition.java:45)
	at fr.cnes.icode.services.checkers.CheckerService.getCheckers(CheckerService.java:60)
	at fr.cnes.icode.services.checkers.CheckerService.getCheckers(CheckerService.java:166)
	at fr.cnes.icode.Analyzer.stableCheck(Analyzer.java:91)
	at fr.cnes.sonar.plugins.icode.check.ICodeSensor.executeEmbeddedICode(ICodeSensor.java:187)
	at fr.cnes.sonar.plugins.icode.check.ICodeSensor.execute(ICodeSensor.java:109)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)

It looks like further increasing -Xmx helps but I can't allocate the entire VM RAM to Java, or other things will start slowing down or failing.

Since we had no clue what was going on with Fortran, we tried disabling icode shell script analysis too (with sonar.icode.shell.file.suffixes=.noshell) and this helps too. But this seems totally unrelated, I shouldn't need to disable shell checks to avoid Fortran issues :/

Is it expected to see those F90/F77 calls in the calltrace even when there is no Fortran code to analyze? Is this some static initialization that occurs before sonar-scanner finds out there's no Fortran code to analyze?
Are these allocations indeed big? It looks like there are XML files containing F77 and F90 rules, are those big, which could explain the issue?

@bgoglin bgoglin added the bug label Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant