roc-lang / roc

A fast, friendly, functional language.
https://roc-lang.org
Universal Permissive License v1.0
4.46k stars 313 forks source link

Roc segfault running `roc test` #5180

Open lukewilliamboswell opened 1 year ago

lukewilliamboswell commented 1 year ago

I was in the middle of fault finding a bug somewhere in Json when I encountered a segmentation fault. I coped it into this gist for future reference.

lukewilliamboswell commented 1 year ago

I thought I should also run from cargo, these are the results

$ cargo run -- test crates/compiler/builtins/roc/Json.roc 
   Compiling roc_builtins v0.0.1 (/Users/luke/Documents/GitHub/roc/crates/compiler/builtins)
   Compiling roc_mono v0.0.1 (/Users/luke/Documents/GitHub/roc/crates/compiler/mono)
   Compiling roc_load_internal v0.0.1 (/Users/luke/Documents/GitHub/roc/crates/compiler/load_internal)
   Compiling roc_alias_analysis v0.0.1 (/Users/luke/Documents/GitHub/roc/crates/compiler/alias_analysis)
   Compiling roc_gen_wasm v0.0.1 (/Users/luke/Documents/GitHub/roc/crates/compiler/gen_wasm)
   Compiling roc_gen_dev v0.0.1 (/Users/luke/Documents/GitHub/roc/crates/compiler/gen_dev)
   Compiling roc_gen_llvm v0.0.1 (/Users/luke/Documents/GitHub/roc/crates/compiler/gen_llvm)
   Compiling roc_load v0.0.1 (/Users/luke/Documents/GitHub/roc/crates/compiler/load)
   Compiling roc_linker v0.0.1 (/Users/luke/Documents/GitHub/roc/crates/linker)
   Compiling roc_ast v0.0.1 (/Users/luke/Documents/GitHub/roc/crates/ast)
   Compiling roc_repl_eval v0.0.1 (/Users/luke/Documents/GitHub/roc/crates/repl_eval)
   Compiling roc_glue v0.0.1 (/Users/luke/Documents/GitHub/roc/crates/glue)
   Compiling roc_code_markup v0.0.1 (/Users/luke/Documents/GitHub/roc/crates/code_markup)
   Compiling roc_build v0.0.1 (/Users/luke/Documents/GitHub/roc/crates/compiler/build)
   Compiling roc_docs v0.0.1 (/Users/luke/Documents/GitHub/roc/crates/docs)
   Compiling roc_repl_cli v0.0.1 (/Users/luke/Documents/GitHub/roc/crates/repl_cli)
   Compiling roc_repl_expect v0.0.1 (/Users/luke/Documents/GitHub/roc/crates/repl_expect)
   Compiling roc_cli v0.0.1 (/Users/luke/Documents/GitHub/roc/crates/cli)
    Finished dev [unoptimized + debuginfo] target(s) in 17.83s
     Running `target/debug/roc test crates/compiler/builtins/roc/Json.roc`
thread 'main' panicked at 'assertion failed: value == 0 || value == 1', crates/repl_expect/src/app.rs:25:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace