Re: Java plugin with stackoverflow error after upgrading to Sonarqube 5.6 and Java plugin 4.4.0.8066

708 views
Skip to first unread message

Tibor Blenessy

unread,
Jan 10, 2017, 8:24:31 AM1/10/17
to bernd...@gmail.com, SonarQube
Hello,

this seems to be a bug in dataflow analysis engine. It will help a lot if you could provide some self-contained example raising the issue. Otherwise it's hard to guess how exactly this can happen.

If you are unable to make it work with unit tests, you can try to connect debugger remotely to the analysis running on the "real" project. That way you will be able to pinpoint specific method where the analysis fails. Let me know if you need help with setup.

Best regards


On Mon, Jan 9, 2017 at 3:49 PM <bernd...@gmail.com> wrote:
I'm running into a stack overflow error during a sonar scanner analysis for a project that worked fine with Sonarqube version 5.1.2 and Java plugin version 3.5. I'm obviously trying to uprade to the latest versions.

I can't disclose the source code that triggers the stack overflow. I will try to run a unit test with that source code in the Java plugin by cloning the project, but I currently fail with build issues. The usual stuff - stacking up one problem on top of the previous one, I hope I don't run into a stack overflow myself ;-) - anyway, that's another story and i will create aseparate message/issue for that.

But maybe somebody out there has seen this one already. Here's the exception stack trace:

INFO: Sensor JavaSquidSensor
INFO: Configured Java source version (sonar.java.source): none
INFO: JavaClasspath initialization
WARN: Bytecode of dependencies was not provided for analysis of source files, you might end up with less precise results. Bytecode can
be provided using sonar.java.libraries property
INFO: JavaClasspath initialization (done) | time=0ms


INFO: JavaTestClasspath initialization
INFO: JavaTestClasspath initialization (done) | time=0ms
INFO: Java Main Files AST scan
INFO: 492 source files to be analyzed
INFO: 105/492 files analyzed, current file: C:\Data\ter\pcit\2017-01-08-18-43\CONCERT\sr-s0x-rt-base\src\main\java\com\swissre\sal\risktransfer\lossmodel\lilm\utils\BasicLossContainerCreator.java
ERROR: A stack overflow error occured while analyzing file:
C:\Data\ter\pcit\2017-01-08-18-43\CONCERT\sr-s0x-rt-base\src\main\java\com\swissre\sal\risktransfer\parser\BreakdownParser.java


Exception in thread "main"
java.lang.StackOverflowError


    at java.util.stream.ReduceOps$3ReducingSink.begin(Unknown Source)

    at java.util.stream.Sink$ChainedReference.begin(Unknown Source)


    at java.util.stream.ReferencePipeline$2$1.begin(Unknown Source)

    at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
    at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
    at java.util.stream.ReferencePipeline.collect(Unknown Source)
    at org.sonar.java.se.checks.FlowComputation.flowFromLearnedConstraints(FlowComputation.java:114)
    at org.sonar.java.se.checks.FlowComputation.run(FlowComputation.java:100)
    at org.sonar.java.se.checks.FlowComputation.run(FlowComputation.java:106)
    at org.sonar.java.se.checks.FlowComputation.run(FlowComputation.java:106)
    at org.sonar.java.se.checks.FlowComputation.run(FlowComputation.java:106)
    at org.sonar.java.se.checks.FlowComputation.run(FlowComputation.java:106)
    at org.sonar.java.se.checks.FlowComputation.run(FlowComputation.java:106)
    at org.sonar.java.se.checks.FlowComputation.run(FlowComputation.java:106)
    at org.sonar.java.se.checks.FlowComputation.run(FlowComputation.java:106)
    at org.sonar.java.se.checks.FlowComputation.run(FlowComputation.java:106)

and so on.

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/6c5420a8-2290-47cf-8089-ab5869aa9324%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Tibor BLENESSY | SonarSource
Software Engineer

Bernd Götz

unread,
Jan 11, 2017, 4:48:22 PM1/11/17
to Tibor Blenessy, SonarQube
Hi Tibor, I finally got the unit tests running on my Mac. I reconfigured the JavaSquidSensorTest to inlude only my single class where I had the error, but in that isolated test, the error did not occur. I'm on master, revision 5ccec4d17b5aecf1d6e5d135a3e4fb40ff301ad5. I would like to try with the revision used for the https://sonarsource.bintray.com/Distribution/sonar-java-plugin/sonar-java-plugin-4.4.0.8066.jar release. How can I find out which revision that release relates to?
Or could I use a later build of the plugin? Is there a continuous build of the plugin somewhere? If not, I will build the plugin myself and use that in my test setup.
Regards,
Bernd

Tibor Blenessy

unread,
Jan 12, 2017, 3:46:15 AM1/12/17
to Bernd Götz, SonarQube
Hello,

releases are tagged with Git, 4.4.0.8066 is 2703cce


We don't make continuous builds publicly available. Please use latest release to report issues.

Best

Bernd Götz

unread,
Jan 13, 2017, 3:27:45 AM1/13/17
to Tibor Blenessy, SonarQube
I ran the test with that revision, no problem with that, either. Maybe I don't know how to test this single class properly!? Is there a guide for that? On the other hand, is it possible that such an error only occurs in the context of the full source code being analyzed? If that's the case, I need to put my full source file set into that unit test. But I first need to fix the issue to get the plugin development setup working in my company's premises. I have one blocker that I can't build the Java plugin, unfortunately. I have an entry about that at https://groups.google.com/forum/#!topic/sonarqube/S9PBfNCNoXU.

Regards,

Tibor Blenessy

unread,
Jan 16, 2017, 12:12:02 PM1/16/17
to Bernd Götz, SonarQube
Hello,

my guess would be that some dependencies are not provided and thus not resolved, this can "hide" the stackoverflow issue. Be sure that your unit test includes all the imports on the classpath, or try to remove the imports not related to the problem (by trial-and-error approach).

Regards



On Fri, Jan 13, 2017 at 9:27 AM Bernd Götz <bernd...@gmail.com> wrote:
I ran the test with that revision, no problem with that, either. Maybe I don't know how to test this single class properly!? Is there a guide for that? On the other hand, is it possible that such an error only occurs in the context of the full source code being analyzed? If that's the case, I need to put my full source file set into that unit test. But I first need to fix the issue to get the plugin development setup working in my company's premises. I have one blocker that I can't build the Java plugin, unfortunately. I have an entry about that at https://groups.google.com/forum/#!topic/sonarqube/S9PBfNCNoXU.

Regards,

Tibor Blenessy

unread,
Jan 31, 2017, 9:47:28 AM1/31/17
to Bernd Götz, SonarQube
Hello Bernd, 

I am coming back to you, because we identified similar issue on one of our test projects and I created a ticket for it https://jira.sonarsource.com/browse/SONARJAVA-2087 . This will be included in the SonarJava 4.5 which will be released soon. Please check the mailing list for RFF announcement and you can test it on your codebase.

Best regards


--
Tibor BLENESSY | SonarSource
SonarJava Developer

Bernd Götz

unread,
Feb 5, 2017, 8:19:13 AM2/5/17
to Tibor Blenessy, SonarQube
Thanks for the update. I'll rerun with 4.5 asap.
Reply all
Reply to author
Forward
0 new messages