java.lang.IllegalStateException at com.sonar.cpp.jni.FileSystemOperations.realPath

Must-share information (formatted with Markdown):

  • Versions: SonarQube 8.9.9 Developer Edition,
  • CFamily 6.20.5.49286
  • Scanner CLI 4.7.0.2747,

After the upgrade to 8.9.9 LTS, we get the following error with one of our C++ source files:

**14:13:25** ERROR: Exception in thread pool-3-thread-1
**14:13:25** java.lang.IllegalStateException: F:/Build/workspace/TestFolder/Test_SonarFerdinand/Implementatie/RbcFederate/include/LinkingInfoCollector.h. 
**14:13:25** at com.sonar.cpp.jni.FileSystemOperations.realPath(FileSystemOperations.java:59) 
**14:13:25** at com.sonar.cpp.plugin.CFamilySensor.computeCanonicalPath(CFamilySensor.java:1048) 
**14:13:25** at java.base/java.util.HashMap.computeIfAbsent(Unknown Source) 
**14:13:25** at com.sonar.cpp.plugin.CFamilySensor.save(CFamilySensor.java:762) 
**14:13:25** at com.sonar.cpp.plugin.CFamilySensor.lambda$process$8(CFamilySensor.java:736) 
**14:13:25** at com.sonar.cpp.analyzer.AnalysisExecutor.lambda$submit$0(AnalysisExecutor.java:59) 
**14:13:25** at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) 
**14:13:25** at java.base/java.util.concurrent.FutureTask.run(Unknown Source) 
**14:13:25** at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 
**14:13:25** at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
**14:13:25** at java.base/java.lang.Thread.run(Unknown Source)

From another thread on such a topic (At com.sonar.cpp.jni.FileSystemOperations.realPath(FileSystemOperations.java:51) - #11 by bonjour), I downloaded GetFinalPathName and this is the result:

C:\Temp\GetFinalPathName>GetFinalPathName.exe f:\build\workspace\TestFolder\Test_SonarFerdinand\Implementatie\RbcFederate\include\LinkingInfoCollector.h
\\?\F:\Build\workspace\TestFolder\Test_SonarFerdinand\Implementatie\RbcFederate\include\LinkingInfoCollector.h

Please advise us. We would like to stay on the LTS for now, but cannot find instructions to upgrade CFamily without upgrading to e.g. SonarQube 9.5.

Thanks in advance!

Hi @jpouwels,

Can you share the full log?

You can see there a dot(.) at the end of the file name. Does the filename actually include dot at the end?

if you grep in your codebase for inkingInfoCollector.h. do you get any match? for example in an include directive? if yes, and the actual filename doesn’t end with a dot can you try to remove it and retrigger the analysis?

Thanks,

Thanks for the hint! I wrongly assumed the . after the filename belonged to the logging line.
We indeed had a #include with a . after the filename in a source code file.

Best regards,
Jeroen

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.