ERROR: A stack overflow error occurred while analyzing

Hi.

I want to report an issue we found with the analisis of a project

We were in the 6.7.6 version of sonarqube and did an upgrade to the 7.9.3 version. We knowed that a lot of things were going to change and we prepared for a lot of those changes, but when we did de upgrade of version just one of our projects get this error with the new version of the SonarJava plugin, before we did the upgrade we were in the plugin version sonar-java-5.11.0.17289, after the upgrade the only version of that plugin that we found was the sonar-java-6.3.0.21585 so we upgrade to that version. but since we did that upgrade we started to get this issue in that project:

ERROR: A stack overflow error occurred while analyzing file: ‘war/src/main/java/co/com/winet/project/clap/projectname.java’
java.lang.StackOverflowError: null

we´ve read in a lot of sites that this is a resources issue, so we changed the use of the jvm with this parameters:

-Xms2G -Xmx9G -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError

Afther change that it worked better, but it still showing us the error after a moment of analising the code.

the project didn´t change since before we did the upgrade so we want to know if theres is a way of solve this problem without return to the 6.7.6 version of sonarqube

thanks a lot.

Hello,
Thank you for reporting this error.
Could you please attach the full log of the analysis so we can see in which step the stack overflow occurs ?
Alex.

Sure, this is the full log, Im sorry it is longer, but I get to the limit, so I cut it and put the important parts

INFO: 4311/5737 files analyzed, current file: war/src/main/java/co/com/winet/ipsa/auditoria/hospital/utilidades/InformeHospitalizacionesCerradas.java
INFO: 4312/5737 files analyzed, current file: war/src/main/java/co/com/winet/ipsa/auditoria/hospital/utilidades/InformeHospitalizados.java
INFO: 4312/5737 files analyzed, current file: war/src/main/java/co/com/winet/ipsa/auditoria/hospital/utilidades/InformeHospitalizados.java
INFO: 4312/5737 files analyzed, current file: war/src/main/java/co/com/winet/ipsa/auditoria/hospital/utilidades/InformeHospitalizados.java
INFO: 4347/5737 files analyzed, current file: war/src/main/java/co/com/winet/ipsa/autorizaciones/ValidarCampoGeneracionOrden.java
INFO: 4378/5737 files analyzed, current file: war/src/main/java/co/com/winet/ipsa/clap/CarnetVacunasClap.java
ERROR: A stack overflow error occurred while analyzing file: ‘war/src/main/java/co/com/winet/ipsa/clap/CitaExamenControl.java’
java.lang.StackOverflowError: null
at org.sonar.java.checks.helpers.ExpressionsHelper.isNonSerializable(ExpressionsHelper.java:167)
at org.sonar.java.checks.helpers.ExpressionsHelper.isNotSerializable(ExpressionsHelper.java:162)
at java.base/java.util.stream.MatchOps$1MatchSink.accept(Unknown Source)
at java.base/java.util.stream.Streams$StreamBuilderImpl.tryAdvance(Unknown Source)
at java.base/java.util.stream.Streams$ConcatSpliterator.tryAdvance(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.anyMatch(Unknown Source)
at org.sonar.java.checks.helpers.ExpressionsHelper.lambda$isAssignedToNonSerializable$2(ExpressionsHelper.java:191)
at java.base/java.util.Optional.filter(Unknown Source)
at org.sonar.java.checks.helpers.ExpressionsHelper.isAssignedToNonSerializable(ExpressionsHelper.java:191)
at org.sonar.java.checks.helpers.ExpressionsHelper.isNotSerializable(ExpressionsHelper.java:163)
at java.base/java.util.stream.MatchOps$1MatchSink.accept(Unknown Source)
at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(Unknown Source)
at java.base/java.util.stream.Streams$ConcatSpliterator.tryAdvance(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.anyMatch(Unknown Source)
at org.sonar.java.checks.helpers.ExpressionsHelper.lambda$isAssignedToNonSerializable$2(ExpressionsHelper.java:191)
at java.base/java.util.Optional.filter(Unknown Source)
at org.sonar.java.checks.helpers.ExpressionsHelper.isAssignedToNonSerializable(ExpressionsHelper.java:191)
at org.sonar.java.checks.helpers.ExpressionsHelper.isNotSerializable(ExpressionsHelper.java:163)
at java.base/java.util.stream.MatchOps$1MatchSink.accept(Unknown Source)
at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(Unknown Source)
at java.base/java.util.stream.Streams$ConcatSpliterator.tryAdvance(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.anyMatch(Unknown Source)
at org.sonar.java.checks.helpers.ExpressionsHelper.lambda$isAssignedToNonSerializable$2(ExpressionsHelper.java:191)
at java.base/java.util.Optional.filter(Unknown Source)
at org.sonar.java.checks.helpers.ExpressionsHelper.isAssignedToNonSerializable(ExpressionsHelper.java:191)
at org.sonar.java.checks.helpers.ExpressionsHelper.isNotSerializable(ExpressionsHelper.java:163)
at java.base/java.util.stream.MatchOps$1MatchSink.accept(Unknown Source)
at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(Unknown Source)
at java.base/java.util.stream.Streams$ConcatSpliterator.tryAdvance(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.anyMatch(Unknown Source)
at org.sonar.java.checks.helpers.ExpressionsHelper.lambda$isAssignedToNonSerializable$2(ExpressionsHelper.java:191)
at java.base/java.util.Optional.filter(Unknown Source)
at org.sonar.java.checks.helpers.ExpressionsHelper.isAssignedToNonSerializable(ExpressionsHelper.java:191)
at org.sonar.java.checks.helpers.ExpressionsHelper.isNotSerializable(ExpressionsHelper.java:163)
at java.base/java.util.stream.MatchOps$1MatchSink.accept(Unknown Source)
at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(Unknown Source)
at java.base/java.util.stream.Streams$ConcatSpliterator.tryAdvance(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.anyMatch(Unknown Source)
at org.sonar.java.checks.helpers.ExpressionsHelper.lambda$isAssignedToNonSerializable$2(ExpressionsHelper.java:191)
at java.base/java.util.Optional.filter(Unknown Source)
at org.sonar.java.checks.helpers.ExpressionsHelper.isAssignedToNonSerializable(ExpressionsHelper.java:191)
at org.sonar.java.checks.helpers.ExpressionsHelper.isNotSerializable(ExpressionsHelper.java:163)
at java.base/java.util.stream.MatchOps$1MatchSink.accept(Unknown Source)
at
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 16:48.361s
INFO: Final Memory: 33M/2048M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.StackOverflowError
at org.sonar.java.checks.helpers.ExpressionsHelper.isAssignedToNonSerializable(ExpressionsHelper.java:191)
at org.sonar.java.checks.helpers.ExpressionsHelper.isNotSerializable(ExpressionsHelper.java:163)
at java.base/java.util.stream.MatchOps$1MatchSink.accept(Unknown Source)
at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(Unknown Source)
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
WARN: Unable to locate ‘report-task.txt’ in the workspace. Did the SonarScanner succedeed?
ERROR: SonarQube scanner exited with non-zero code: 1
Started calculate disk usage of build
Finished Calculation of disk usage of build in 0 seconds
Started calculate disk usage of workspace
Finished Calculation of disk usage of workspace in 0 seconds
Notifying upstream projects of job completion
Finished: FAILURE

Hello @dperez
Thank you for attaching the logs.
For the moment you can exclude the CitaExamenControl.java file from the analysis so it can go until completion.
Aside of that, could you please try to analyse this project against the latest version of SonarQube, i.e 8.5 and let em know if this issue persist ?
Alex.