about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2025-08-15 16:03:55 +0200
committerGitHub <noreply@github.com>2025-08-15 16:03:55 +0200
commita676c4891e14d30a5d28aba3edf72d54fb2103f7 (patch)
tree47d5c91fafbecaec50eef0762a431d5d4187461b /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parentba412a6e70ac84641be7764d088acabd0eb3fa39 (diff)
parent5d01d90ad617349109db79cb9980267fd294d735 (diff)
downloadrust-a676c4891e14d30a5d28aba3edf72d54fb2103f7.tar.gz
rust-a676c4891e14d30a5d28aba3edf72d54fb2103f7.zip
Rollup merge of #144210 - Gelbpunkt:thread-stack-size-musl, r=jhpratt
std: thread: Return error if setting thread stack size fails

Currently, when setting the thread stack size fails, it would be rounded up to the nearest multiple of the page size and the code asserts that the next call to `pthread_attr_setstacksize` succeeds.

This may be true for glibc, but it isn't true for musl, which not only enforces a minimum stack size, but also a maximum stack size of `usize::MAX / 4 - PTHREAD_STACK_MIN` [1], triggering the assert rather than erroring gracefully.

There isn't any way to handle this properly other than bailing out and letting the user know it didn't succeed.

[1]: https://git.musl-libc.org/cgit/musl/tree/src/thread/pthread_attr_setstacksize.c#n5
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions