StackOverflowError when analyzing projects with the same submodule names at different levels

130 views
Skip to first unread message

Marcin Zajączkowski

unread,
Jun 24, 2015, 4:45:06 AM6/24/15
to sona...@googlegroups.com
Hi,

Sonar analysis fails with java.lang.StackOverflowError for projects with the same submodule names at different levels. E.g.

root
 |---- feature1
 |  |
 |  |--- feature1
 |  |--- feature1-spring
 |
 |---- feature2


That situation can be met in projects where given "feature" has the main module and supporting modules. It is rather a configuration smell, so it would be probably enough to check it and display meaningful error message.

A sample stacktrace:

org.sonar.runner.impl.RunnerException: Unable to execute Sonar
    at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:106)
    at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:89)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:82)
    at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:53)
    at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
    at org.sonar.runner.api.Runner.execute(Runner.java:99)
    at org.sonar.runner.Main.executeTask(Main.java:70)
    at org.sonar.runner.Main.execute(Main.java:59)
    at org.sonar.runner.Main.main(Main.java:53)
Caused by: java.lang.StackOverflowError
    at java.lang.StringCoding$StringEncoder.encode(StringCoding.java:304)
    at java.lang.StringCoding.encode(StringCoding.java:344)
    at java.lang.String.getBytes(String.java:906)
    at java.io.UnixFileSystem.getBooleanAttributes0(Native Method)
    at java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:242)
    at java.io.File.isDirectory(File.java:849)
    at org.sonar.batch.scan.ProjectReactorBuilder.setProjectBaseDir(ProjectReactorBuilder.java:296)
    at org.sonar.batch.scan.ProjectReactorBuilder.loadChildProject(ProjectReactorBuilder.java:237)
    at org.sonar.batch.scan.ProjectReactorBuilder.defineChildren(ProjectReactorBuilder.java:222)
    at org.sonar.batch.scan.ProjectReactorBuilder.defineChildren(ProjectReactorBuilder.java:226)
    at org.sonar.batch.scan.ProjectReactorBuilder.defineChildren(ProjectReactorBuilder.java:226)
(...)

Tested with Sonar 5.1.1 and Sonar Runner 2.4 and 2.5-SNAPSHOT from master.

Marcin

Julien HENRY

unread,
Jun 25, 2015, 3:56:52 AM6/25/15
to sona...@googlegroups.com, msz...@wp.pl
Hi Marcin,

Thanks for feedback,

Julien
Reply all
Reply to author
Forward
0 new messages