Sonar-scanner exception in thread

Setup:

  • SonarQube 7.9.1.27448
  • sonar-scanner-4.0.0.1744-windows
  • SonarCFamily 6.3 (build 11371)

Hello,

I’m trying to scan an embedded C project with the sonar-scanner and the build-wrapper.
Its code for a microchip pic micro-controller target. In the past it worked with the special C Compiler (XC16 gcc, it’s a modified gcc compiler). After updating the server from version 7.1 to 7.9, im getting an exception from the sonar-scanner.

Before running the sonar-scanner I’m cleaning my project and rebuilding it with the build-wrapper
(the build-wrapper.log and build-wrapper-dump.json is build).

I checked the java version on the server and my pc, it’s JDK 11.0.4.
And I checked the file encoding (utf8, iso8859-1) but nothing helped.

(I created an eclipse and codelite gcc project and the scan worked well without any problems.)


C:\Users\xyz\MPLABXProjects\sonar_qube_test\sonar_qube_test.X>cmd /k sonar-scanner.bat
INFO: Scanner configuration file: C:\SonarQube\sonar-scanner-4.0.0.1744-windows\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: C:\Users\xyz\MPLABXProjects\sonar_qube_test\sonar_qube_test.X\sonar-project.properties
INFO: SonarQube Scanner 4.0.0.1744
INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
INFO: Windows 7 6.1 amd64
INFO: User cache: C:\Users\xyz\.sonar\cache
INFO: SonarQube server 7.9.1
INFO: Default locale: "de_DE", source code encoding: "UTF-8"
INFO: Load global settings
INFO: Load global settings (done) | time=120ms
INFO: Server id: BF41A1F2-AW0pZMkyphQFPar3lVtl
INFO: User cache: C:\Users\xyz\.sonar\cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=82ms
INFO: Load/download plugins (done) | time=289ms
WARN: Plugin SonarQube CNES Report [cnesreport] uses a child first classloader which is deprecated
INFO: Loaded core extensions: developer-scanner
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=6ms
INFO: Project key: sonar_qube_test
INFO: Base dir: C:\Users\xyz\MPLABXProjects\sonar_qube_test\sonar_qube_test.X
INFO: Working dir: C:\Users\xyz\MPLABXProjects\sonar_qube_test\sonar_qube_test.X\.scannerwork
INFO: Load project settings for component key: 'sonar_qube_test'
INFO: Load project settings for component key: 'sonar_qube_test' (done) | time=37ms
INFO: Load project branches
INFO: Load project branches (done) | time=29ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=16ms
INFO: Load branch configuration
INFO: Load branch configuration (done) | time=1ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=223ms
INFO: Load active rules
INFO: Load active rules (done) | time=6338ms
INFO: Indexing files...
INFO: Project configuration:
INFO: 22 files indexed
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for c: Sonar way
INFO: Quality profile for xml: Sonar way
INFO: ------------- Run sensors on module sonar_qube_test
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=24ms
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/C:/Users/xyz/.sonar/cache/a89f1943fc75b65becd9fb4ecab8d913/s
l-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO: Sensor JavaXmlSensor [java]
INFO: 5 source files to be analyzed
INFO: Load project repositories
INFO: Load project repositories (done) | time=29ms
INFO: Sensor JavaXmlSensor [java] (done) | time=368ms
INFO: Sensor HTML [web]
INFO: 5/5 source files have been analyzed
INFO: Sensor HTML [web] (done) | time=13ms
INFO: Sensor XML Sensor [xml]
INFO: 5 source files to be analyzed
INFO: Sensor XML Sensor [xml] (done) | time=365ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=9ms
INFO: Sensor CFamily [cpp]
INFO: Using build-wrapper output: C:\Users\xyz\MPLABXProjects\sonar_qube_test\sonar_qube_test.X\bw_output\build-wrapper-dump.json
INFO: Available processors: 4
INFO: 5/5 source files have been analyzed
INFO: Using 1 thread for analysis according to value of "sonar.cfamily.threads" property.
WARN: Metric 'comment_lines_data' is deprecated. Provided value is ignored.
INFO: [pool-3-thread-1] C:/Users/xyz/MPLABXProjects/sonar_qube_test/sonar_qube_test.X/main.c
ERROR: Exception in thread pool-3-thread-1
java.lang.IllegalStateException: exit code != 0
        at com.sonar.cpp.analyzer.Subprocess.execute(Subprocess.java:54)
        at com.sonar.cpp.analyzer.Subprocess.execute(Subprocess.java:25)
        at com.sonar.cpp.plugin.CFamilySensor.lambda$process$4(CFamilySensor.java:330)
        at com.sonar.cpp.analyzer.AnalysisExecutor.lambda$submit$0(AnalysisExecutor.java:53)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 22.354s
