-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-threadArea: `std::thread`Area: `std::thread`S-needs-infoStatus: The issue lacks details necessary to triage or act on it.Status: The issue lacks details necessary to triage or act on it.S-needs-reproStatus: This issue has no reproduction and needs a reproduction to make progress.Status: This issue has no reproduction and needs a reproduction to make progress.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
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
Metadata
Metadata
Assignees
Labels
A-threadArea: `std::thread`Area: `std::thread`S-needs-infoStatus: The issue lacks details necessary to triage or act on it.Status: The issue lacks details necessary to triage or act on it.S-needs-reproStatus: This issue has no reproduction and needs a reproduction to make progress.Status: This issue has no reproduction and needs a reproduction to make progress.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.