Stack overflow with reflect related items #87

Closed
opened 2025-12-30 01:20:35 +01:00 by adam · 5 comments
Owner

Originally created by @mitchcapper on GitHub (Feb 21, 2024).

Tells me its an unexpected error. Simple pkl file:

import "pkl:reflect"
a = reflect.Class( 5.getClass() )

I assume you don't need the entire stack trace on this one but if you want it let me know

jpkl eval test3.pkl
An unexpected error has occurred. Would you mind filing a bug report?
Cmd+Double-click the link below to open an issue.
Please copy and paste the entire error output into the issue's description, provided you can share it.

https://github.com/apple/pkl/issues/new

java.lang.StackOverflowError

–– Pkl Error ––
Stack overflow

Pkl 0.25.2 (Windows 10 10.0, Java 21.0.2)

java.lang.StackOverflowError
        at java.base/java.util.stream.SliceOps$2$1.begin(SliceOps.java:307)
        at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:526)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230)
        at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196)
Originally created by @mitchcapper on GitHub (Feb 21, 2024). Tells me its an unexpected error. Simple pkl file: ```pkl import "pkl:reflect" a = reflect.Class( 5.getClass() ) ``` I assume you don't need the entire stack trace on this one but if you want it let me know ``` jpkl eval test3.pkl An unexpected error has occurred. Would you mind filing a bug report? Cmd+Double-click the link below to open an issue. Please copy and paste the entire error output into the issue's description, provided you can share it. https://github.com/apple/pkl/issues/new java.lang.StackOverflowError –– Pkl Error –– Stack overflow Pkl 0.25.2 (Windows 10 10.0, Java 21.0.2) java.lang.StackOverflowError at java.base/java.util.stream.SliceOps$2$1.begin(SliceOps.java:307) at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:526) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230) at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196) ```
adam closed this issue 2025-12-30 01:20:35 +01:00
Author
Owner

@mitchcapper commented on GitHub (Feb 21, 2024):

Not the same but

import "pkl:reflect"
a =  reflect.intType

–– Pkl Error ––
Stack overflow

Pkl 0.25.2 (Windows 10 10.0, Java 21.0.2)

java.lang.StackOverflowError
at java.base/java.util.stream.StreamOpFlag.fromCharacteristics(StreamOpFlag.java:750)
at java.base/java.util.stream.StreamSupport.intStream(StreamSupport.java:139)
at java.base/java.lang.String.codePoints(String.java:4334)
at org.pkl.core.parser.Lexer.isRegularIdentifier(Lexer.java:89)
at org.pkl.core.parser.Lexer.maybeQuoteIdentifier(Lexer.java:96)
at org.pkl.core.stdlib.base.PcfRenderer.visitProperty(PcfRenderer.java:267)
at org.pkl.core.stdlib.AbstractRenderer.doVisitProperty(AbstractRenderer.java:195)
at org.pkl.core.stdlib.AbstractRenderer.lambda$visitTyped$0(AbstractRenderer.java:256)
at org.pkl.core.runtime.VmObject.lambda$iterateAlreadyForcedMemberValues$1(VmObject.java:132)
at org.pkl.core.runtime.VmObject.iterateMembers(VmObject.java:148)
at org.pkl.core.runtime.VmObject.iterateMembers(VmObject.java:141)
....

@mitchcapper commented on GitHub (Feb 21, 2024): Not the same but ``` import "pkl:reflect" a = reflect.intType ``` –– Pkl Error –– Stack overflow Pkl 0.25.2 (Windows 10 10.0, Java 21.0.2) java.lang.StackOverflowError at java.base/java.util.stream.StreamOpFlag.fromCharacteristics(StreamOpFlag.java:750) at java.base/java.util.stream.StreamSupport.intStream(StreamSupport.java:139) at java.base/java.lang.String.codePoints(String.java:4334) at org.pkl.core.parser.Lexer.isRegularIdentifier(Lexer.java:89) at org.pkl.core.parser.Lexer.maybeQuoteIdentifier(Lexer.java:96) at org.pkl.core.stdlib.base.PcfRenderer.visitProperty(PcfRenderer.java:267) at org.pkl.core.stdlib.AbstractRenderer.doVisitProperty(AbstractRenderer.java:195) at org.pkl.core.stdlib.AbstractRenderer.lambda$visitTyped$0(AbstractRenderer.java:256) at org.pkl.core.runtime.VmObject.lambda$iterateAlreadyForcedMemberValues$1(VmObject.java:132) at org.pkl.core.runtime.VmObject.iterateMembers(VmObject.java:148) at org.pkl.core.runtime.VmObject.iterateMembers(VmObject.java:141) .... ```
Author
Owner

@bioball commented on GitHub (Feb 21, 2024):

Thanks; this will be fixed by https://github.com/apple/pkl/pull/170

@bioball commented on GitHub (Feb 21, 2024): Thanks; this will be fixed by https://github.com/apple/pkl/pull/170
Author
Owner

@holzensp commented on GitHub (Feb 21, 2024):

Marking as fixed, because #170 is in the past. If you run into this again on the snapshot builds or future releases, please re-open.

@holzensp commented on GitHub (Feb 21, 2024): Marking as fixed, because #170 is in the past. If you run into this again on the snapshot builds or future releases, please re-open.
Author
Owner

@mitchcapper commented on GitHub (Feb 21, 2024):

Is there a public circleci or snapshot builds somewhere? Given #20 cannot quickly local compile to test.

@mitchcapper commented on GitHub (Feb 21, 2024): Is there a public circleci or snapshot builds somewhere? Given #20 cannot quickly local compile to test.
Author
Owner
@holzensp commented on GitHub (Feb 21, 2024): * Mac Aarch64: https://s01.oss.sonatype.org/content/groups/public/org/pkl-lang/pkl-cli-macos-aarch64/0.26.0-SNAPSHOT/ * Java: https://s01.oss.sonatype.org/content/groups/public/org/pkl-lang/pkl-cli-java/0.26.0-SNAPSHOT/ Generally; explore https://s01.oss.sonatype.org/content/groups/public/org/pkl-lang/
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#87