Stream: bugs

Topic: Segfault with match


view this post on Zulip Tobias Steckenborn (Jun 05 2026 at 08:56):

Given e.g.

# Scenario:
# A byte parser classifies the length of a fixed-width fragment, such as the
# digits after the dot in a time fraction. The top-level expect only calls the
# default branch with an empty list, but compiling seven consecutive fixed-length
# list patterns is enough to crash `roc test --no-cache` on roc_nightly-macos_apple_silicon-2026-06-01-b250321.

Repro := {}.{

fractionDigitWidth : List(U8) -> I64
fractionDigitWidth = |fractionBytes| {
    match fractionBytes {
        [_firstDigit] => 1
        [_firstDigit, _secondDigit] => 2
        [_firstDigit, _secondDigit, _thirdDigit] => 3
        [_firstDigit, _secondDigit, _thirdDigit, _fourthDigit] => 4
        [_firstDigit, _secondDigit, _thirdDigit, _fourthDigit, _fifthDigit] => 5
        [_firstDigit, _secondDigit, _thirdDigit, _fourthDigit, _fifthDigit, _sixthDigit] => 6
        [_firstDigit, _secondDigit, _thirdDigit, _fourthDigit, _fifthDigit, _sixthDigit, _seventhDigit] => 7
        _ => 0
    }
}
}

expect {
    fractionDigitWidth([]) == 0
}

roc test reports a SIGSEGV.

view this post on Zulip Tobias Steckenborn (Jun 08 2026 at 07:45):

Should I rather open in GitHub? :sweat_smile:

view this post on Zulip Luke Boswell (Jun 08 2026 at 09:07):

Yes a GH Issue would be good


Last updated: Jun 16 2026 at 16:19 UTC