Stream: bugs

Topic: Occasional panic associated with List.len


view this post on Zulip Jonathan (Mar 09 2026 at 23:29):

I had another stab, but neither the dev backend or the interpreter backend is working for this for me (for different reasons). Interpreter is same as above, but for the dev backend I actually removed everything to just an empty main.roc, having only main! and the platform.

app [main!] { pf: platform "https://github.com/lukewilliamboswell/roc-platform-template-zig/releases/download/0.6/2BfGn4M9uWJNhDVeMghGeXNVDFijMfPsmmVeo6M4QjKX.tar.zst" }

main! = |_args| {
    Ok({})
}

which crashed during roc build myfile.roc --no-cache --backend=dev (renamed from main because I had some weird cache errors in the past where this fixed it)

???:?:?: 0x105487697 in _dev.MonoExprCodeGen.MonoExprCodeGen(.arm64mac).generateMatch__anon_294464 (???)
???:?:?: 0x10533b4ff in _dev.MonoExprCodeGen.MonoExprCodeGen(.arm64mac).generateExprRaw (???)
???:?:?: 0x1051b472b in _dev.MonoExprCodeGen.MonoExprCodeGen(.arm64mac).generateExpr (???)
???:?:?: 0x10548aff7 in _dev.MonoExprCodeGen.MonoExprCodeGen(.arm64mac).generateBlock__anon_294468 (???)
???:?:?: 0x10533b51f in _dev.MonoExprCodeGen.MonoExprCodeGen(.arm64mac).generateExprRaw (???)
???:?:?: 0x1051b472b in _dev.MonoExprCodeGen.MonoExprCodeGen(.arm64mac).generateExpr (???)
???:?:?: 0x10548c607 in _dev.MonoExprCodeGen.MonoExprCodeGen(.arm64mac).compileLambdaAsProc__anon_294478 (???)
???:?:?: 0x10533b573 in _dev.MonoExprCodeGen.MonoExprCodeGen(.arm64mac).generateExprRaw (???)
???:?:?: 0x1051b472b in _dev.MonoExprCodeGen.MonoExprCodeGen(.arm64mac).generateExpr (???)
???:?:?: 0x1053e296b in _dev.MonoExprCodeGen.MonoExprCodeGen(.arm64mac).generateEntrypointWrapper (???)
???:?:?: 0x105281957 in _dev.ObjectFileCompiler.compileWithCodeGen__anon_250959 (???)
???:?:?: 0x1050bb17f in _dev.ObjectFileCompiler.crossCompileDispatch (???)
???:?:?: 0x104e770a7 in _dev.ObjectFileCompiler.ObjectFileCompiler.compileToObjectFile (???)
???:?:?: 0x104bde06f in _dev.ObjectFileCompiler.ObjectFileCompiler.compileToObjectFileAndWrite (???)
???:?:?: 0x104bd273f in _main.rocBuildNative (???)
???:?:?: 0x104bdee97 in _main.rocBuild (???)
???:?:?: 0x104dad557 in _main.mainArgs (???)
???:?:?: 0x104daf247 in _main.main (???)
???:?:?: 0x104daf7a7 in _main (???)
???:?:?: 0x197ee2b97 in ??? (???)
???:?:?: 0x0 in ??? (???)

view this post on Zulip Jonathan (Mar 09 2026 at 23:31):

Are there any other caches I can delete to try again for this? I'll nuke and start again but just so I don't miss anything.

view this post on Zulip Luke Boswell (Mar 09 2026 at 23:33):

Note the deb backend on main is basically < 1% functioning rn

view this post on Zulip Luke Boswell (Mar 09 2026 at 23:33):

It's had a very large refactor and is sitting on another branch

view this post on Zulip Jonathan (Mar 09 2026 at 23:34):

That would explain it :sweat_smile: I saw another message about the interpreter backend being deprecated and made the wrong conclusion.

view this post on Zulip Anton (Mar 20 2026 at 14:58):

@Jonathan this code works with the dev backend (now the default) now:

./zig-out/bin/roc test/echo/main.roc --no-cache

I ran it 50 times on macos, built from source.

view this post on Zulip Jonathan (Mar 20 2026 at 16:22):

I'll give it a try but that sounds promising!

view this post on Zulip Jonathan (Mar 20 2026 at 16:23):

I suppose I'll leave off reporting any other bugs for a little bit with the big backend churn right now?

view this post on Zulip Anton (Mar 20 2026 at 16:35):

@Luke Boswell

view this post on Zulip Jonathan (Mar 20 2026 at 16:41):

Still getting a (different) error here when built from source, I made a gist with the backtrace

https://gist.github.com/jrrrp/1d1c581b3f5c841f9ab64dca37bdb7e1

view this post on Zulip Anton (Mar 20 2026 at 16:45):

Oh weird, I will take a look in a bit

view this post on Zulip Anton (Mar 20 2026 at 17:55):

Temporary workaround with the for loop version of keep_oks:

keep_oks = |list, fun| {
    var $dest = []
    for elem in list {
        match fun(elem) {
            Ok(ok_val) => {
                $dest = $dest.append(ok_val)
            }
            Err(_) => {
                $dest = $dest
            }
        }
    }
    $dest
}

view this post on Zulip Anton (Mar 23 2026 at 11:18):

Fix in #9288


Last updated: Apr 10 2026 at 12:38 UTC