Sonar Cloud crash at scan task azure pipeline, which steps to take

Just a fragment of log attached.
What does it mean : Too high simulation cost and how to solve it…
How can we solve raised memory exception of java engine
Any help appreciated!

INFO: 01:22:22.8970618 Variable type analysis: done
INFO: Analyzing 138308 ucfgs to detect vulnerabilities.
INFO: All rules entrypoints : 7697
INFO: Retained UCFGs : 65637
INFO: Taint analysis starting. Entrypoints: 7697
INFO: Running symbolic analysis for 'CSHARP'
INFO: Too high simulation costs for sink in C:\__w\14\s\GenerateId.cs:139. This sink will not be analyzed any further.
INFO: Too high simulation costs for sink in C:\__w\14\s\DeleteCommand.cs:216. This sink will not be analyzed any further.
INFO: Too high simulation costs for sink in C:\__w\14\s\src\Helper.cs:280. This sink will not be analyzed any further.
..
..
INFO: Time spent writing ucfgs 148ms
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: Total time: 40:27.555s
INFO: Final Memory: 1958M/2500M
INFO: ------------------------------------------------------------------------
##[error]ERROR: Error during SonarScanner execution
##[debug]Processed: ##vso[task.logissue type=error;]ERROR: Error during SonarScanner execution
ERROR: Error during SonarScanner execution
##[error]java.lang.OutOfMemoryError: Java heap space
at java.base/java.lang.invoke.DirectMethodHandle.allocateInstance(DirectMethodHandle.java:520)
at java.base/java.lang.invoke.DirectMethodHandle$Holder.newInvokeSpecial(DirectMethodHandle$Holder)
at java.base/java.lang.invoke.Invokers$Holder.linkToTargetMethod(Invokers$Holder)
at com.sonar.security.F.D.D.Q.B(na:2612)

Hi,

Welcome to the community!

The Too high simulation costs lines are (should be) unrelated to the final error. The docs aren’t explicit about how to allocate more memory to the SonarScanner for .NET (I assume that’s what you’re using?) but under the covers, it calls the vanilla SonarScanner. So can you try setting a higher heap value in the environment, per the docs? Note that you may have to use a higher number than the 512m in the example.

 
Ann

Thanks Ann for your reply!

We were using another environment variable SONAR_RUNNER_OPTS instead of SONAR_SCANNER_OPTS (docs) :smiley:

Quint

1 Like