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

Issue: NoSuchElementException #59

Open
acurat opened this issue Nov 6, 2024 · 3 comments
Open

Issue: NoSuchElementException #59

acurat opened this issue Nov 6, 2024 · 3 comments
Assignees

Comments

@acurat
Copy link

acurat commented Nov 6, 2024

Ran into this error trying to summarize a program. Please let me know if you need any other info.

[2024-11-06 14:17:23] [FINER] Setting value for 01WS-END-LITERALPICX(29)VALUE'END WORKING STORAGE - OLWS810'. 
[2024-11-06 14:17:23] [FINER] Setting value for 01DFHCOMMAREAPICX(99999). 
java.util.NoSuchElementException
	at java.base/java.util.List.getFirst(List.java:825)
	at org.smojol.common.vm.structure.Format1DataStructure.typeSpecForSingle(Format1DataStructure.java:207)
	at org.smojol.common.vm.structure.Format1DataStructure.calculateMemoryRequirements(Format1DataStructure.java:200)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at org.smojol.common.vm.structure.Format1DataStructure.typeSpecForSingle(Format1DataStructure.java:209)
	at org.smojol.common.vm.structure.Format1DataStructure.calculateMemoryRequirements(Format1DataStructure.java:200)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at org.smojol.common.vm.structure.Format1DataStructure.typeSpecForSingle(Format1DataStructure.java:209)
	at org.smojol.common.vm.structure.Format1DataStructure.calculateMemoryRequirements(Format1DataStructure.java:200)
	at org.smojol.common.structure.CobolDataStructureBuilder.build(CobolDataStructureBuilder.java:41)
	at org.smojol.toolkit.analysis.validation.DataStructureValidation$1.run(DataStructureValidation.java:31)
	at org.smojol.toolkit.analysis.pipeline.ParsePipeline.parse(ParsePipeline.java:155)
	at org.smojol.toolkit.analysis.pipeline.ParsePipeline.parse(ParsePipeline.java:81)
	at org.smojol.toolkit.analysis.task.analysis.BuildSeedModelTask.run(BuildSeedModelTask.java:30)
	at org.smojol.toolkit.task.SmojolTasks$15.run(SmojolTasks.java:169)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:722)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
	at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
	at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
	at org.smojol.toolkit.task.SmojolTasks.run(SmojolTasks.java:64)
	at org.smojol.toolkit.analysis.task.analysis.CodeTaskRunner.runForProgram(CodeTaskRunner.java:154)
	at org.smojol.toolkit.analysis.task.analysis.CodeTaskRunner.runForPrograms(CodeTaskRunner.java:95)
	at org.smojol.cli.MultiCommand.processPrograms(MultiCommand.java:105)
	at org.smojol.cli.MultiCommand.call(MultiCommand.java:92)
	at org.smojol.cli.MultiCommand.call(MultiCommand.java:30)
	at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
	at picocli.CommandLine.access$1500(CommandLine.java:148)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
	at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
	at picocli.CommandLine.execute(CommandLine.java:2170)
	at org.smojol.cli.MultiCommandCLI.main(MultiCommandCLI.java:10)
[2024-11-06 14:17:23] [FINE] Runtime.exit() called with status: 1 ```
@avishek-sen-gupta
Copy link
Owner

could you paste the space-separated version of the line 01DFHCOMMAREAPICX(99999) here?

@acurat
Copy link
Author

acurat commented Nov 6, 2024

Pasting that part of the code...

       LINKAGE SECTION.
       
       
       
       
       
       
       01  DFHCOMMAREA              PIC X(99999).
       
       
       PROCEDURE DIVISION USING DFHCOMMAREA.
       
       
       
       
       0000-MAINLINE.
       
           STRING WS-THIS-PROGRAM
                   '0000-MAINLINE'
           DELIMITED BY SIZE INTO TDQMSG
           PERFORM 9988-CSMT-LOG

@avishek-sen-gupta
Copy link
Owner

I'm unable to reproduce this issue from this code fragment. Could I ask you to do two things?

  • I've added a debugging log for this specific issue in commit 97b7bd3f8900b608a19687fe42a6381f293db558. Could you run the program with this build, and paste the resulting log just before the exception?
  • If possible, could you reduce the problematic program to its smallest possible size and post it here? This seems to be specifically an issue with processing the record sections, so I think you can omit everything in the PROCEDURE DIVISION, and reduce the size of the data sections to the minimum size where you still see the problem.

@avishek-sen-gupta avishek-sen-gupta self-assigned this Nov 6, 2024
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