-
Notifications
You must be signed in to change notification settings - Fork 13
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
Segfault when parsing a List (Str, Dec) #38
Comments
Thanks for reporting this @ageron! I've converted this to an app to facilitate investigation: app [main] {
pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.15.0/SlwdbJ-3GR7uBWQo6zlmYWNYOxnvo8r6YABXD-45UOw.tar.br",
json: "https://github.com/lukewilliamboswell/roc-json/releases/download/0.10.2/FH4N0Sw-JSFXJfG3j54VEDPtXOoN-6I9v_IA8S18IGk.tar.br"
}
import pf.Stdout
import json.Json
ListOfTuples: List (Str, Dec)
jsonStr = "[[\"Alice\", 1.1], [\"Bob\", 2.2], [\"Charles\", 3.3]]"
result : Result ListOfTuples _
result = jsonStr |> Str.toUtf8 |> Decode.fromBytes Json.utf8
main =
Stdout.line! (Inspect.toStr result) Valgrind output with the legacy linker:
This valgrind output is similar to parts of roc-lang/roc#6813, these issues could have the same cause. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to add the rest-api exercise to the roc track on exercism. It involves parsing a JSON object containing a Dict, but unfortunately this is blocked by #33 . I thought I could work around this by replacing the
Dict Str Dec
with aList (Str, Dec)
. Unfortunately, I'm now running into a segfault.Here's a code example to reproduce the issue (I'm using roc nightly pre-release, built from commit 54cd967 on Fri Sep 6 09:02:04 UTC 2024):
The text was updated successfully, but these errors were encountered: