StackOverflowError when using SonarHTML plugin

html

(Greg Bishop) #1

SonarQube: 7.4
SonarQube Gradle Plugin: 2.6.1
SonarHTML: 3.0.1

Error:

Execution failed for task ':sonarqube'.
> java.lang.StackOverflowError (no error message)

Steps to reproduce:

  1. Reinstall SonarHTML after upgrading to SonarQube 7.4 from SonarQube 7.3.
  2. Run scan using the gradle SonarQube plugin.

Note:
Everything worked just fine until I reinstalled SonarHTML. I had initially forgot to install it when we upgraded. No StackOverflowErrors prior to reinstalling the plugin. After reinstalling the SonarHTML the crashes started happening. I then uninstalled the SonarHTML plugin and the crashes stopped.

Workaround:
The only thing I’ve been able to do is remove SonarHTML. I have no been able to get it to work otherwise.


(Alexandre Gigleux) #4

Hello,

That would be great to share the project or a reproducer so we can try to reproduce your problem on our side.

What are the Xmx and Xss values allocated to Gradle for this build?

Can you share the full logs of the execution of the “sonarqube” task?

Thanks


(Greg Bishop) #5

Sorry, I am just now seeing you respond to this. I cannot share the project or much with regards to it unfortunately. I would have to scrub an awful lot from the logs, but I’ve added the start of the log and the specific task that is failing with some info removed (basically path/project info).

Xmx = 4096m and Xss is not set anywhere that I can find.

  • ./gradlew --info sonarqube ‘-Dsonar.projectVersion=5.3.33
    ’ -Dsonar.branch.name=devel -Dsonar.branch.target=master -x test
    Initialized native services in: /usr/jenkins/.gradle/native
    To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/4.10/userguide/gradle_daemon.html.
    Starting process ‘Gradle build daemon’. Working directory: /usr/jenkins/.gradle/daemon/4.10 Command: /usr/jenkins/builds/tools/hudson.model.JDK/JDK_8/bin/java -Xmx4096m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp /usr/jenkins/.gradle/wrapper/dists/gradle-4.10-bin/bg6py687nqv2mbe6e1hdtk57h/gradle-4.10/lib/gradle-launcher-4.10.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 4.10
    Successfully started process ‘Gradle build daemon’
    An attempt to start the daemon took 0.703 secs.
    The client will now receive all logging from the daemon (pid: 17979). The daemon log file: /usr/jenkins/.gradle/daemon/4.10/daemon-17979.out.log
    Closing daemon’s stdin at end of input.
    The daemon will no longer process any standard input.
    Daemon will be stopped at the end of the build stopping after processing
    Using 6 worker leases.
    Starting Build
    Settings evaluated using settings file ‘/usr/jenkins/builds/workspace/Jenkins.Test.SonarHTML/settings.gradle’.
    Using local directory build cache for the root build (location = /usr/jenkins/.gradle/caches/build-cache-1, removeUnusedEntriesAfter = 7 days).
    Projects loaded. Root project using build file ‘/usr/jenkins/builds/workspace/Jenkins.Test.SonarHTML/build.gradle’.
    Included projects: [root project ‘Jenkins.Test.SonarHTML’, …’]
    Parallel execution with configuration on demand is an incubating feature.

Task :sonarqube
Java Test Files AST scan (done) | time=576ms
Sensor JavaSquidSensor [java] (done) | time=17546ms
Sensor SurefireSensor [java]
parsing [/usr/jenkins/builds/workspace/Jenkins.Test.SonarHTML/[path]/build/test-results/test]
Sensor SurefireSensor [java] (done) | time=2ms
Sensor JaCoCoSensor [java]
Analysing /usr/jenkins/builds/workspace/Jenkins.Test.SonarHTML/core/build/jacoco/test.exec
No information about coverage per test.
Sensor JaCoCoSensor [java] (done) | time=270ms
Sensor SonarJavaXmlFileSensor [java]
Sensor SonarJavaXmlFileSensor [java] (done) | time=1ms
Sensor HTML [web]

Task :sonarqube FAILED
:sonarqube (Thread[Task worker for ‘:’ Thread 3,5,main]) completed. Took 20 mins 10.696 secs.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:sonarqube’.
    java.lang.StackOverflowError (no error message)

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use ‘–warning-mode all’ to show the individual deprecation warnings.
See https://docs.gradle.org/4.10/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 20m 17s
1 actionable task: 1 executed
script returned exit code 1


(Greg Bishop) #6

Here is the stack trace:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:sonarqube’.

at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:110)

at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77)

at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)

at org.gradle.api.internal.tasks.execution.SkipCachedTaskExecuter.execute(SkipCachedTaskExecuter.java:105)

at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)

at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)

at org.gradle.api.internal.tasks.execution.ResolveBuildCacheKeyExecuter.execute(ResolveBuildCacheKeyExecuter.java:79)

at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)

at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)

at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)

at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)

at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)

at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)

at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)

at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)

at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)

at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51)

at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300)

at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292)

at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174)

at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)

at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)

at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46)

at org.gradle.execution.taskgraph.LocalTaskInfoExecutor.execute(LocalTaskInfoExecutor.java:42)

at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:277)

at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:262)

at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:135)

at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130)

at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.execute(DefaultTaskPlanExecutor.java:200)

at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.executeWithWork(DefaultTaskPlanExecutor.java:191)

at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.run(DefaultTaskPlanExecutor.java:130)

at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)

at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)

at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)

Caused by: java.lang.StackOverflowError


(Nicolas Harraudeau) #9

Hi @gbishop,

Thank you for the logs. The stacktrace contains only gradle api calls, I don’t see any reference to classes in org.sonarqube.gradle.* or in org.sonar.plugins.html.* . Thus it seems strange to me that the issue would come from the HTML analyzer.

Could you try increasing the Xmx and Xss values?

If you still have the issue, could you create an example of code which reproduces it?
Note that since version 3.0.0, SonarHTML changed the list of file extensions analyzed by default. You can see the full list in SonarQube’s configuration Administration->HTML->File suffixes.
Another important change is that PHP and JSP files are always analysed even when they are not listed in File suffixes. Thus one of those files could be the culprit.

Cheers


(Greg Bishop) #10

I’ll try and do that. It certainly could be a red herring, but I know that the problem is fixed when I remove the HTML plugin. I’ll have to wait for a better time to reinstall the HTML plugin as we are about to release, but then I can try your suggestions.