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 scan with v0.9.1 #83

Open
desrosim232 opened this issue Sep 16, 2024 · 6 comments
Open

Error during scan with v0.9.1 #83

desrosim232 opened this issue Sep 16, 2024 · 6 comments

Comments

@desrosim232
Copy link

desrosim232 commented Sep 16, 2024

12:06:58   java.lang.NullPointerException: Cannot invoke "com.sonar.sslr.api.AstNode.getChildren()" because "node" is null
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstQuery.dfs(AstQuery.java:287)
12:06:58     at nl.ramsolutions.sw.magik.parser.TypeDocParser.getCommentTokens(TypeDocParser.java:88)
12:06:58     at nl.ramsolutions.sw.magik.parser.TypeDocParser.<init>(TypeDocParser.java:74)
12:06:58     at nl.ramsolutions.sw.magik.analysis.definitions.parsers.DefineBinaryOperatorCaseParser.parseDefinitions(DefineBinaryOperatorCaseParser.java:128)
12:06:58     at nl.ramsolutions.sw.magik.analysis.definitions.DefinitionReader.handleDefineBinaryOperatorCase(DefinitionReader.java:148)
12:06:58     at nl.ramsolutions.sw.magik.analysis.definitions.DefinitionReader.walkPostProcedureInvocation(DefinitionReader.java:82)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkAst(AstWalker.java:281)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkChildren(AstWalker.java:21)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkAst(AstWalker.java:628)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkChildren(AstWalker.java:21)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkAst(AstWalker.java:556)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkChildren(AstWalker.java:21)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkAst(AstWalker.java:388)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkChildren(AstWalker.java:21)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkAst(AstWalker.java:346)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkChildren(AstWalker.java:21)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkAst(AstWalker.java:244)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkChildren(AstWalker.java:21)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkAst(AstWalker.java:496)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkChildren(AstWalker.java:21)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkAst(AstWalker.java:634)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkChildren(AstWalker.java:21)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkAst(AstWalker.java:556)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkChildren(AstWalker.java:21)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkAst(AstWalker.java:388)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkChildren(AstWalker.java:21)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkAst(AstWalker.java:346)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkChildren(AstWalker.java:21)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkAst(AstWalker.java:244)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkChildren(AstWalker.java:21)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkAst(AstWalker.java:82)
12:06:58     at nl.ramsolutions.sw.magik.MagikFile.getDefinitions(MagikFile.java:146)
12:06:58     at nl.ramsolutions.sw.magik.checks.checks.DuplicateMethodInFileCheck.walkPostMagik(DuplicateMethodInFileCheck.java:24)
12:06:58     at nl.ramsolutions.sw.magik.analysis.AstWalker.walkAst(AstWalker.java:83)
12:06:58     at nl.ramsolutions.sw.magik.MagikVisitor.scanFile(MagikVisitor.java:25)
12:06:58     at nl.ramsolutions.sw.magik.checks.MagikCheck.scanFileForIssues(MagikCheck.java:81)
12:06:58     at nl.ramsolutions.sw.sonar.sensors.MagikSensor.scanMagikFile(MagikSensor.java:122)
12:06:58     at nl.ramsolutions.sw.sonar.sensors.MagikSensor.execute(MagikSensor.java:91)
12:06:58     at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
12:06:58     at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88)
12:06:58     at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:61)
12:06:58     at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:79)
12:06:58     at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:61)
12:06:58     at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:82)
12:06:58     at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
12:06:58     at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
12:06:58     at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:204)
12:06:58     at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:200)
12:06:58     at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:173)
12:06:58     at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
@StevenLooman
Copy link
Owner

Thank you for this issue @desrosim232. Can you provide the code which is scanned/on which it fails?

@desrosim232
Copy link
Author

@StevenLooman unfortunately I can't share the file containing the code. I have put an exclusion on this particular file and the scan does not failed on any other of the 2615 magik files that we have.

@StevenLooman
Copy link
Owner

I understand you cannot share the code itself. Perhaps you can narrow down where in the file it is failing, and create a test case from that?

@desrosim232
Copy link
Author

The file as more then 1000 lines in it. For now, I don't have time to narrow it down. I'll let you know if I can do so.

@StevenLooman
Copy link
Owner

A fast strategy is to split the file in half and analyze it. Then do that again for the half which triggers the error. Rinse and repeat until you find the part which causes the error.

The linter will most likely crash on the same error, judging from the traceback you're seeing. This saves you running a complete Sonar analysis each time.

@desrosim232
Copy link
Author

I know how to test it and narrow down the issue. I just don't have the time to work on that right now.

I'll let you know when I can do so.

Thanks

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

No branches or pull requests

2 participants