Must-share information (formatted with Markdown):
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
- CFamily plugin version: 6.36.0.52033
- SonarQube version: 9.6.1.59531
- Code analysis azdevops task version: 4.30.0
- what are you trying to achieve
- After upgrading to latest release of SonarQube, our scan of C++ projects started failing with IllegalStateException as com.sonar.cpp.jni.FileSystemOperations.realPath on an .h file. (see below for full stack)
- what have you tried so far to achieve this
- ensure we’re on supported versions of everything (java, node, etc.)
- search for similar posts (SonarCloud analysis failing with CFamily plugin version: 6.31.0.44497 - #7 by Abbas_Sabra, At com.sonar.cpp.jni.FileSystemOperations.realPath(FileSystemOperations.java:51))
Our last successful scan was a few days ago when the CFamily plugin version was 6.32.0.44918
It seems in past this was something that needed to be fixed in the CFamily plugin. Here’s an excerpt of the Azure DevOps pipeline code analysis task where the error is reported including the full java stack:
2022-09-02T21:25:44.8528005Z ##[error]21:25:44.851 ERROR: Exception in thread pool-3-thread-1
java.lang.IllegalStateException: C:/agent3/_work/1/s/redacted/path/to/file.h.
2022-09-02T21:25:44.8530274Z 21:25:44.851 ERROR: Exception in thread pool-3-thread-1
2022-09-02T21:25:44.8531196Z java.lang.IllegalStateException: C:/agent3/_work/1/s/redacted/path/to/file.h.
2022-09-02T21:25:44.8535994Z ##[error]at com.sonar.cpp.jni.FileSystemOperations.realPath(FileSystemOperations.java:57)
at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1224)
at com.sonar.cpp.fs.CanonicalPathCache.computeIfAbsent(CanonicalPathCache.java:17)
at com.sonar.cpp.plugin.CFamilySensor.lambda$save$20(CFamilySensor.java:972)
at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
at com.sonar.cpp.plugin.CFamilySensor.save(CFamilySensor.java:972)
2022-09-02T21:25:44.8540465Z at com.sonar.cpp.jni.FileSystemOperations.realPath(FileSystemOperations.java:57)
2022-09-02T21:25:44.8541473Z at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1224)
2022-09-02T21:25:44.8542482Z at com.sonar.cpp.fs.CanonicalPathCache.computeIfAbsent(CanonicalPathCache.java:17)
2022-09-02T21:25:44.8543532Z at com.sonar.cpp.plugin.CFamilySensor.lambda$save$20(CFamilySensor.java:972)
2022-09-02T21:25:44.8544570Z at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
2022-09-02T21:25:44.8545705Z at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
2022-09-02T21:25:44.8546701Z at com.sonar.cpp.plugin.CFamilySensor.save(CFamilySensor.java:972)
2022-09-02T21:25:44.8549043Z ##[error]at com.sonar.cpp.plugin.CFamilySensor.lambda$process$19(CFamilySensor.java:946)
at com.sonar.cpp.analyzer.AnalysisExecutor.lambda$submit$0(AnalysisExecutor.java:59)
2022-09-02T21:25:44.8551159Z at com.sonar.cpp.plugin.CFamilySensor.lambda$process$19(CFamilySensor.java:946)
2022-09-02T21:25:44.8552206Z at com.sonar.cpp.analyzer.AnalysisExecutor.lambda$submit$0(AnalysisExecutor.java:59)
2022-09-02T21:25:44.8553984Z ##[error]at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
2022-09-02T21:25:44.8555741Z at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
2022-09-02T21:25:44.8557502Z ##[error]at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
2022-09-02T21:25:44.8559061Z at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
2022-09-02T21:25:44.8561692Z ##[error]at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
2022-09-02T21:25:44.8563817Z at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
2022-09-02T21:25:44.8564970Z at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
2022-09-02T21:25:44.8566530Z ##[error]at java.base/java.lang.Thread.run(Thread.java:832)
2022-09-02T21:25:44.8567989Z at java.base/java.lang.Thread.run(Thread.java:832)
I can grab more logs and share unredacted info privately as needed. Thanks!