Sonar C scanner -- java.lang.IllegalArgumentException: Start pointer should be before end pointer

Template for a good bug report, formatted with Markdown:

  • SonarQube EE 8.2.0.32929
  • sonar-scanner-4.1.0.1829
  • cpp version: “6.7.0.15300”
  • sonar-scanner-4.1.0.1829
  • MSBuild 15.9.21.664
        at com.sonar.cpp.analyzer.AnalysisExecutor.awaitTermination(AnalysisExecutor.java:81)
        at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:282)
        at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:62)
        at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
        at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:386)
INFO: Total time: 12:37.812s
INFO: Final Memory: 36M/559M
INFO: ------------------------------------------------------------------------
        at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:382)
        at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:351)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
        at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
        at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
        at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
        at com.sun.proxy.$Proxy0.execute(Unknown Source)
        at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:185)
        at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
        at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalArgumentException: Start pointer [line=1160, lineOffset=9] should be before end pointer [line=1160, lineOffset=9]
        at org.sonar.api.utils.Preconditions.checkArgument(Preconditions.java:43)
        at org.sonar.api.batch.fs.internal.DefaultInputFile.newRangeValidPointers(DefaultInputFile.java:348)
        at org.sonar.api.batch.fs.internal.DefaultInputFile.newRange(DefaultInputFile.java:289)
        at com.sonar.cpp.plugin.CFamilySensor.rangeOrLine(CFamilySensor.java:716)
        at com.sonar.cpp.plugin.CFamilySensor.reportIt(CFamilySensor.java:629)
        at com.sonar.cpp.plugin.CFamilySensor.save(CFamilySensor.java:581)
        at com.sonar.cpp.plugin.CFamilySensor.lambda$process$5(CFamilySensor.java:503)
        at com.sonar.cpp.analyzer.AnalysisExecutor.lambda$submit$0(AnalysisExecutor.java:53)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
ERROR:
The SonarQube Scanner did not complete successfully
11:17:04.135  Post-processing failed. Exit code: 1
  • Unfortunately this only happens scanning one specific project (“Reports.exe”)
  • “C:\Bin\sonarScanner\SonarScanner.MSBuild.exe” begin /k:hr-office /v:20.6.0.0 /s:“X:\Projects\hr-office\build\console-tools\SonarQube.Analysis.xml” /d:sonar.branch.name=master /d:sonar.login=**** /d:sonar.cs.dotcover.reportsPaths=“X:\Projects\hr-office.temp\TestResults\AppCoverageReport.html” /d:sonar.cs.vstest.reportsPaths=“X:\Projects\hr-office.temp\TestResults*.trx” /d:sonar.cfamily.build-wrapper-output=“X:\Projects\hr-office.temp.SonarQube” /d:sonar.cfamily.threads=8 /d:sonar.cfamily.cache.path=“T:\sonarcache\hr-office” /d:sonar.cfamily.cache.enabled=true
  • build-wrapper-win-x86-64.exe --out-dir “%BUILD_TEMP_FOLDER%.SonarQube” msbuild %PROJECT_FILE%
  • SonarQube.Analysis.xml only contains the SonarQube server URL

Hi @Tim_Irwin,

in CFamily 6.8 we fixed a bug when cache enabled: CPP-2458. I would invite you to update the analyzer to latest version and try to reanalyze.

We’ve upgraded our server to 8.3.1.34397 and C++ 6.9.0 (build 17076) and are still getting the error.

Hi @Tim_Irwin,

could you please share the sonar-scanner output log? If you prefer to do it privately I can send you a PM.

I’d prefer to do that privately.

Hi @Tim_Irwin,

I sent you a PM.