ERROR: Exception in thread ... com.sonar.cpp.analyzer.Analyzer$AnalyzerException: Exit code != 0:

Hi there,

I am having this issue running Sonar on an open source project, so I think you will have access to everything you need.

I tried a few things that I found here like disabling excpetion on boost asio(-DASIO_DISABLE_NOEXCEPT), but without success.

Project: GitHub - opentibiabr/otservbr-global: Repository for otservbr-global datapack. Source code: https://github.com/opentibiabr/canary
Branch where I am adding Sonar: https://github.com/opentibiabr/OTServBR-Global/tree/add-spdlog
Travis: Travis CI - Test and Deploy with Confidence

com.sonar.cpp.analyzer.Analyzer$AnalyzerException: Exit code != 0: /home/travis/build/opentibiabr/otservbr-global/src/actions.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:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

Hi @Foot ,

could you provide the sonar-cfamily-reproducer.zip file which gets created? I can send you a PM if you prefer to share privately.

Hi @mpaladin,

Attached, if you need more information, let me know!

Tks!

sonar-cfamily-reproducer.zip (883.4 KB)

2 posts were split to a new topic: AnalyzerException with CFamily analyzer

Hi @Foot ,

you are facing https://jira.sonarsource.com/browse/CPP-2696, it has just been fixed and will be deployed soon in SonarCloud, in the meantime you can add -DBOOST_ASIO_DISABLE_NOEXCEPT to your build.

1 Like

Hi @mpaladin,

Thanks for the confirmation.

I am using the vcpkg to manage the project dependencies and when I tried to add that flag to cmake call it doesn’t worked, so I exported it on the system before calling the vcpkg, and then it worked!

For those who wants to know how I fixed

export CXXFLAGS="$CXXFLAGS -DBOOST_ASIO_DISABLE_NOEXCEPT=1 "
...
cmake ..

Thanks,
Renato Foot

Hi @Foot ,

I am glad you managed to fix it and thank you for the update.

1 Like

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