sonar-delphi
sonar-delphi copied to clipboard
Crash with pointer on a not valid line
Sonar crash during analyse (file with the problem : EPSSCallBackController.zip) :
INFO: ------------------------------------------------------------------------ INFO: EXECUTION FAILURE INFO: ------------------------------------------------------------------------ Total time: 23.984s Final Memory: 51M/823M INFO: ------------------------------------------------------------------------ ERROR: Error during Sonar runner execution org.sonar.runner.impl.RunnerException: Unable to execute Sonar at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91) at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75) at java.security.AccessController.doPrivileged(Native Method) at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69) at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50) at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102) at org.sonar.runner.api.Runner.execute(Runner.java:100) at org.sonar.runner.Main.executeTask(Main.java:70) at org.sonar.runner.Main.execute(Main.java:59) at org.sonar.runner.Main.main(Main.java:53) Caused by: java.lang.IllegalArgumentException: 711 is not a valid line for pointer. File [moduleKey=GRANT, relative=work space/EPERMIT.XE8/EPERMITSS00/EPSSCallBackController.pas, basedir=E:\jenkins\jobs\Grant] has 147 line(s) at org.sonar.api.internal.google.common.base.Preconditions.checkArgument(Preconditions.java:148) at org.sonar.api.batch.fs.internal.DefaultInputFile.checkValid(DefaultInputFile.java:214) at org.sonar.api.batch.fs.internal.DefaultInputFile.newPointer(DefaultInputFile.java:208) at org.sonar.api.batch.fs.internal.DefaultInputFile.selectLine(DefaultInputFile.java:243) at org.sonar.batch.issue.DeprecatedIssueBuilderWrapper.line(DeprecatedIssueBuilderWrapper.java:59) at org.sonar.plugins.delphi.metrics.ComplexityMetrics.addIssue(ComplexityMetrics.java:281) at org.sonar.plugins.delphi.metrics.ComplexityMetrics.processFunction(ComplexityMetrics.java:191) at org.sonar.plugins.delphi.metrics.ComplexityMetrics.analyse(ComplexityMetrics.java:144) at org.sonar.plugins.delphi.DelphiSensor.processFiles(DelphiSensor.java:131) at org.sonar.plugins.delphi.DelphiSensor.analyse(DelphiSensor.java:112) 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.PhaseExecutor.execute(PhaseExecutor.java:98) at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:100) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:85) at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:258) at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:253) at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:243) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:100) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:85) at org.sonar.batch.bootstrap.GlobalContainer.executeAnalysis(GlobalContainer.java:153) at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:110) at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:76) at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87) ... 9 more
Just to be sure, are you using the latest release(version 0.3.3)?
Yes, I installed the last 0.3.3 version (not a snapshot).
Please, run the analysis using debug mode (-X,--debug) and attach the log file. You got the same issue mentioned in this comment, whose problem was that the same class existed in different units in the same project.
The complete log of the problem: sonar.zip
I'll look for a duplicate class name to see if it's the same problem.
I got the error when analyzing another project. Now i will investigate the cause to fix it. Thank you.
Please, try with this snapshot: 0.3.4-16012016.jar. Feel free to reopen if something goes wrong.
I have still the problem:
E:\jenkins\workspace\Grant>sonar-runner -X > Sonar.log E:\jenkins\workspace\Grant\EPERMIT.XE8\ClassHelper\fmx.decoratorTMSFMXEditBtn.pa s line 10:18 no viable alternative at input 'Helper' E:\jenkins\workspace\Grant\EPERMIT.XE8\ClassHelper\fmx.decoratorTMSFMXEditBtn.pa s line 10:18 no viable alternative at input 'Helper' E:\jenkins\workspace\Grant\EPERMIT.XE8\ClassHelper\fmx.decoratorTMSFMXEditBtn.pa s line 10:18 no viable alternative at input 'Helper' E:\jenkins\workspace\Grant\EPERMIT.XE8\ClassHelper\fmx.decoratorTMSFMXEditBtn.pa s line 10:18 no viable alternative at input 'Helper' E:\jenkins\workspace\Grant\EPERMIT.XE8\ClassHelper\fmx.decoratorTMSFMXEditBtn.pa s line 10:18 no viable alternative at input 'Helper' E:\jenkins\workspace\Grant\EPERMIT.XE8\ClassHelper\fmx.decoratorTMSFMXEditBtn.pa s line 10:18 no viable alternative at input 'Helper' E:\jenkins\workspace\Grant\EPERMIT.XE8\ClassHelper\fmx.decoratorTMSFMXEditBtn.pa s line 10:18 no viable alternative at input 'Helper' E:\jenkins\workspace\Grant\EPERMIT.XE8\ClassHelper\fmx.decoratorTMSFMXEditBtn.pa s line 10:18 no viable alternative at input 'Helper' E:\jenkins\workspace\Grant\EPERMIT.XE8\ClassHelper\fmx.decoratorTMSFMXEditBtn.pa s line 10:18 no viable alternative at input 'Helper' E:\jenkins\workspace\Grant\EPERMIT.XE8\ClassHelper\fmx.decoratorTMSFMXEditBtn.pa s line 10:18 no viable alternative at input 'Helper' E:\jenkins\workspace\Grant\EPERMIT.XE8\ClassHelper\fmx.decoratorTMSFMXEditBtn.pa s line 10:18 no viable alternative at input 'Helper' E:\jenkins\workspace\Grant\EPERMIT.XE8\ClassHelper\fmx.decoratorTMSFMXEditBtn.pa s line 10:18 no viable alternative at input 'Helper' E:\jenkins\workspace\Grant\EPERMIT.XE8\ClassHelper\fmx.decoratorTMSFMXEditBtn.pa s line 10:18 no viable alternative at input 'Helper' E:\jenkins\workspace\Grant\EPERMIT.XE8\ClassHelper\fmx.decoratorTMSFMXEditBtn.pa s line 10:18 no viable alternative at input 'Helper' E:\jenkins\workspace\Grant\EPERMIT.XE8\ClassHelper\fmx.decoratorTMSFMXEditBtn.pa s line 10:18 no viable alternative at input 'Helper' E:\jenkins\workspace\Grant\EPERMIT.XE8\ClassHelper\fmx.decoratorTMSFMXEditBtn.pa s line 10:18 no viable alternative at input 'Helper' E:\jenkins\workspace\Grant\EPERMIT.XE8\ClassHelper\fmx.decoratorTMSFMXEditBtn.pa s line 10:18 no viable alternative at input 'Helper' E:\jenkins\workspace\Grant\EPERMIT.XE8\ClassHelper\fmx.decoratorTMSFMXEditBtn.pa s line 10:18 no viable alternative at input 'Helper' E:\jenkins\workspace\Grant\EPERMIT.XE8\ClassHelper\fmx.decoratorTMSFMXEditBtn.pa s line 10:18 no viable alternative at input 'Helper' E:\jenkins\workspace\Grant\EPERMIT.XE8\ClassHelper\fmx.decoratorTMSFMXEditBtn.pa s line 10:18 no viable alternative at input 'Helper' E:\jenkins\workspace\Grant\EPERMIT.XE8\ClassHelper\fmx.decoratorTMSFMXEditBtn.pa s line 10:18 no viable alternative at input 'Helper' E:\jenkins\workspace\Grant\EPERMIT.XE8\ClassHelper\fmx.decoratorTMSFMXEditBtn.pa s line 10:18 no viable alternative at input 'Helper' E:\jenkins\workspace\Grant\EPERMIT.XE8\ClassHelper\fmx.decoratorTMSFMXEditBtn.pa s line 10:30 no viable alternative at input 'platform' E:\jenkins\workspace\Grant\EPERMIT.XE8\EPERMITCP00Tiles\sources\FastMM4.pas line 1801:2 no viable alternative at input 'OldMemoryManager' E:\jenkins\workspace\Grant\EPERMIT.XE8\EPERMITCP00Tiles\sources\SafeMM.pas line 155:2 mismatched input 'SafeMemoryManager' expecting IMPLEMENTATION E:\jenkins\workspace\Grant\EPERMIT.XE8\EPERMITCP00Tiles\sources\SafeMM.pas line 217:5 mismatched input ';' expecting DOT E:\jenkins\workspace\Grant\EPERMIT.XE8\EPERMITCP02PermitReview\Forms\F_PermitRev iew.pas line 157:24 no viable alternative at input 'Platform' E:\jenkins\workspace\Grant\EPERMIT.XE8\EPERMITCP02PermitReview\Forms\F_PermitRev iew.pas line 157:24 no viable alternative at input 'Platform' E:\jenkins\workspace\Grant\EPERMIT.XE8\EPERMITCP02PermitReview\Forms\F_PermitRev iew.pas line 157:24 no viable alternative at input 'Platform' E:\jenkins\workspace\Grant\EPERMIT.XE8\EPERMITCP02PermitReview\Forms\F_PermitRev iew.pas line 157:24 no viable alternative at input 'Platform' E:\jenkins\workspace\Grant\EPERMIT.XE8\EPERMITCP02PermitReview\Forms\F_PermitRev iew.pas line 157:24 no viable alternative at input 'Platform' E:\jenkins\workspace\Grant\EPERMIT.XE8\EPERMITCP02PermitReview\Forms\F_PermitRev iew.pas line 401:44 missing END at '.' E:\jenkins\workspace\Grant\EPERMIT.XE8\EPERMITCP02PermitReview\Forms\F_ReviewRis k.pas line 63:6 no viable alternative at input 'Platform' E:\jenkins\workspace\Grant\EPERMIT.XE8\EPERMITCP02PermitReview\Units\U_PermitRev iewManager.pas line 1:0 no viable alternative at input 'unit' E:\jenkins\workspace\Grant\EPERMIT.XE8\EPERMITCP06Params\Units\IHMParameters.pas line 300:63 missing END at ';' E:\jenkins\workspace\Grant\EPERMIT.XE8\EPERMITCP06Params\Units\IHMParameters.pas line 300:63 mismatched input ';' expecting END E:\jenkins\workspace\Grant\EPERMIT.XE8\EPERMITSS00\EPSSCallBackController.pas li ne 1:0 no viable alternative at input '/' E:\jenkins\workspace\Grant\EPERMIT.XE8\EPERMITSS00\EPSSDataSnapServer.pas line 1 :0 no viable alternative at input '/' E:\jenkins\workspace\Grant\EPERMITLIB.XE8\LIBDELPHI\events.pas line 7:0 missing INTERFACE at 'uses' E:\jenkins\workspace\Grant\EPERMITLIB.XE8\LIBDELPHI\events.pas line 49:0 missing IMPLEMENTATION at 'begin' E:\jenkins\workspace\Grant\EPERMITLIB.XE8\LIBFUNC\EPFBase.pas line 43:24 no viab le alternative at input 'Platform' E:\jenkins\workspace\Grant\EPERMITLIB.XE8\LIBFUNC\EPFBase.pas line 43:24 no viab le alternative at input 'Platform' E:\jenkins\workspace\Grant\EPERMITLIB.XE8\LIBFUNC\LIBGENERAL.pas line 115:3 mism atched input ';' expecting DOT ERROR: Error during Sonar runner execution org.sonar.runner.impl.RunnerException: Unable to execute Sonar at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher .java:91) at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75) at java.security.AccessController.doPrivileged(Native Method) at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69) at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50) at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102 ) at org.sonar.runner.api.Runner.execute(Runner.java:100) at org.sonar.runner.Main.executeTask(Main.java:70) at org.sonar.runner.Main.execute(Main.java:59) at org.sonar.runner.Main.main(Main.java:53) Caused by: java.lang.IllegalArgumentException: 11080 is not a valid line for poi nter. File [moduleKey=GRANT, relative=EPERMITLIB.XE8/LIBFUNC/LIBFUNCBIS.pas, bas edir=E:\jenkins\workspace\Grant] has 1459 line(s) at org.sonar.api.internal.google.common.base.Preconditions.checkArgument (Preconditions.java:148) at org.sonar.api.batch.fs.internal.DefaultInputFile.checkValid(DefaultIn putFile.java:214) at org.sonar.api.batch.fs.internal.DefaultInputFile.newPointer(DefaultIn putFile.java:208) at org.sonar.api.batch.fs.internal.DefaultInputFile.selectLine(DefaultIn putFile.java:243) at org.sonar.batch.issue.DeprecatedIssueBuilderWrapper.line(DeprecatedIs sueBuilderWrapper.java:59) at org.sonar.plugins.delphi.metrics.ComplexityMetrics.addIssue(Complexit yMetrics.java:273) at org.sonar.plugins.delphi.metrics.ComplexityMetrics.analyse(Complexity Metrics.java:167) at org.sonar.plugins.delphi.DelphiSensor.processMetric(DelphiSensor.java :148) at org.sonar.plugins.delphi.DelphiSensor.processFiles(DelphiSensor.java: 130) at org.sonar.plugins.delphi.DelphiSensor.analyse(DelphiSensor.java:111) at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor. java:58) at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:5 0) at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:98) at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanConta iner.java:192) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentC ontainer.java:100) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer .java:85) at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.j ava:258) at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScan Container.java:253) at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanCon tainer.java:243) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentC ontainer.java:100) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer .java:85) at org.sonar.batch.bootstrap.GlobalContainer.executeAnalysis(GlobalConta iner.java:153) at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:110) at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:76) at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java :48) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher .java:87) ... 9 more
Thank you for the feedback. Not directly related to this issue, but I want to solve these parser errors. You can send me by mail if you prefer.
Hi, Will some body help on this.
ERROR: Error during Sonar runner execution ERROR: Unable to execute Sonar ERROR: Caused by: 712 is not a valid line for pointer.
File count of xxxx.java is 582, where us in sonar findbugs-result.. It's considering as 712 lines..
Hi, i've got an other error with the snapshot 0.3.4-16012016.jar.:
ERROR:
Error during Sonar runner execution
[13:44:49][Step 1/1] org.sonar.runner.impl.RunnerException: Unable to execute Sonar
[13:44:49][Step 1/1] at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
[13:44:49][Step 1/1] at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
[13:44:49][Step 1/1] at java.security.AccessController.doPrivileged(Native Method)
[13:44:49][Step 1/1] at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
[13:44:49][Step 1/1] at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
[13:44:49][Step 1/1] at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
[13:44:49][Step 1/1] at org.sonar.runner.api.Runner.execute(Runner.java:100)
[13:44:49][Step 1/1] at org.sonar.runner.Main.executeTask(Main.java:70)
[13:44:49][Step 1/1] at org.sonar.runner.Main.execute(Main.java:59)
[13:44:49][Step 1/1] at org.sonar.runner.Main.main(Main.java:53)
[13:44:49][Step 1/1] Caused by: java.lang.NullPointerException
[13:44:49][Step 1/1] at org.sonar.plugins.delphi.core.language.impl.DelphiUnit.getFileName(DelphiUnit.java:72)
[13:44:49][Step 1/1] at org.sonar.plugins.delphi.metrics.DeadCodeMetrics.findUnusedUnits(DeadCodeMetrics.java:229)
[13:44:49][Step 1/1] at org.sonar.plugins.delphi.metrics.DeadCodeMetrics.analyse(DeadCodeMetrics.java:90)
[13:44:49][Step 1/1] at org.sonar.plugins.delphi.DelphiSensor.processMetric(DelphiSensor.java:148)
[13:44:49][Step 1/1] at org.sonar.plugins.delphi.DelphiSensor.processFiles(DelphiSensor.java:131)
[13:44:49][Step 1/1] at org.sonar.plugins.delphi.DelphiSensor.analyse(DelphiSensor.java:111)
[13:44:49][Step 1/1] at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
[13:44:49][Step 1/1] at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
[13:44:49][Step 1/1] at org.sonar.batch.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:83)
[13:44:49][Step 1/1] at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:189)
[13:44:49][Step 1/1] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
[13:44:49][Step 1/1] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
[13:44:49][Step 1/1] at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:265)
[13:44:49][Step 1/1] at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:260)
[13:44:49][Step 1/1] at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:250)
[13:44:49][Step 1/1] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
[13:44:49][Step 1/1] at org.sonar.batch.scan.ProjectScanContainer.startComponents(ProjectScanContainer.java:128)
[13:44:49][Step 1/1] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
[13:44:49][Step 1/1] at org.sonar.batch.task.ScanTask.execute(ScanTask.java:55)
[13:44:49][Step 1/1] at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
[13:44:49][Step 1/1] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
[13:44:49][Step 1/1] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
[13:44:49][Step 1/1] at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:124)
[13:44:49][Step 1/1] at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
[13:44:49][Step 1/1] at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:79)
[13:44:49][Step 1/1] at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
[13:44:49][Step 1/1] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[13:44:49][Step 1/1] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[13:44:49][Step 1/1] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[13:44:49][Step 1/1] at java.lang.reflect.Method.invoke(Method.java:498)
[13:44:49][Step 1/1] at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
[13:44:49][Step 1/1] ... 9 more
[13:44:49][Step 1/1] Process exited with code 1`
Any idea? Thanks for your help
Hi, I think I solved most bugs described in this section. Most of them seemed to have something to do with the newer versions of sonarQube/scanner/runner. This sonar-delphi-plugin-0.3.4-Beta.zip is a SonarQube 5.6 compatible version of the sonar-plugin. The source code can be found at https://github.com/SandroLuck/sonar-delphi . If you need a lower version please let me know.
Hello! I have Sonar 5.6.3 and experienced this problem (same as @rajkumar7774 ) with two projects (about 10k lines avg). I can confirm that the solution from @SandroLuck works :) Thank you so much!
This crash can be provoqued by two problems in the source code :
- You have the same class/unit name in your project (a current unit used and an old unit not used by example).
- A ; is missing before an "end" somewhere in your code (syntactically correct for the compiler but not for the scanner).
Thanks, @Aarklendoia , reviewing the logs I've found several occurrences of the second item but I can't change the code right now. So for the time being I'm happy with the snapshot provided by the forked project.
I know this is an old issue, but I think I have found a reason for this happening. If there are 2 units in the analysis that have the same name (in our case modules created for unit testing), then the analysis get confused, when I temporarily removed these duplicate units, then the issue goes away.