-
Notifications
You must be signed in to change notification settings - Fork 33
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
Segmentation fault after reading files #295
Comments
Linking with the legacy linker still shows valgrind errors:
|
This updated example works with the latest version of basic-cli on main: app [main!] { pf: platform "../platform/main.roc" }
import pf.File
parse = \s ->
s
|> Str.splitOn "\n"
|> List.dropFirst 1
|> List.dropIf Str.isEmpty
main! = \_args ->
dbg (File.read_utf8! "file" |> Result.withDefault "failed" |> parse)
Ok {} The valgrind errors are still there though, I'm going to open a new issue for that. |
We can close this once we have confirmed it does not happen with the final release archive, because segfaults can be fickle. |
The segfault happens with the release archive :/ As a temporary workaround, I recommend building with the legacy linker: |
The below case produces a segmentation fault when compiling using the surgical linker. All of the main function is run, the crash happens at shutdown. The issue only occurs on files larger than 997 bytes. see this
The issue goes away when using
--linker=legacy
Roc version:
OS is Linux 6.12.4
The text was updated successfully, but these errors were encountered: