Open
Description
I tried this code:
std::thread::spawn(move || {
.....
})
I expected to see this happen: spawn new thread
Instead, this happened:
thread 'main' panicked at /work/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:729:29:
failed to spawn thread: Os { code: 22, kind: InvalidInput, message: "Invalid argument" }
Upon further investigation using strace, it appears that the clone system call is being made with an invalid argument. Specifically, the parent_tid parameter is being passed as a pointer to tid, which seems to be incorrect.
Meta
rustc --version --verbose
:
binary: rustc
commit-hash: 30f168ef811aec63124eac677e14699baa9395bd
commit-date: 2025-03-05
host: x86_64-unknown-linux-gnu
release: 1.87.0-nightly
LLVM version: 20.1.0