Skip to content

ICE in smol-potat 1.1.2 (data race detected in EnvVars::cleanup) #2508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
saethlin opened this issue Aug 25, 2022 · 1 comment · Fixed by #2509
Closed

ICE in smol-potat 1.1.2 (data race detected in EnvVars::cleanup) #2508

saethlin opened this issue Aug 25, 2022 · 1 comment · Fixed by #2509
Labels
I-ICE Impact: makes Miri crash with some ICE

Comments

@saethlin
Copy link
Member

saethlin commented Aug 25, 2022

#2020 is back. This one is a bit spooky though, the combination of RUST_BACKTRACE=0 and -Zmiri-panic-on-unsupported is required. But we don't see a panic. So perhaps the panic is being caught and we're exiting the interpreter in a strange state?

╭ ➜ ben@archlinux:/tmp/smol-potat-1.1.2
╰ ➤ RUST_BACKTRACE=0 MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-panic-on-unsupported" cargo +miri miri test
Preparing a sysroot for Miri (target: x86_64-unknown-linux-gnu)... done
    Finished test [unoptimized + debuginfo] target(s) in 0.03s
     Running unittests src/lib.rs (target/miri/x86_64-unknown-linux-gnu/debug/deps/smol_potat-1908872ee5450113)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running tests/hygiene.rs (target/miri/x86_64-unknown-linux-gnu/debug/deps/hygiene-42b8ceeee13ed168)
warning: unused import: `::std::panic`
 --> tests/hygiene.rs:3:5
  |
3 | use ::std::panic;
  |     ^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default


running 1 test
test test ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: InterpErrorInfo(InterpErrorInfoInner { kind: Data race detected between Deallocate on thread `main` and Read on thread `async-io` at alloc65+0xf, backtrace: None })', src/eval.rs:378:36
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.65.0-nightly (e1b28cd2f 2022-08-19) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C linker=clang -C incremental -C link-arg=-fuse-ld=mold -Z miri-disable-isolation -Z miri-panic-on-unsupported

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
warning: 1 warning emitted

error: test failed, to rerun pass '--test hygiene'
╭ ➜ ben@archlinux:/tmp/futures-concurrency-3.0.2
╰ ➤ RUST_BACKTRACE=0 MIRIFLAGS="-Zmiri-panic-on-unsupported -Zmiri-disable-isolation" cargo +miri miri test
Preparing a sysroot for Miri (target: x86_64-unknown-linux-gnu)... done
    Finished test [unoptimized + debuginfo] target(s) in 0.01s
     Running unittests src/lib.rs (target/miri/x86_64-unknown-linux-gnu/debug/deps/futures_concurrency-1619211f71bea4c9)

running 5 tests
test merge::tuple::tests::merge_tuple_4 ... ok
test race::array::test::no_fairness ... ok
test race::tuple::test::no_fairness ... ok
test race::tuple::test::thruple ... ok
test race::vec::test::no_fairness ... ok

test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: InterpErrorInfo(InterpErrorInfoInner { kind: Data race detected between Deallocate on thread `main` and Read on thread `async-io` at alloc151+0xf, backtrace: None })', src/eval.rs:381:36
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.65.0-nightly (e1b28cd2f 2022-08-19) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C linker=clang -C incremental -C link-arg=-fuse-ld=mold -Z miri-panic-on-unsupported -Z miri-disable-isolation

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: test failed, to rerun pass '--lib'
miri 0.1.0 (d5853bc 2022-08-25)
@RalfJung
Copy link
Member

That's wild. I have removed the "disable data race detection during env cleanup" in favor of "just don't do env cleanup unless all threads have terminated", so I have no idea how there can be a race here...

Interesting observation: with RUST_BACKTRACE=1, it instead errors saying

error: the main thread terminated without waiting for all remaining threads

bors added a commit that referenced this issue Aug 26, 2022
fix data race error during env var cleanup

Fixes #2508
@RalfJung RalfJung added the I-ICE Impact: makes Miri crash with some ICE label Aug 26, 2022
bors added a commit that referenced this issue Aug 26, 2022
fix data race error during env var cleanup

Fixes #2508
@bors bors closed this as completed in 515038e Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Impact: makes Miri crash with some ICE
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants