I opened an issue here: https://github.com/roc-lang/roc/issues/8532
thanks! I'll look into these today
I might find the issue soon. Looking into it now.
The segfault is due to dropPrefix using substringUnsafe without incrementing the ref count it seems. Well the function only increment when the prefix doesn’t match. I’m not sure why.
https://github.com/roc-lang/roc/blob/968e8776e2f69438135b3155829a2d9a556dd201/src/builtins/str.zig#L809
Do we have a fix for this yet? I think I can fix it also
Yeah @Richard Feldman has a fix in a branch that isn’t in a PR yet.
https://github.com/roc-lang/roc/compare/main...fix-uaf
I think once it’s merged, and my modulus pr is accepted too (https://github.com/roc-lang/roc/pull/8528), AoC day 1 is easily doable (I have some code ready to share ^^)
I'll look at your pr now
I am looking at another PR and have to push some commits to fix it, I can add the fix for drop_prefix in there too
Cherry picked and added into https://github.com/roc-lang/roc/pull/8520
fix for the use-after-free: https://github.com/roc-lang/roc/pull/8535
I resolved some merge conflicts between these branches so no harm that commit being in both PRs
Last updated: Dec 21 2025 at 12:15 UTC