Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during SonarQube Scanner execution: Unable to analyze file #1205

Closed
Riruk opened this issue Aug 11, 2017 · 2 comments
Closed

Error during SonarQube Scanner execution: Unable to analyze file #1205

Riruk opened this issue Aug 11, 2017 · 2 comments
Assignees
Labels
Milestone

Comments

@Riruk
Copy link

Riruk commented Aug 11, 2017

Hello,

I am running SonarQube with SonarQube C++ Community plugin to analyze Mozilla Firefox project. However, I get the error while running the analysis (I attach the log of the error message below). I have tried to search for a fix to this error, but I was not able to find anything smarter than just to skip the analysis of the specific files, which causes the scanning error. Could you look at this issue?

Here are some examples of files (all of them are symlinks - maybe this is is a source for the problem, but there are plenty of other symlinks, which do not cause any errors), which analysis leads to an error (For simplicity, I also attach the files itself: Mozilla_errors.zip):
PATH-TO-Mozilla_Source/obj-x86_64-pc-linux-gnu/dist/include/nsISupportsBase.h
PATH-TO-Mozilla_Source/obj-x86_64-pc-linux-gnu/dist/include/nsPIDOMWindow.h
PATH-TO-Mozilla_Source/obj-x86_64-pc-linux-gnu/dist/include/nsSVGUtils.h

I'm using the following configuration:
OS: CentOS 7
SonarQube 5.6
SonarQube C++ Community plugin 0.9.7
Sonar-Scanner 3.0.1.733

The link to the Mozilla repository, which I use for scanning: https://github.com/mozilla/gecko-dev
Short revision hash: e686107

The error log:

ERROR: Error during SonarQube Scanner execution
org.sonar.squidbridge.api.AnalysisException: Unable to analyze file: PATH-TO-Mozilla_Source/obj-x86_64-pc-linux-gnu/dist/include/nsISupportsBase.h
at org.sonar.squidbridge.AstScanner.scanFiles(AstScanner.java:131)
at org.sonar.plugins.cxx.squid.CxxSquidSensor.execute(CxxSquidSensor.java:141)
at org.sonar.batch.sensor.SensorWrapper.analyse(SensorWrapper.java:57)
at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
at org.sonar.batch.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:83)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:226)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.batch.task.ScanTask.execute(ScanTask.java:47)
at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:106)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)
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:233)
at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123)
at org.sonarsource.scanner.cli.Main.execute(Main.java:77)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.NullPointerException
at org.sonar.cxx.visitors.AbstractCxxPublicApiVisitor.visitTemplateDeclaration(AbstractCxxPublicApiVisitor.java:488)
at org.sonar.cxx.visitors.AbstractCxxPublicApiVisitor.visitMemberDeclaration(AbstractCxxPublicApiVisitor.java:432)
at org.sonar.cxx.visitors.AbstractCxxPublicApiVisitor.visitNode(AbstractCxxPublicApiVisitor.java:153)
at com.sonar.sslr.impl.ast.AstWalker.visitNode(AstWalker.java:114)
at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:85)
at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
at com.sonar.sslr.impl.ast.AstWalker.walkAndVisit(AstWalker.java:69)
at org.sonar.squidbridge.AstScanner.scanFiles(AstScanner.java:110)

@guwirth
Copy link
Collaborator

guwirth commented Aug 11, 2017

Hi @Riruk, think there is something wrong with

org.sonar.squidbridge.api.AnalysisException: Unable to analyze file: PATH-TO-Mozilla_Source/obj-x86_64-pc-linux-gnu/dist/include/nsISupportsBase.h

visitTemplateDeclaration:

Caused by: java.lang.NullPointerException
at org.sonar.cxx.visitors.AbstractCxxPublicApiVisitor.visitTemplateDeclaration(AbstractCxxPublicApiVisitor.java:488)
at org.sonar.cxx.visitors.AbstractCxxPublicApiVisitor.visitMemberDeclaration(AbstractCxxPublicApiVisitor.java:432)

You are using v0.9.7. Maybe you can try if already fixed with v0.9.8? You can dowload a snapshot from here: https://ci.appveyor.com/project/SonarOpenCommunity/sonar-cxx/branch/master/artifacts

Regards,

@guwirth guwirth self-assigned this Aug 11, 2017
@guwirth guwirth added the bug label Aug 11, 2017
@guwirth guwirth added this to the 0.9.7 milestone Aug 11, 2017
@Riruk
Copy link
Author

Riruk commented Aug 11, 2017

It seems, that update to 0.9.8 fixes this issue.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants