StackOverflowError in SonarCloud When Analyzing Java 21 Code

Hi Boon Hendrik Kinesso,

thank you for this report, and in particular for this very concise reproducer!

This seems to be another instance of the issue reported here: SonarQube gradle plugin v6 producing StackOverflowError .

We have identified the problem, and have developed measures to prevent the crash.
We are still investigating some aspects of the cyclic type hierarchy that induces the crash, but at least the aforementioned hotfix is under validation now and should be deployed with the next release of the DBD analyzer component.

I will post an update here once this fix has been deployed.


In the meantime, to address your failing analysis task until the fix is deployed, you have two options:

(1) You can disable the crashing analyzer component by setting the sonar.internal.analysis.dbd property to false.

(2) Alternatively, you can employ a more fine grained approach by adding the file that causes the issue to the property sonar.exclusions. It should be the file containing a lambda expression that is similar to the one in your reproducer.

You can find a concrete example of how to define these properties with gradle here.

Please let me know, if you would like help with setting these properties for a different build system (e.g. maven).

1 Like