com.sonar.cpp.analyzer.Analyzer$AnalyzerException: Exit code != 0:

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    – sonarqube-developer-8.8.0.42792
    – CFamily plugin version: 6.18.0.29274
    – build-wrapper, version 6.18 (win-x86-64)
  • what are you trying to achieve
    I’m trying to scan a solution (visual studio 2019) with a mix of c# and c++ (/std:c++14) projects.
    The c++ project is using BOOST (1.74.0)
    – scan for c# projects of the solution is working well
    – scan for another simple c++ project (not using BOOST) works fine too
  • what have you tried so far to achieve this
    – SonarScanner.MSBuild.exe begin /k:“hdb:develop” /d:sonar.cfamily.build-wrapper-output=“bw_output”
    – build-wrapper-win-x86-64.exe --out-dir E:\Projects\hoodbSolution\bw_output MSBuild.exe /t:Rebuild /p:configuration=Release /p:Platform=x64 /m
    – SonarScanner.MSBuild.exe end
    WITH
    #undef BOOST_ASIO_DISABLE_NOEXCEPT
    #undef ASIO_DISABLE_NOEXCEPT
    (I added these 2 lines after exploring https://jira.sonarsource.com/browse/CPP-2696)

I got the following output

INFO: Requesting reproducer for: E:/Projects/hoodbSolution/HoodbExe/source/HCommand/command_interpreter.cpp
INFO: [pool-1-thread-8] E:/Projects/hoodbSolution/HoodbExe/source/hfilesystem/volume_collection.cpp
INFO: [pool-1-thread-1] E:/Projects/hoodbSolution/HoodbExe/source/hfilesystem/inode_allocator.cpp
ERROR: Exception in thread pool-1-thread-2
com.sonar.cpp.analyzer.Analyzer$AnalyzerException: Exit code != 0: E:/Projects/hoodbSolution/HoodbExe/source/HCommand/command_interpreter.cpp
        at com.sonar.cpp.analyzer.Subprocess.execute(Subprocess.java:125)
        at com.sonar.cpp.analyzer.Subprocess.execute(Subprocess.java:48)
        at com.sonar.cpp.analyzer.Subprocess.execute(Subprocess.java:122)
        at com.sonar.cpp.analyzer.Subprocess.execute(Subprocess.java:48)
        at com.sonar.cpp.plugin.CFamilySensor.lambda$process$8(CFamilySensor.java:714)
        at com.sonar.cpp.analyzer.AnalysisExecutor.lambda$submit$0(AnalysisExecutor.java:59)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
        at java.base/java.lang.Thread.run(Thread.java:832)

ERROR: Exception in thread pool-1-thread-3
com.sonar.cpp.analyzer.Analyzer$AnalyzerException: Exit code != 0: E:/Projects/hoodbSolution/HoodbExe/source/hfilesystem/timed_storage_closing.cpp
        at com.sonar.cpp.analyzer.Subprocess.execute(Subprocess.java:125)
        at com.sonar.cpp.analyzer.Subprocess.execute(Subprocess.java:48)
        at com.sonar.cpp.plugin.CFamilySensor.lambda$process$8(CFamilySensor.java:714)
        at com.sonar.cpp.analyzer.AnalysisExecutor.lambda$submit$0(AnalysisExecutor.java:59)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
        at java.base/java.lang.Thread.run(Thread.java:832)

ERROR:
An error occurred while analyzing the following compilation unit:
  E:/Projects/hoodbSolution/HoodbExe/source/HCommand/command_interpreter.cpp
A file named "sonar-cfamily-reproducer.zip" has been generated to help the problem investigation.
Please contact SonarSource support providing the following file to help improving the analyzer:
  E:\Projects\hoodbSolution\sonar-cfamily-reproducer.zip

I can share the reproducer.zip if it helps to find the origin of the issue.
Thanks for any clue or solution !

Hi @Yuypanqui ,

I am sending you a PM where you can share the original reproducer.

Hi @Yuypanqui ,

you are affected by CPP-2696.

These are wrong, please drop them. What you need to add is:

#define BOOST_ASIO_DISABLE_NOEXCEPT

or add to the build:

-DBOOST_ASIO_DISABLE_NOEXCEPT

@mpaladin … it works well now.
Thanks for your efficient help.
Patrick

Hi @Yuypanqui ,

great, thank you for the update. FYI, it has been fixed and will soon be released as part of the next SonarQube version and soon deployed on SonarCloud.