Repository navigation
Conversation
|
Any special-casing of Miri in the standard library requires review. cc @rust-lang/miri |
|
r? @nia-e rustbot has assigned @nia-e. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Thanks! This was exactly the fix I had in mind. Let's see if CI passes @bors r+ rollup |
|
Interesting that miri just entirely ignores the stack size argument, even if it's impossibly large ^^ Not sure what could be done here on their side though, other than maybe enforce some max size. |
|
|
||
| // Test that a stack size too large to round up to the page size is an error. | ||
| #[cfg(all(unix, not(any(target_os = "espidf", target_os = "nuttx"))))] | ||
| #[cfg_attr(miri, ignore)] // Miri ignores the requested stack size |
There was a problem hiding this comment.
Please make this a FIXME that points to rust-lang/miri#5594
There was a problem hiding this comment.
FWIW in the future this should use #165117 but that's not been approved yet.
|
@bors r- |
|
This pull request was unapproved. |
| } | ||
|
|
||
| // Test that a stack size too large to round up to the page size is an error. | ||
| #[cfg(all(unix, not(any(target_os = "espidf", target_os = "nuttx"))))] |
There was a problem hiding this comment.
Can you also add a comment explaining that this mirrors the cfgs in the function while you're fixing ralf's? ^^
There was a problem hiding this comment.
I was about to comment something about the FIXME(https://github.com/rust-lang/miri/issues/5594): being too long, but apparently this is consistent with the rest of std 🫠
@bors r+ rollup
|
This pull request was unapproved due to being closed. |
|
@oli-obk can I reopen and approve this? The author got blocked, but I don't see a reason for me to open essentially the exact same PR |
|
Actually this can use the cfg flag from #165117 after it gets merged, ig i'll just do that tomorrow.. |
@maxdexh I'm the author of #165683. If you haven't started on it yet, I'd be happy to open the new PR. If you'd rather do it yourself, that's totally fine too. Just let me know so we don't duplicate work. |
|
@programskillforverification Feel free to, and assign me as reviewer with |
…hread-stack-size, r=maxdexh std: don't overflow when rounding up huge thread stack sizes on unix This is a resubmission of rust-lang#165703 by lazerg. Fixes rust-lang#165683 r? maxdexh
When
pthread_attr_setstacksizerejects the requested size, the unixThread::newrounds it up to the page size and tries again, but that rounding overflows for sizes close tousize::MAX. With overflow checks on this panics insidespawn, and without them the wrapped value only fails by luck. This useschecked_next_multiple_ofand returns the existing "invalid stack size" error when the rounding overflows.Fixes #165683