After upgrading an LTS with latest plugins i am unable to scan on centos6 and ubuntu1604 (64bit)

sonarcfamily
(Alienpenguin) #1

Hello all, i am using a (commercial) LTS sonarqube 6.7.3 (build 38370) and i simply upgraded all my plugins to latest versions.
After such operation i am unable to scan anymore on CentOS 6 and Ubuntu 16.04 (both 64bit machines). Nothing was changed on the scanning platform machines.

On CentOS i noticed that glibc 2.14 is requested by some scanning components while on that platform the latest glibc is 2.12, now i am wondering what is the purpose of an LTS if glibc version changes within upgrades? Is there a way to restore scanning on a CentOS6 platform?

On Ubuntu, on the other hand, the scanning crashes with the following stack trace (tried even upgrading previous sonar-scanner 2.6.1 with altest 3.3.0 but nothing changed)

10:55:33.411 ERROR: Error during SonarQube Scanner execution
java.lang.NullPointerException
        at com.sonar.cpp.analyzer.ClangDriver.envListToMap(ClangDriver.java:470)
        at com.sonar.cpp.analyzer.ClangDriver.lambda$probeCompiler$6(ClangDriver.java:461)
        at java.util.HashMap.computeIfAbsent(HashMap.java:1126)
        at com.sonar.cpp.analyzer.ClangDriver.probeCompiler(ClangDriver.java:459)
        at com.sonar.cpp.analyzer.ClangDriver.onCapture(ClangDriver.java:302)
        at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:266)
        at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:198)
        at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:53)
        at org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:88)
        at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:82)
        at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:73)
        at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:88)
        at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:180)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
        at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:288)
        at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:283)
        at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:261)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
        at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
        at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:84)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
        at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:121)
        at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:71)
        at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        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:111)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
        at org.sonarsource.scanner.cli.Main.main(Main.java:61)
(Alienpenguin) #2

I solved the problem on ubuntu by updating the both sonar-scanner and build-wrapper (sonar-scanner was not enough).

The missing glibc problem on CentOS however is still a no-go :frowning:

(Massimo Paladin) #3

Hi @alienpenguin,

thank you for your feedback. The C/C++ analyzer has been completely rewritten starting with version 6.0, it is a pity you are not able to use it in your environment as the analyzer has more rules, and it is much more accurate than previous versions.

I understand your concerns about glibc and 32 bit machines with LTS. What is certain is that we are not going to restore such compatibility. What I am going to check internally is whether we should flag C/C++ analyzer 6.X version as not compatible with LTS version 6.7.X.

(Massimo Paladin) #4

For the records, ticket CPP-2184 restores compatibility with glibc 2.12 and has been released with version 6.2 of the C/C++ analyser.

1 Like