IBM / zopeneditor-about

IBM Z Open Editor: File issues here!
https://ibm.github.io/zopeneditor-about
Apache License 2.0
47 stars 25 forks source link

PLI Parser error when editing code #383

Open nk2164 opened 5 months ago

nk2164 commented 5 months ago

Development environment used

Problem Description

Detailed steps for reproducing the problem:

  1. First step

Observed behavior

Not finding an exact pattern , but i am wondering if its got to do with the size of my code. But sometimes, i edit the code and start making changes, and i see this below stack getting dumped.

I am editing a PLI/CICS code. Once this shows up , it keep happening again and again .. I have to end up closing vscode.

Expected behavior

No Errors during normal edits to code.

[Error - 2:34:14 AM] Request textDocument/documentSymbol failed. Message: Internal error. Code: -32603 java.util.concurrent.CompletionException: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0 at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:649) at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0 at com.ibm.ftt.language.pli.contentassist.ContentAssistStatementFactory.createEndBlock(ContentAssistStatementFactory.java:592) at com.ibm.ftt.language.pli.contentassist.ContentAssistStatementFactory.createStatement(ContentAssistStatementFactory.java:171) at com.ibm.ftt.language.pli.contentassist.ContentAssistParseTree.parse(ContentAssistParseTree.java:480) at com.ibm.ftt.common.language.pl1.outline.Pl1OutlineParserDelegate.parse(Pl1OutlineParserDelegate.java:117) at com.ibm.wazi.lsp.pli.core.handlers.DocumentSymbolHandler.getSymbols(DocumentSymbolHandler.java:64) at com.ibm.wazi.lsp.pli.core.PLILanguageServer.lambda$9(PLILanguageServer.java:249) at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ... 6 more


[Error - 4:40:27 PM] Request textDocument/documentSymbol failed. Message: Internal error. Code: -32603 java.util.concurrent.CompletionException: java.util.EmptyStackException at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:649) at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) Caused by: java.util.EmptyStackException at java.base/java.util.Stack.peek(Stack.java:101) at com.ibm.ftt.language.pli.contentassist.ContentAssistStatementFactory.createEndBlock(ContentAssistStatementFactory.java:589) at com.ibm.ftt.language.pli.contentassist.ContentAssistStatementFactory.createStatement(ContentAssistStatementFactory.java:171) at com.ibm.ftt.language.pli.contentassist.ContentAssistParseTree.parse(ContentAssistParseTree.java:480) at com.ibm.ftt.common.language.pl1.outline.Pl1OutlineParserDelegate.parse(Pl1OutlineParserDelegate.java:117) at com.ibm.wazi.lsp.pli.core.handlers.DocumentSymbolHandler.getSymbols(DocumentSymbolHandler.java:64) at com.ibm.wazi.lsp.pli.core.PLILanguageServer.lambda$9(PLILanguageServer.java:249) at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ... 6 more

Russell-May commented 4 months ago

I believe I see what is causing the issue, but would you be able to provide me with a sample PLI file that is having this issue so that I can verify? Thanks!

nk2164 commented 4 months ago

Thank you for looking into this.Unfortunately, i am unable to replicate this in a sample file i can share here. I will keep trying . But the code where I see this has many copybooks included and pretty big (about 6000+ lines of code) and its PLI/CICS. I will post here if i am able to recreate this in a sample i can share.

nk2164 commented 4 months ago

I noticed today there is another flavor of stack trace " java.util.EmptyStackException" (the earlier trace just had java.lang.ArrayIndexOutOfBoundsException).... Its possible both could be resulting from the same root cause, but I wanted to update this as well. Thanks.