Ok, so I've ran across an interesting issue I think. I have been experimenting with some AoC code and came across a Segmentation fault when using --optimize
. I've pushed the code here for reference.
I've tried a few different combinations of things and the only thing that I have found that consitently causes it to occur is the --optimize
flag.
However, if I comment out the "sampleInput" for part1, I find it does build and runs perfectly ok with --optimize
. When I can do this with optimization on it runs reasonably quick (real 0m2.203s) versus without (real 0m32.181s). I'm not sure if optimised performance has any relevance to the segfault though.
$ roc build --optimize aoc-2022/12/main.roc
0 errors and 0 warnings found in 2845 ms while successfully building:
aoc-2022/12/aoc
$ ./aoc-2022/12/aoc
Segmentation fault: 11
$ roc build aoc-2022/12/main.roc
0 errors and 0 warnings found in 1648 ms while successfully building:
aoc-2022/12/aoc
$ ./aoc-2022/12/aoc
Part 1 - Shortest steps is: 31
Part 1 - Shortest steps is: 391
what operating system is this on?
macOS
interesting...can you open an issue?
Posted an issue 5545, and also made a minimised version
Last updated: Jul 05 2025 at 12:14 UTC