Hi.
I started playing with the platform bit and tried to copy the "cli" example to implement a new example where I pass arguments to the binary and they get reversed and printed. Here is my current codebase: https://github.com/matthiasbeyer/roc/tree/add-example-reverse/examples/reverse although it does not work yet and I don't see why. If HEAD is reverted, it works, but as soon as I introduce List.reverse
to the roc code, it segfaults with free(): invalid pointer
. How can I debug this or what am I doing wrong here?
Sorry for hijacking this thread... :sweat_smile:
that link does not work for me
but most likely, something is freed by both rust and roc
The github repo you posted is invite only, and this is a bug since Roc shouldn't be able to segfault. I don't know how to debug it, things are still in pretty early stages here, my first non-trivial roc program also crashes the compiler.
Doing cargo run check <your_project/SomeFile.roc>
first can sometimes reveal errors in your program that cause the compiler to crash when doing just cargo run <your_project/SomeFile.roc>
.
this is a bug since Roc shouldn't be able to segfault
of note, Roc application code should never segfault, but under the hood platforms can use languages that can segfault - so if you make a change to a platform and the result is a segfault, that's not necessarily a bug in Roc!
okay, I am wondering why the repo is invite-only if it is a clone of the original roc repo ... all members of the roc repo should have access by default, right? Strange.
The platform is written in Rust (as I copied the cli
example). I will see how I can debug it! Thanks so far.
Btw check
does return zero
@Matthias Beyer feel free to just use a branch directly in this repo!
Yeah, I will try for myself for now, to learn to navigate the codebase and how things work internally. :laughing: but thanks!
Last updated: Jul 05 2025 at 12:14 UTC