INFO: Final Memory: 22M/80M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: java.lang.IllegalStateException: exit code != 0
        at com.sonar.cpp.analyzer.AnalysisExecutor.awaitTermination(AnalysisExecutor.java:78)
        at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:207)
        at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:62)
        at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
        at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:400)
        at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:395)
        at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:358)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
        at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
        at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
        at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
        at com.sun.proxy.$Proxy0.execute(Unknown Source)
        at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:185)
        at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
        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.IllegalStateException: exit code != 0
        at com.sonar.cpp.analyzer.Subprocess.execute(Subprocess.java:54)
        at com.sonar.cpp.analyzer.Subprocess.execute(Subprocess.java:25)
        at com.sonar.cpp.plugin.CFamilySensor.lambda$process$4(CFamilySensor.java:330)
        at com.sonar.cpp.analyzer.AnalysisExecutor.lambda$submit$0(AnalysisExecutor.java:53)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
----------------------------------------------------------------------------------------------------
1 Like

Hi @Ralf09,

could you run with the following property and share the generated file sonar-cfamily.reproducer?

-Dsonar.cfamily.reproducer=C:/Users/xyz/MPLABXProjects/sonar_qube_test/sonar_qube_test.X/main.c

Hello Massimo,

i added the property to my sonar-project.properties file. This time i got an exception from the reproducer.
It Seems that something is missing or cant be found. When iam running a scan with the sonar.cfamily.reproducer propertie in another C Project with less subfolders a reproducer file is generated.

sonar.host.url = http://10.168.66.137:9000
sonar.login = c3bc1cbed881d38514d6a1f980ace953f173f10e
sonar.projectKey = sonar_qube_test
sonar.sources = .
sonar.cfamily.build-wrapper-output = bw_output
sonar.cfamily.reproducer = C:/Users/xyz/MPLABXProjects/sonar_qube_test/sonar_qube_test.X/main.c
sonar.scm.disabled = true
sonar.sourceEncoding = UTF-8

Project Folder:
Unbenannt

