roc-lang / roc

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

test failure: `glue_cli_run::advanced_recursive_union` `bad status` #3811

Closed Anton-4 closed 2 years ago

Anton-4 commented 2 years ago

I encountered the following failure on main inside nix:

running 13 tests
test glue_cli_run::all_fixtures_have_tests ... ok
test glue_cli_run::basic_recursive_union ... ok
test glue_cli_run::nested_record ... ok
test glue_cli_run::basic_record ... ok
test glue_cli_run::single_tag_union ... ok
test glue_cli_run::enumeration ... ok
test glue_cli_run::union_without_padding ... ok
test glue_cli_run::nullable_unwrapped ... ok
test glue_cli_run::nonnullable_unwrapped ... ok
test glue_cli_run::nullable_wrapped ... ok
test glue_cli_run::union_with_padding ... ok
test glue_cli_run::list_recursive_union ... ok
test glue_cli_run::advanced_recursive_union ... FAILED

failures:

---- glue_cli_run::advanced_recursive_union stdout ----
thread 'glue_cli_run::advanced_recursive_union' panicked at 'bad status Out { stdout: "πŸ”¨ Rebuilding host...\nrbt was: Rbt { default: Job::Job(R1 { command: Command::Command(R2 { tool: Tool::SystemTool(R4 { name: \"test\", num: 42 }) }), inputFiles: [\"foo\"] }) }\n", stderr: "", status: ExitStatus(unix_wait_status(139)) }', crates/glue/tests/test_glue_cli.rs:222:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    glue_cli_run::advanced_recursive_union

test result: FAILED. 12 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 6.48s

To reproduce:

nix develop
cargo test --release --locked

tagging @rtfeldman

The reason this error slipped by CI is likely that we do not use a merge queue yet. I hope to set this up soon. EDIT This error does not happen on CI. btw unix_wait_status(139) is a segmentation fault.

Anton-4 commented 2 years ago

I'm bisecting to get a specific commit.

Anton-4 commented 2 years ago

bisected to 1ad59c6c459d44b6a33834b42a9be6457eed12fb "Replace usages of ManuallyDrop::take with ::into_inner"

rtfeldman commented 2 years ago

Interesting! I'll take a look. Thanks for tracking it down!

Anton-4 commented 2 years ago

In the case that you can not reproduce it, can you let me know where I can find the binary that test produces? It's possible that it is similar to what we have going on in #3769.

rtfeldman commented 2 years ago

Yeah I can't reproduce it on M1 Mac inside nix develop πŸ€”

You should be able to reproduce it outside the test environment with:

cargo run -- glue crates/glue/tests/fixtures/advanced-recursive-union/platform.roc crates/glue/tests/fixtures/advanced-recursive-union/src/test_glue.rs
cargo run -- build crates/glue/tests/fixtures/advanced-recursive-union/app.roc

This will generate an executable binary at crates/glue/tests/fixtures/advanced-recursive-union/app

Anton-4 commented 2 years ago

Thanks, I'll take a look when I can.

JanCVanB commented 2 years ago

I'm hitting this on main in my Fedora 36 + Nix environment:

failures:

---- glue_cli_run::advanced_recursive_union stdout ----
thread 'glue_cli_run::advanced_recursive_union' panicked at 'bad status Out { stdout: "πŸ”¨ Rebuilding host...\nrbt was: Rbt { default: Job::Job(R1 { command: Command::Command(R2 { tool: Tool::SystemTool(R4 { name: \"test\", num: 42 }) }), inputFiles: [\"foo\"] }) }\n", stderr: "", status: ExitStatus(unix_wait_status(139)) }', crates/glue/tests/test_glue_cli.rs:228:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    glue_cli_run::advanced_recursive_union

test result: FAILED. 14 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 11.56s

error: test failed, to rerun pass '-p roc_glue --test test_glue_cli'
Anton-4 commented 2 years ago

This no longer occurs on my NixOS machine and fedora VM.

JanCVanB commented 2 years ago

Yes, same here!