indexoutofboundsexception

47 views
Skip to first unread message

Mark Lübbehüsen

unread,
Feb 15, 2017, 8:20:00 AM2/15/17
to SonarQube
Hi,

we have the following problem. any ideas?

- Sonarqube 5.6
- Java Plugin 4.5

Thanks in advance,
Mark

/app/jenkins/jenkins-elwis/.jenkins/workspaces/elwis_hotfix_sonar_test/ant/build-report-sonar.xml:66: org.sonar.squidbridge.api.AnalysisException: SonarQube is unable to analyze file : 'path/to/file.java'
	at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:93)
	at org.sonar.java.ast.JavaAstScanner.scan(JavaAstScanner.java:67)
	at org.sonar.java.JavaSquid.scanSources(JavaSquid.java:114)
	at org.sonar.java.JavaSquid.scan(JavaSquid.java:108)
	at org.sonar.plugins.java.JavaSquidSensor.execute(JavaSquidSensor.java:87)
	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:62)
	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.ant.SonarQubeTask.launchAnalysis(SonarQubeTask.java:99)
	at org.sonarsource.scanner.ant.SonarQubeTask.execute(SonarQubeTask.java:81)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:435)
	at org.apache.tools.ant.Target.performTasks(Target.java:456)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
	at org.apache.tools.ant.Main.runBuild(Main.java:853)
	at org.apache.tools.ant.Main.startAnt(Main.java:235)
	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:285)
	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)
Caused by: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
	at java.util.ArrayList.rangeCheck(ArrayList.java:653)
	at java.util.ArrayList.get(ArrayList.java:429)
	at org.sonar.java.se.MethodYield.statesAfterInvocation(MethodYield.java:120)
	at org.sonar.java.se.ExplodedGraphWalker.lambda$executeMethodInvocation$12(ExplodedGraphWalker.java:637)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
	at java.util.Iterator.forEachRemaining(Iterator.java:116)
	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
	at org.sonar.java.se.ExplodedGraphWalker.executeMethodInvocation(ExplodedGraphWalker.java:636)
	at org.sonar.java.se.ExplodedGraphWalker.visit(ExplodedGraphWalker.java:484)
	at org.sonar.java.se.ExplodedGraphWalker.execute(ExplodedGraphWalker.java:230)
	at org.sonar.java.se.ExplodedGraphWalker.visitMethod(ExplodedGraphWalker.java:193)
	at org.sonar.java.se.SymbolicExecutionVisitor.execute(SymbolicExecutionVisitor.java:74)
	at org.sonar.java.se.SymbolicExecutionVisitor.visitNode(SymbolicExecutionVisitor.java:63)
	at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:95)
	at org.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:120)
	at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:97)
	at org.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:120)
	at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:97)
	at org.sonar.java.ast.visitors.SubscriptionVisitor.scanTree(SubscriptionVisitor.java:78)
	at org.sonar.java.ast.visitors.SubscriptionVisitor.scanFile(SubscriptionVisitor.java:64)
	at org.sonar.java.model.VisitorsBridge.visitFile(VisitorsBridge.java:118)
	at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:84)

Michael Gumowski

unread,
Feb 16, 2017, 2:45:37 AM2/16/17
to Mark Lübbehüsen, SonarQube
Hello Mark,

Thanks for the feedback. Unfortunately, without the source code of the file causing the analysis to fail, we won't be able to reproduce and identify the cause of the error.
Could you provide the file's content? Ideally, we would need a self-contained code snippet reproducing the issue systematically.

Regards,
Michael

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/fcc5bee4-08fc-4374-82d1-61675e0775b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Michael GUMOWSKI | SonarSource
Software Developer @ Language Team
http://sonarsource.com

Mark Lübbehüsen

unread,
Feb 22, 2017, 5:40:55 AM2/22/17
to SonarQube, mark.lue...@hmmh.de
Hi Michael,

thanks for your feedback.

Sorry I can not provide the file, but I have researched i little bit.

This error occurs the first time with the Java Plugin 4.3 (with 4.2 everything works fine) and effects the following rules

squid:S2637
squid:S3518
squid:S2189
squid:S2095 
squid:S2222 
squid:S2583 
squid:S2259 
squid:S3655

When I deactivate these rules everything works fine.

thanks in advance,
Mark

Michael Gumowski

unread,
Feb 27, 2017, 4:59:53 AM2/27/17
to Mark Lübbehüsen, SonarQube
Hello Mark,

You disabled all the rules relying on the Symbolic Execution engine, which is causing the issue. Sadly, we learn nothing with that. Disabling this rules just avoid the engine to start during analysis. The fact that the engine was the causing the issue was also already clearly visible from the stack trace you provided.

Unfortunately, if you don't provide any source or simplified reproducer, we won't be able to help you, nor fix the issue with the engine.

Regards,
Michael


For more options, visit https://groups.google.com/d/optout.

Michael Gumowski

unread,
Feb 27, 2017, 5:08:09 AM2/27/17
to Mark Lübbehüsen, SonarQube
Hello again Mark,

Forgot to said it, but we massively reworked the engine in our latest version of the SonarJava analyzer, version 4.6, which is currently in Request For Feedback period (so not yet released).
Could you maybe try with this version and check if the analysis is still failing?

Link to the RFF: SonarJava 4.6

Regards,
Michael
Reply all
Reply to author
Forward
0 new messages