11:52:29.255 INFO: Scanner configuration file: C:\SonarQube\sonar-scanner-4.0.0.1744-windows\bin\..\conf\sonar-scanner.properties
11:52:29.260 INFO: Project root configuration file: C:\Users\xyz\MPLABXProjects\sonar_qube_test_xc32\sonar_qube_test_xc32.X\sonar-project.properti
es
11:52:29.295 INFO: SonarQube Scanner 4.0.0.1744
11:52:29.296 INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
11:52:29.297 INFO: Windows 7 6.1 amd64
11:52:29.450 DEBUG: keyStore is :
11:52:29.450 DEBUG: keyStore type is : pkcs12
11:52:29.451 DEBUG: keyStore provider is :
11:52:29.451 DEBUG: init keystore
11:52:29.452 DEBUG: init keymanager of type SunX509
11:52:29.844 DEBUG: Create: C:\Users\xyz\.sonar\cache
11:52:29.845 INFO: User cache: C:\Users\xyz\.sonar\cache
11:52:29.845 DEBUG: Create: C:\Users\xyz\.sonar\cache\_tmp
11:52:29.848 DEBUG: Extract sonar-scanner-api-batch in temp...
11:52:29.852 DEBUG: Get bootstrap index...
11:52:29.852 DEBUG: Download: http://10.168.66.137:9000/batch/index
11:52:29.906 DEBUG: Get bootstrap completed
11:52:29.910 DEBUG: Create isolated classloader...
11:52:29.918 DEBUG: Start temp cleaning...
11:52:29.924 DEBUG: Temp cleaning done
11:52:29.925 DEBUG: Execution getVersion
11:52:29.933 INFO: SonarQube server 7.9.1
11:52:29.933 INFO: Default locale: "de_DE", source code encoding: "UTF-8"
11:52:29.934 DEBUG: Work directory: C:\Users\xyz\MPLABXProjects\sonar_qube_test_xc32\sonar_qube_test_xc32.X\.scannerwork
11:52:29.936 DEBUG: Execution execute
11:52:30.550 DEBUG: Developer 7.9.1.27448
11:52:30.661 INFO: Load global settings
11:52:30.709 DEBUG: GET 200 http://10.168.66.137:9000/api/settings/values.protobuf | time=45ms
11:52:30.749 INFO: Load global settings (done) | time=87ms
11:52:30.751 INFO: Server id: BF41A1F2-AW0pZMkyphQFPar3lVtl
11:52:30.774 INFO: User cache: C:\Users\xyz\.sonar\cache
11:52:30.781 INFO: Load/download plugins
11:52:30.782 INFO: Load plugins index
11:52:30.793 DEBUG: GET 200 http://10.168.66.137:9000/api/plugins/installed | time=11ms
11:52:30.842 INFO: Load plugins index (done) | time=60ms
11:52:31.040 INFO: Load/download plugins (done) | time=259ms
11:52:31.050 WARN: Plugin SonarQube CNES Report [cnesreport] uses a child first classloader which is deprecated
11:52:31.315 DEBUG: Plugins:
11:52:31.315 DEBUG:   * SonarCSS 1.1.1.1010 (cssfamily)
11:52:31.316 DEBUG:   * Svn 1.9.0.1295 (scmsvn)
11:52:31.320 DEBUG:   * SonarPLSQL 3.4.1.2576 (plsql)
11:52:31.323 DEBUG:   * SonarScala 1.5.0.315 (sonarscala)
11:52:31.327 DEBUG:   * SonarC# 7.16.0.8981 (csharp)
11:52:31.330 DEBUG:   * Vulnerability Analysis 7.9.0.5105 (security)
11:52:31.334 DEBUG:   * SonarJava 5.14.0.18788 (java)
11:52:31.337 DEBUG:   * SonarQube CNES Report 3.1.0 (cnesreport)
11:52:31.341 DEBUG:   * LDAP 2.2.0.608 (ldap)
11:52:31.344 DEBUG:   * SonarHTML 3.2.0.2082 (web)
11:52:31.347 DEBUG:   * SonarFlex 2.5.1.1831 (flex)
11:52:31.351 DEBUG:   * SonarXML 2.0.1.2020 (xml)
11:52:31.354 DEBUG:   * SonarTS 1.9.0.3766 (typescript)
11:52:31.358 DEBUG:   * SonarVB 7.16.0.8981 (vbnet)
11:52:31.361 DEBUG:   * SonarSwift 4.1.0.3087 (swift)
11:52:31.365 DEBUG:   * SonarCFamily 6.3.0.11371 (cpp)
11:52:31.368 DEBUG:   * SonarPython 1.15.1.4116 (python)
11:52:31.372 DEBUG:   * GitHub Authentication for SonarQube 1.5.0.870 (authgithub)
11:52:31.375 DEBUG:   * JaCoCo 1.0.2.475 (jacoco)
11:52:31.379 DEBUG:   * SonarGo 1.6.0.719 (go)
11:52:31.383 DEBUG:   * SonarKotlin 1.5.0.315 (kotlin)
11:52:31.386 DEBUG:   * SonarTSQL 1.4.0.3334 (tsql)
11:52:31.390 DEBUG:   * SonarJS 5.2.1.7778 (javascript)
11:52:31.393 DEBUG:   * SonarRuby 1.5.0.315 (ruby)
11:52:31.397 DEBUG:   * Vulnerability Rules for C# 7.9.0.5105 (securitycsharpfrontend)
11:52:31.400 DEBUG:   * Vulnerability Rules for Java 7.9.0.5105 (securityjavafrontend)
11:52:31.404 DEBUG:   * License for SonarLint 7.9.1 (license)
11:52:31.407 DEBUG:   * Git 1.9.0.1725 (scmgit)
11:52:31.411 DEBUG:   * SAML 2.0 Authentication for SonarQube 1.1.0.181 (authsaml)
11:52:31.415 DEBUG:   * SonarPHP 3.2.0.4868 (php)
11:52:31.418 DEBUG:   * SonarABAP 3.8.0.2034 (abap)
11:52:31.421 DEBUG:   * Vulnerability Rules for PHP 7.9.0.5105 (securityphpfrontend)
11:52:31.462 INFO: Loaded core extensions: developer-scanner
11:52:31.495 DEBUG: Installed core extension: developer-scanner
11:52:32.282 INFO: Process project properties
11:52:32.297 DEBUG: Process project properties (done) | time=15ms
11:52:32.298 INFO: Execute project builders
11:52:32.300 DEBUG: Execute project builder: org.sonar.plugins.csharp.CSharpGlobalProtobufFileProcessor
11:52:32.305 DEBUG: Execute project builder: org.sonar.plugins.vbnet.VbNetGlobalProtobufFileProcessor
11:52:32.311 INFO: Execute project builders (done) | time=13ms
11:52:32.318 INFO: Project key: sonar_qube_test
11:52:32.319 INFO: Base dir: C:\Users\xyz\MPLABXProjects\sonar_qube_test_xc32\sonar_qube_test_xc32.X
11:52:32.320 INFO: Working dir: C:\Users\xyz\MPLABXProjects\sonar_qube_test_xc32\sonar_qube_test_xc32.X\.scannerwork
11:52:32.324 DEBUG: Project global encoding: UTF-8, default locale: de_DE
11:52:32.330 DEBUG: Creating module hierarchy
11:52:32.331 DEBUG:   Init module 'sonar_qube_test'
11:52:32.335 DEBUG:     Base dir: C:\Users\xyz\MPLABXProjects\sonar_qube_test_xc32\sonar_qube_test_xc32.X
11:52:32.337 DEBUG:     Working dir: C:\Users\xyz\MPLABXProjects\sonar_qube_test_xc32\sonar_qube_test_xc32.X\.scannerwork
11:52:32.338 DEBUG:     Module global encoding: UTF-8, default locale: de_DE
11:52:32.360 INFO: Load project settings for component key: 'sonar_qube_test'
11:52:32.413 DEBUG: GET 200 http://10.168.66.137:9000/api/settings/values.protobuf?component=sonar_qube_test | time=52ms
11:52:32.414 INFO: Load project settings for component key: 'sonar_qube_test' (done) | time=54ms
11:52:32.432 INFO: Load project branches
11:52:32.449 DEBUG: GET 200 http://10.168.66.137:9000/api/project_branches/list?project=sonar_qube_test | time=16ms
11:52:32.460 INFO: Load project branches (done) | time=27ms
11:52:32.464 INFO: Load project pull requests
11:52:32.485 DEBUG: GET 200 http://10.168.66.137:9000/api/project_pull_requests/list?project=sonar_qube_test | time=12ms
11:52:32.490 INFO: Load project pull requests (done) | time=26ms
11:52:32.491 INFO: Load branch configuration
11:52:32.496 INFO: Load branch configuration (done) | time=5ms
11:52:32.548 DEBUG: Available languages:
11:52:32.633 INFO: Load quality profiles
11:52:32.840 DEBUG: GET 200 http://10.168.66.137:9000/api/qualityprofiles/search.protobuf?projectKey=sonar_qube_test | time=206ms
11:52:32.872 INFO: Load quality profiles (done) | time=239ms
11:52:32.888 INFO: Load active rules
11:52:33.327 DEBUG: GET 200 http://10.168.66.137:9000/api/rules
11:52:39.284 INFO: Load active rules (done) | time=6396ms
11:52:39.292 DEBUG: SCM Step is disabled by configuration
11:52:39.361 DEBUG: Declared extensions of language CSS were converted to sonar.lang.patterns.css : **/*.css,**/*.less,**/*.scss
11:52:39.362 DEBUG: Declared extensions of language PL/SQL were converted to sonar.lang.patterns.plsql : **/*.sql,**/*.pks,**/*.pkb
11:52:39.363 DEBUG: Declared extensions of language Scala were converted to sonar.lang.patterns.scala : **/*.scala
11:52:39.367 DEBUG: Declared extensions of language C# were converted to sonar.lang.patterns.cs : **/*.cs
11:52:39.371 DEBUG: Declared extensions of language Java were converted to sonar.lang.patterns.java : **/*.java,**/*.jav
11:52:39.375 DEBUG: Declared extensions of language HTML were converted to sonar.lang.patterns.web : **/*.html,**/*.xhtml,**/*.cshtml,**/*.vbhtml,**/*
.aspx,**/*.ascx,**/*.rhtml,**/*.erb,**/*.shtm,**/*.shtml
11:52:39.381 DEBUG: Declared extensions of language JSP were converted to sonar.lang.patterns.jsp : **/*.jsp,**/*.jspf,**/*.jspx
11:52:39.385 DEBUG: Declared extensions of language Flex were converted to sonar.lang.patterns.flex : **/*.as
11:52:39.388 DEBUG: Declared extensions of language XML were converted to sonar.lang.patterns.xml : **/*.xml,**/*.xsd,**/*.xsl
11:52:39.393 DEBUG: Declared extensions of language TypeScript were converted to sonar.lang.patterns.ts : **/*.ts,**/*.tsx
11:52:39.395 DEBUG: Declared extensions of language VB.NET were converted to sonar.lang.patterns.vbnet : **/*.vb
11:52:39.399 DEBUG: Declared extensions of language Swift were converted to sonar.lang.patterns.swift : **/*.swift
11:52:39.403 DEBUG: Declared extensions of language C were converted to sonar.lang.patterns.c : **/*.c,**/*.h
11:52:39.408 DEBUG: Declared extensions of language C++ were converted to sonar.lang.patterns.cpp : **/*.cc,**/*.cpp,**/*.cxx,**/*.c++,**/*.hh,**/*.hp
p,**/*.hxx,**/*.h++,**/*.ipp
11:52:39.414 DEBUG: Declared extensions of language Objective-C were converted to sonar.lang.patterns.objc : **/*.m
11:52:39.417 DEBUG: Declared extensions of language Python were converted to sonar.lang.patterns.py : **/*.py
11:52:39.421 DEBUG: Declared extensions of language Go were converted to sonar.lang.patterns.go : **/*.go
11:52:39.425 DEBUG: Declared extensions of language Kotlin were converted to sonar.lang.patterns.kotlin : **/*.kt
11:52:39.428 DEBUG: Declared extensions of language T-SQL were converted to sonar.lang.patterns.tsql : **/*.tsql
11:52:39.432 DEBUG: Declared extensions of language JavaScript were converted to sonar.lang.patterns.js : **/*.js,**/*.jsx,**/*.vue
11:52:39.435 DEBUG: Declared extensions of language Ruby were converted to sonar.lang.patterns.ruby : **/*.rb
11:52:39.439 DEBUG: Declared extensions of language PHP were converted to sonar.lang.patterns.php : **/*.php,**/*.php3,**/*.php4,**/*.php5,**/*.phtml,
**/*.inc
11:52:39.446 DEBUG: Declared extensions of language ABAP were converted to sonar.lang.patterns.abap : **/*.abap,**/*.ab4,**/*.flow,**/*.asprog
11:52:39.453 DEBUG: Will ignore generated code
11:52:39.455 DEBUG: Will ignore generated code
11:52:39.461 INFO: Indexing files...
11:52:39.462 INFO: Project configuration:
11:52:39.478 DEBUG: 'build\default\production\main.o' indexed with language 'null'
11:52:39.482 DEBUG: 'build\default\production\main.o.d' indexed with language 'null'
11:52:39.486 DEBUG: 'bw_output\build-wrapper-dump.json' indexed with language 'null'
11:52:39.492 DEBUG: 'bw_output\build-wrapper.log' indexed with language 'null'
11:52:39.499 DEBUG: 'dist\default\production\memoryfile.xml' indexed with language 'xml'
11:52:39.502 DEBUG: 'dist\default\production\sonar_qube_test_xc32.X.production.elf' indexed with language 'null'
11:52:39.507 DEBUG: 'dist\default\production\sonar_qube_test_xc32.X.production.hex' indexed with language 'null'
11:52:39.510 DEBUG: 'dist\default\production\sonar_qube_test_xc32.X.production.map' indexed with language 'null'
11:52:39.513 DEBUG: 'main.c' indexed with language 'c'
11:52:39.515 DEBUG: 'Makefile' indexed with language 'null'
11:52:39.519 DEBUG: 'nbproject\configurations.xml' indexed with language 'xml'
11:52:39.523 DEBUG: 'nbproject\Makefile-default.mk' indexed with language 'null'
11:52:39.526 DEBUG: 'nbproject\Makefile-genesis.properties' indexed with language 'null'
11:52:39.529 DEBUG: 'nbproject\Makefile-impl.mk' indexed with language 'null'
11:52:39.533 DEBUG: 'nbproject\Makefile-local-default.mk' indexed with language 'null'
11:52:39.536 DEBUG: 'nbproject\Makefile-variables.mk' indexed with language 'null'
11:52:39.539 DEBUG: 'nbproject\Package-default.bash' indexed with language 'null'
11:52:39.542 DEBUG: 'nbproject\private\configurations.xml' indexed with language 'xml'
11:52:39.545 DEBUG: 'nbproject\private\private.xml' indexed with language 'xml'
11:52:39.547 DEBUG: 'nbproject\project.xml' indexed with language 'xml'
11:52:39.550 DEBUG: 'RUN_SONAR_QUBE.bat' indexed with language 'null'
11:52:39.552 DEBUG: 'sonar-project.properties' indexed with language 'null'
11:52:39.555 INFO: 22 files indexed
11:52:39.557 INFO: Quality profile for c: Sonar way
11:52:39.558 INFO: Quality profile for xml: Sonar way
11:52:39.561 INFO: ------------- Run sensors on module sonar_qube_test
11:52:39.813 INFO: Load metrics repository
11:52:39.833 DEBUG: GET 200 http://10.168.66.137:9000/api/metrics/search?f=name,description,direction,qualitative,custom&ps=500&p=1 | time=20ms
11:52:39.843 INFO: Load metrics repository (done) | time=30ms
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/C:/Users/xyz/.sonar/cache/a89f1943fc75b65becd9fb4ecab8d913/sonar-tsq
l-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
11:52:42.613 DEBUG: 'JavaSquidSensor' skipped because there is no related file in current project
11:52:42.615 DEBUG: 'Import external issues report' skipped because one of the required properties is missing
11:52:42.616 DEBUG: 'SonarCSS Metrics' skipped because there is no related file in current project
11:52:42.619 DEBUG: 'SonarCSS Rules' skipped because there is no related file in current project
11:52:42.620 DEBUG: 'Import of stylelint issues' skipped because there is no related file in current project
11:52:42.626 DEBUG: 'PL/SQL Sensor' skipped because there is no related file in current project
11:52:42.630 DEBUG: 'Scala Sensor' skipped because there is no related file in current project
11:52:42.633 DEBUG: 'Scoverage sensor for Scala coverage' skipped because one of the required properties is missing
11:52:42.637 DEBUG: 'Import of Scalastyle issues' skipped because there is no related file in current project
11:52:42.640 DEBUG: 'Import of Scapegoat issues' skipped because there is no related file in current project
11:52:42.643 DEBUG: 'C# Properties' skipped because there is no related file in current project
11:52:42.648 DEBUG: 'Import of Checkstyle issues' skipped because there is no related file in current project
11:52:42.650 DEBUG: 'Import of PMD issues' skipped because one of the required properties is missing
11:52:42.655 DEBUG: 'Import of SpotBugs issues' skipped because there is no related file in current project
11:52:42.658 DEBUG: 'SurefireSensor' skipped because there is no related file in current project
11:52:42.661 DEBUG: 'JaCoCoSensor' skipped because there is no related file in current project
11:52:42.666 DEBUG: 'Flex' skipped because there is no related file in current project
11:52:42.668 DEBUG: 'Flex Cobertura' skipped because there is no related file in current project
11:52:42.672 DEBUG: 'SonarTS' skipped because there is no related file in current project
11:52:42.676 DEBUG: 'SonarTS Coverage' skipped because there is no related file in current project
11:52:42.679 DEBUG: 'Import of TSLint issues' skipped because one of the required properties is missing
11:52:42.682 DEBUG: 'VB.NET Properties' skipped because there is no related file in current project
11:52:42.687 DEBUG: 'SonarSwift' skipped because there is no related file in current project
11:52:42.688 DEBUG: 'Import of SwiftLint issues' skipped because there is no related file in current project
11:52:42.694 DEBUG: 'gcov' skipped because one of the required properties is missing
11:52:42.697 DEBUG: 'llvm-cov' skipped because one of the required properties is missing
11:52:42.701 DEBUG: 'cppunit' skipped because one of the required properties is missing
11:52:42.704 DEBUG: 'VisualStudioCoverage' skipped because one of the required properties is missing
11:52:42.707 DEBUG: 'bullseye' skipped because one of the required properties is missing
11:52:42.711 DEBUG: 'Python Squid Sensor' skipped because there is no related file in current project
11:52:42.714 DEBUG: 'Cobertura Sensor for Python coverage' skipped because there is no related file in current project
11:52:42.717 DEBUG: 'PythonXUnitSensor' skipped because there is no related file in current project
11:52:42.720 DEBUG: 'PylintSensor' skipped because there is no related file in current project
11:52:42.724 DEBUG: 'PylintImportSensor' skipped because there is no related file in current project
11:52:42.727 DEBUG: 'Import of Bandit issues' skipped because there is no related file in current project
11:52:42.730 DEBUG: 'SonarGo' skipped because there is no related file in current project
11:52:42.733 DEBUG: 'Go Unit Test Report' skipped because there is no related file in current project
11:52:42.735 DEBUG: 'Go Cover sensor for Go coverage' skipped because one of the required properties is missing
11:52:42.738 DEBUG: 'Import of go vet issues' skipped because there is no related file in current project
11:52:42.741 DEBUG: 'Import of Golint issues' skipped because there is no related file in current project
11:52:42.744 DEBUG: 'Import of GoMetaLinter issues' skipped because there is no related file in current project
11:52:42.747 DEBUG: 'Import of GolangCI-Lint issues' skipped because there is no related file in current project
11:52:42.749 DEBUG: 'Kotlin Sensor' skipped because there is no related file in current project
11:52:42.753 DEBUG: 'Import of detekt issues' skipped because there is no related file in current project
11:52:42.756 DEBUG: 'Import of Android Lint issues' skipped because one of the required properties is missing
11:52:42.758 DEBUG: 'T-SQL Sensor' skipped because there is no related file in current project
11:52:42.761 DEBUG: 'SonarJS' skipped because there is no related file in current project
11:52:42.764 DEBUG: 'ESLint-based SonarJS' skipped because there is no related file in current project
11:52:42.768 DEBUG: 'SonarJS Coverage' skipped because there is no related file in current project
11:52:42.770 DEBUG: 'Import of ESLint issues' skipped because one of the required properties is missing
11:52:42.773 DEBUG: 'Ruby Sensor' skipped because there is no related file in current project
11:52:42.776 DEBUG: 'Import of RuboCop issues' skipped because one of the required properties is missing
11:52:42.778 DEBUG: 'SimpleCov Sensor for Ruby coverage' skipped because there is no related file in current project
11:52:42.781 DEBUG: 'PHP sensor' skipped because there is no related file in current project
11:52:42.784 DEBUG: 'Analyzer for "php.ini" files' skipped because there is no related file in current project
11:52:42.787 DEBUG: 'AbapSquidSensor' skipped because there is no related file in current project
11:52:42.795 DEBUG: 'Generic Coverage Report' skipped because one of the required properties is missing
11:52:42.795 DEBUG: 'Generic Test Executions Report' skipped because one of the required properties is missing
11:52:42.797 DEBUG: 'C#' skipped because there is no related file in current project
11:52:42.802 DEBUG: 'C# Tests Coverage Report Import' skipped because there is no related file in current project
11:52:42.803 DEBUG: '[Deprecated] C# Integration Tests Coverage Report Import' skipped because there is no related file in current project
11:52:42.807 DEBUG: 'C# Unit Test Results Import' skipped because there is no related file in current project
11:52:42.809 DEBUG: 'VB.NET' skipped because there is no related file in current project
11:52:42.812 DEBUG: 'VB.NET Tests Coverage Report Import' skipped because there is no related file in current project
11:52:42.815 DEBUG: '[Deprecated] VB.NET Integration Tests Coverage Report Import' skipped because there is no related file in current project
11:52:42.818 DEBUG: 'VB.NET Unit Test Results Import' skipped because there is no related file in current project
11:52:42.822 DEBUG: Sensors : JavaXmlSensor -> HTML -> XML Sensor -> JaCoCo XML Report Importer -> CFamily -> JavaSecuritySensor -> CSharpSecuritySens
or -> PhpSecuritySensor
11:52:42.827 INFO: Sensor JavaXmlSensor [java]
11:52:42.833 INFO: 5 source files to be analyzed
11:52:42.846 INFO: Load project repositories
11:52:42.862 DEBUG: GET 200 http://10.168.66.137:9000/batch/project.protobuf?key=sonar_qube_test | time=16ms
11:52:42.870 INFO: Load project repositories (done) | time=24ms
11:52:42.871 DEBUG: 'dist/default/production/memoryfile.xml' generated metadata with charset 'UTF-8'
11:52:43.033 DEBUG: 'nbproject/configurations.xml' generated metadata with charset 'UTF-8'
11:52:43.113 DEBUG: 'nbproject/private/configurations.xml' generated metadata with charset 'UTF-8'
11:52:43.123 DEBUG: 'nbproject/private/private.xml' generated metadata with charset 'UTF-8'
11:52:43.134 DEBUG: 'nbproject/project.xml' generated metadata with charset 'UTF-8'
11:52:43.144 INFO: Sensor JavaXmlSensor [java] (done) | time=318ms
11:52:43.146 INFO: Sensor HTML [web]
11:52:43.145 INFO: 5/5 source files have been analyzed
11:52:43.153 INFO: Sensor HTML [web] (done) | time=7ms
11:52:43.154 INFO: Sensor XML Sensor [xml]
11:52:43.158 INFO: 5 source files to be analyzed
11:52:43.291 DEBUG: Count lines in file:///C:/Users/xyz/MPLABXProjects/sonar_qube_test_xc32/sonar_qube_test_xc32.X/dist/default/production/memoryf
ile.xml
11:52:43.382 DEBUG: Count lines in file:///C:/Users/xyz/MPLABXProjects/sonar_qube_test_xc32/sonar_qube_test_xc32.X/nbproject/configurations.xml
11:52:43.430 DEBUG: Count lines in file:///C:/Users/xyz/MPLABXProjects/sonar_qube_test_xc32/sonar_qube_test_xc32.X/nbproject/private/configuration
s.xml
11:52:43.463 DEBUG: Count lines in file:///C:/Users/xyz/MPLABXProjects/sonar_qube_test_xc32/sonar_qube_test_xc32.X/nbproject/private/private.xml
11:52:43.474 DEBUG: Count lines in file:///C:/Users/xyz/MPLABXProjects/sonar_qube_test_xc32/sonar_qube_test_xc32.X/nbproject/project.xml
11:52:43.482 INFO: Sensor XML Sensor [xml] (done) | time=328ms
11:52:43.489 INFO: Sensor JaCoCo XML Report Importer [jacoco]
11:52:43.498 DEBUG: No reports found
11:52:43.500 INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=11ms
11:52:43.501 INFO: Sensor CFamily [cpp]
11:52:43.504 INFO: Using build-wrapper output: C:\Users\xyz\MPLABXProjects\sonar_qube_test_xc32\sonar_qube_test_xc32.X\bw_output\build-wrapper-dum
p.json
11:52:43.509 INFO: Available processors: 4
11:52:43.511 DEBUG: Unpacking analyzer to: C:\Users\xyz\MPLABXProjects\sonar_qube_test_xc32\sonar_qube_test_xc32.X\.scannerwork\.sonartmp\43962832
54682476597
11:52:43.488 INFO: 5/5 source files have been analyzed
11:52:44.823 DEBUG: 'main.c' generated metadata with charset 'UTF-8'
11:52:44.841 WARN: Metric 'comment_lines_data' is deprecated. Provided value is ignored.
11:52:44.957 INFO: ------------------------------------------------------------------------
11:52:44.959 INFO: EXECUTION FAILURE
11:52:44.959 INFO: ------------------------------------------------------------------------
11:52:44.963 INFO: Total time: 15.735s
11:52:45.025 INFO: Final Memory: 22M/80M
11:52:45.025 INFO: ------------------------------------------------------------------------
11:52:45.026 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: sonar.cfamily.reproducer
        at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:211)
        at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:62)
        at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
        at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:400)
        at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:395)
        at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:358)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
        at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
        at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
        at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
        at com.sun.proxy.$Proxy0.execute(Unknown Source)
        at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:185)
        at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
        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)

Hi @Ralf09,

indeed, you changed the path of the project between the 2 executions, in the first

in the second:

So the property I told you to specify:

is not a valid path anymore.

Hello Massimo,

you’re right. I updated my project and the path and got a reproducer file.

sonar-cfamily.txt (785.2 KB)

Ralf

Hi @Ralf09,

your compiler is currently not supported, it is a modified gcc and doesn’t comply with gcc cli interface. As part of getting compiler configuration we run some command like gcc -dM -E -P -x c /dev/null to get the list of predefined macros in order to provide the best possible analysis.

In case of your compiler some extra output is given on stdout and it doesn’t comply with gcc cli interface:

Microchip Language Tool Shell Version 2.30 (Build date: Aug 15 2019).
Copyright (c) 2012-2017 Microchip Technology Inc. All rights reserved

This bugfix is going to avoid the crash of the analyzer: https://jira.sonarsource.com/browse/CPP-2270. Still it doesn’t solve the fact that your compiler is not supported. With version 6.4 of the analyzer you are not going to get a crash but you may get a poor analysis due to that output.

Hello Massimo,

thank you for your analyse. I think you mean the SonarCFamily 6.4 plugin!?
On my server, in marketplace i cant update the version from 6.3 to 6.4. Do i have to download the plugin separate? Or will it officially released soon?

Ralf

Hi @Ralf09,

yes, technical release happened, marketplace release is pending, it should come soon.

all right, thank you for your help.

A post was split to a new topic: CFamily analyzer and Microchip XC16 compiler

For the records, ticket created to add support for Microchip compilers: CPP-2569.