Crash help text has mangled URL #32

Open
opened 2025-12-30 01:19:43 +01:00 by adam · 5 comments
Owner

Originally created by @Edward-Knight on GitHub (Feb 5, 2024).

The help text output when a crash happens has a URL to help submit a bug report, however this URL is mangled due to a missing newline:

$ echo "a { b = a }" | pkl eval - 2>&1 | head
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/newjava.lang.StackOverflowError

–– Pkl Error ––
Stack overflow

Pkl 0.25.1 (macOS 14.1, native)

The URL is https://github.com/apple/pkl/issues/newjava.lang.StackOverflowError instead of https://github.com/apple/pkl/issues/new.

This seems to be caused by a missing newline at the end of this paragraph:

6eb3d20b47/pkl-core/src/main/java/org/pkl/core/runtime/VmExceptionRenderer.java (L57-L62)


I can open a separate issue for the stack overflow if needed - seems sometimes this is caught, e.g.:

$ echo "output { value = output }" | pkl eval - 2>&1
–– Pkl Error ––
A stack overflow occurred.

┌─ 4001 repetitions of:
│ 106 | text = renderer.renderDocument(value)
│              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
│ at pkl.base#Module.output.text (https://github.com/apple/pkl/blob/0.25.1/stdlib/base.pkl#L106)
└─
Originally created by @Edward-Knight on GitHub (Feb 5, 2024). The help text output when a crash happens has a URL to help submit a bug report, however this URL is mangled due to a missing newline: ``` $ echo "a { b = a }" | pkl eval - 2>&1 | head 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/newjava.lang.StackOverflowError –– Pkl Error –– Stack overflow Pkl 0.25.1 (macOS 14.1, native) ``` The URL is https://github.com/apple/pkl/issues/newjava.lang.StackOverflowError ~~instead of https://github.com/apple/pkl/issues/new~~. ~~This seems to be caused by a missing newline at the end of this paragraph:~~ https://github.com/apple/pkl/blob/6eb3d20b472f4ae53595edf13b3499520c075b76/pkl-core/src/main/java/org/pkl/core/runtime/VmExceptionRenderer.java#L57-L62 --- I can open a separate issue for the stack overflow if needed - seems sometimes this is caught, e.g.: ``` $ echo "output { value = output }" | pkl eval - 2>&1 –– Pkl Error –– A stack overflow occurred. ┌─ 4001 repetitions of: │ 106 | text = renderer.renderDocument(value) │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ │ at pkl.base#Module.output.text (https://github.com/apple/pkl/blob/0.25.1/stdlib/base.pkl#L106) └─ ```
Author
Owner

@Edward-Knight commented on GitHub (Feb 5, 2024):

Or actually, looking at the code further, is the URL missing a ?body=? So it should be https://github.com/apple/pkl/issues/new?body=java.lang.StackOverflowError?

@Edward-Knight commented on GitHub (Feb 5, 2024): Or actually, looking at the code further, is the URL missing a `?body=`? So it should be https://github.com/apple/pkl/issues/new?body=java.lang.StackOverflowError?
Author
Owner

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

Fixed by PR #73

@holzensp commented on GitHub (Feb 9, 2024): Fixed by PR #73
Author
Owner

@Edward-Knight commented on GitHub (Feb 9, 2024):

Although #73 will ensure the URL is always valid, I don't think it's a full fix. The next line tries to URL encode the error, presumably so it can be put in the title or body of the GitHub issue

is the URL missing a ?body=? So it should be https://github.com/apple/pkl/issues/new?body=java.lang.StackOverflowError?

@Edward-Knight commented on GitHub (Feb 9, 2024): Although #73 will ensure the URL is always valid, I don't think it's a full fix. The next line tries to URL encode the error, presumably so it can be put in the title or body of the GitHub issue > is the URL missing a `?body=`? So it should be https://github.com/apple/pkl/issues/new?body=java.lang.StackOverflowError?
Author
Owner

@Edward-Knight commented on GitHub (Feb 9, 2024):

Also should I open a separate issue about the stack overflow or is the current behaviour expected?

@Edward-Knight commented on GitHub (Feb 9, 2024): Also should I open a separate issue about the stack overflow or is the current behaviour expected?
Author
Owner

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

The stack overflow is expected, although arguably it's missing a stack frame (cc @stackoverflow and not just for the ironically appropriate username). In Pkl, a = a is the simplest way to cause a stack overflow. That's essentially what you're doing here, because in output { value = output }, the inner output "ties a loop" with the outer output.

Re-opening to follow up about the query parts of the URL (which may have been rolled into the URL encoding fix)

@holzensp commented on GitHub (Feb 9, 2024): The stack overflow is expected, although arguably it's missing a stack frame (cc @stackoverflow and not just for the ironically appropriate username). In Pkl, `a = a` is the simplest way to cause a stack overflow. That's essentially what you're doing here, because in `output { value = output }`, the inner `output` "ties a loop" with the outer `output`. Re-opening to follow up about the query parts of the URL (which may have been rolled into the URL encoding fix)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#32