Caused by: java.lang.IllegalArgumentException: 5425 is not a valid line for pointer. File svcs/plc/PLC/Source/PLCService/Runtime/armv7aLinux/Platforms/Linux/sysdefines.h has 214 line(s)

Template for a good bug report, formatted with Markdown:

  • versions used (SonarQube, Scanner, Plugin, and any relevant extension)
  • error observed (wrap logs/code around triple quote ``` for proper formatting)
  • steps to reproduce
  • potential workaround

P.S.: use the #bug:fault sub-category if you’re hitting a specific crash/error , or the #bug:fp sub-category for rules-related behaviour

SonarQube version 8.9.1
Running code analysis as a part of azure devops build
SonarScanner for C/C++ language

Here are the error logs:

at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
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: 5425 is not a valid line for pointer. File svcs/plc/PLC/Source/PLCService/Runtime/armv7aLinux/Platforms/Linux/sysdefines.h has 214 line(s)
at org.sonar.api.utils.Preconditions.checkArgument(Preconditions.java:43)
at org.sonar.api.batch.fs.internal.DefaultInputFile.checkValid(DefaultInputFile.java:336)
at org.sonar.api.batch.fs.internal.DefaultInputFile.newPointer(DefaultInputFile.java:272)
at org.sonar.api.batch.fs.internal.DefaultInputFile.selectLine(DefaultInputFile.java:295)
at com.sonar.cpp.plugin.CFamilySensor.rangeOrLine(CFamilySensor.java:1032)
at com.sonar.cpp.plugin.CFamilySensor.reportIssueImpl(CFamilySensor.java:953)
at com.sonar.cpp.plugin.CFamilySensor.reportIssueImpl(CFamilySensor.java:936)
at com.sonar.cpp.plugin.CFamilySensor.reportIssue(CFamilySensor.java:924)
… 33 more
17:13:01.355 ERROR:
17:13:01.355 ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
2021-11-10T16:13:01.3668630Z 17:13:01.354 ERROR: Error during SonarScanner execution
2021-11-10T16:13:01.3669555Z java.lang.IllegalStateException: /home/vsts-agent/agent-pasop/_work/1/pasop/svcs/plc/PLC/Source/PLCService/Runtime/armv7aLinux/Platforms/Linux/sysdefines.h 5425:9 5425:15 S1820
2021-11-10T16:13:01.3670171Z at com.sonar.cpp.plugin.CFamilySensor.reportIssue(CFamilySensor.java:926)
2021-11-10T16:13:01.3670622Z at com.sonar.cpp.plugin.CFamilySensor.save(CFamilySensor.java:865)
2021-11-10T16:13:01.3671062Z at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:713)
2021-11-10T16:13:01.3671621Z at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:616)
2021-11-10T16:13:01.3672068Z at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:367)
2021-11-10T16:13:01.3672505Z at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:175)
2021-11-10T16:13:01.3672980Z at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
2021-11-10T16:13:01.3673491Z at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
2021-11-10T16:13:01.3673994Z at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:62)
2021-11-10T16:13:01.3674672Z at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
2021-11-10T16:13:01.3675184Z at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
2021-11-10T16:13:01.3675677Z at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
2021-11-10T16:13:01.3676176Z at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:392)
2021-11-10T16:13:01.3676681Z at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:388)
2021-11-10T16:13:01.3677195Z at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:357)
2021-11-10T16:13:01.3677707Z at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
2021-11-10T16:13:01.3678200Z at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
2021-11-10T16:13:01.3678691Z at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:150)
2021-11-10T16:13:01.3679197Z at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
2021-11-10T16:13:01.3679687Z at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
2021-11-10T16:13:01.3680204Z at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
2021-11-10T16:13:01.3680623Z at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
2021-11-10T16:13:01.3681203Z at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
2021-11-10T16:13:01.3681709Z at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2021-11-10T16:13:01.3682193Z at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
2021-11-10T16:13:01.3682738Z at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2021-11-10T16:13:01.3683225Z at java.base/java.lang.reflect.Method.invoke(Method.java:568)
2021-11-10T16:13:01.3683699Z at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
2021-11-10T16:13:01.3684145Z at jdk.proxy1/jdk.proxy1.$Proxy0.execute(Unknown Source)
2021-11-10T16:13:01.3684569Z at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
2021-11-10T16:13:01.3685062Z at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
2021-11-10T16:13:01.3685497Z at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
2021-11-10T16:13:01.3685898Z at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
2021-11-10T16:13:01.3686291Z at org.sonarsource.scanner.cli.Main.main(Main.java:61)
2021-11-10T16:13:01.3686920Z Caused by: java.lang.IllegalArgumentException: 5425 is not a valid line for pointer. File svcs/plc/PLC/Source/PLCService/Runtime/armv7aLinux/Platforms/Linux/sysdefines.h has 214 line(s)
2021-11-10T16:13:01.3687535Z at org.sonar.api.utils.Preconditions.checkArgument(Preconditions.java:43)
2021-11-10T16:13:01.3688021Z at org.sonar.api.batch.fs.internal.DefaultInputFile.checkValid(DefaultInputFile.java:336)
2021-11-10T16:13:01.3688533Z at org.sonar.api.batch.fs.internal.DefaultInputFile.newPointer(DefaultInputFile.java:272)
2021-11-10T16:13:01.3689050Z at org.sonar.api.batch.fs.internal.DefaultInputFile.selectLine(DefaultInputFile.java:295)
2021-11-10T16:13:01.3689594Z at com.sonar.cpp.plugin.CFamilySensor.rangeOrLine(CFamilySensor.java:1032)
2021-11-10T16:13:01.3690052Z at com.sonar.cpp.plugin.CFamilySensor.reportIssueImpl(CFamilySensor.java:953)
2021-11-10T16:13:01.3690523Z at com.sonar.cpp.plugin.CFamilySensor.reportIssueImpl(CFamilySensor.java:936)
2021-11-10T16:13:01.3690986Z at com.sonar.cpp.plugin.CFamilySensor.reportIssue(CFamilySensor.java:924)
2021-11-10T16:13:01.3691323Z … 33 more
2021-11-10T16:13:01.3691574Z 17:13:01.355 ERROR:
2021-11-10T16:13:01.3692150Z 17:13:01.355 ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
2021-11-10T16:13:01.7420481Z ##[error]The process ‘/home/vsts-agent/agent-pasop/_work/_tasks/SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055/4.24.0/sonar-scanner/bin/sonar-scanner’ failed with exit code 1
2021-11-10T16:13:01.7470481Z ##[section]Finishing: SonarQubeAnalyze

hello @amit.saurabh,

Can you upload the entire scanner logs?

Thanks,

sonarqube_analyze.zip (772.6 KB)
please find the complete log, you need to unzip it after download as it was very big file so i have zipped it.

I have provided the entire log, could you please advise what could be the possible reason for this failure.

Thanks,
Amit

Hi @amit.saurabh,

Thanks for the log.

First, can you update to at least 8.9.3 to make sure that it is not one of the bugs that were already fixed in bug fixes releases?

If you still face the issue after the upgrade can you disable the CFamily cache and let me know if you still face the issue.

Thanks,

Hi @Abbas ,

we have tried disabling the CFamily cache and it solved the problem, but it should not give such error with CFamily catch as well.

However we haven’t updated to 8.9.3 yet as its our main global portal so I need to request to our sonarsupport to update it if this error is because of this older version.

Regards,
Amit

Hi @amit.saurabh,
This was just to identify that the issue related to cache.
The cache probably for corrupted.
Can you enable it again?
Do you reproduce the issue consistently?
Are you modifying the cache concurrently? running multiple scan at the same time with the same cache?
Describing how you are using the cache might help me identify the issue.
Thanks,

@amit.saurabh, any update on this?