Skip to content

Miscompilation of std::thread::scope on x86_64 with llvm sysroot #1395

Closed
bytecodealliance/wasmtime
#7325
@bjorn3

Description

@bjorn3
fn main() {
    std::thread::scope(|s| {
        s.spawn(|| {});
    });
}
$ ./y.sh build --sysroot llvm
$ dist/bin/rustc-clif foo.rs
$ RUST_BACKTRACE=1 ./foo
thread 'main' panicked at foo.rs:2:5:
a scoped thread panicked
stack backtrace:
   0: rust_begin_unwind
             at /rustc/65ea825f4021eaf77f1b25139969712d65b435a4/library/std/src/panicking.rs:619:5
   1: core::panicking::panic_fmt
             at /rustc/65ea825f4021eaf77f1b25139969712d65b435a4/library/core/src/panicking.rs:72:14
   2: std::thread::scoped::scope
   3: foo::main
   4: core::ops::function::FnOnce::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Aborted (core dumped)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-x86_64Target: x64 processors

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions