Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulate OOM for the try_oom_error test #138370

Merged
merged 1 commit into from
Mar 13, 2025
Merged

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Mar 11, 2025

We can create the expected error manually, rather than trying to produce
a real one, so the error conversion test can run on all targets. Before,
it was only running on 64-bit and not miri.

In Fedora, we also found that s390x was not getting the expected error,
"successfully" allocating the huge size because it was optimizing the
real malloc call away. It's possible to counter that by looking at the
pointer in any way, like a debug print, but it's more robust to just
deal with errors directly, since this test is only about conversion.

Related: #133806

We can create the expected error manually, rather than trying to produce
a real one, so the error conversion test can run on all targets. Before,
it was only running on 64-bit and not miri.

In Fedora, we also found that s390x was not getting the expected error,
"successfully" allocating the huge size because it was optimizing the
real `malloc` call away. It's possible to counter that by looking at the
pointer in any way, like a debug print, but it's more robust to just
deal with errors directly, since this test is only about conversion.
@rustbot
Copy link
Collaborator

rustbot commented Mar 11, 2025

r? @jhpratt

rustbot has assigned @jhpratt.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 11, 2025
@jhpratt
Copy link
Member

jhpratt commented Mar 13, 2025

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Mar 13, 2025

📌 Commit 53f488a has been approved by jhpratt

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 13, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 13, 2025
Simulate OOM for the `try_oom_error` test

We can create the expected error manually, rather than trying to produce
a real one, so the error conversion test can run on all targets. Before,
it was only running on 64-bit and not miri.

In Fedora, we also found that s390x was not getting the expected error,
"successfully" allocating the huge size because it was optimizing the
real `malloc` call away. It's possible to counter that by looking at the
pointer in any way, like a debug print, but it's more robust to just
deal with errors directly, since this test is only about conversion.

Related: rust-lang#133806
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 13, 2025
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#126856 (remove deprecated tool `rls`)
 - rust-lang#133981 (rustdoc-json: Refractor and document Id's)
 - rust-lang#136842 (Add libstd support for Trusty targets)
 - rust-lang#137355 (Implement `read_buf` and vectored read/write for SGX stdio)
 - rust-lang#137457 (fix for issue 132802: x86 code in `wasm32-unknown-unknown` binaries)
 - rust-lang#138162 (Update the standard library to Rust 2024)
 - rust-lang#138273 (metadata: Ignore sysroot when doing the manual native lib search in rustc)
 - rust-lang#138346 (naked functions: on windows emit `.endef` without the symbol name)
 - rust-lang#138370 (Simulate OOM for the `try_oom_error` test)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 13, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#126856 (remove deprecated tool `rls`)
 - rust-lang#133981 (rustdoc-json: Refractor and document Id's)
 - rust-lang#136842 (Add libstd support for Trusty targets)
 - rust-lang#137355 (Implement `read_buf` and vectored read/write for SGX stdio)
 - rust-lang#138162 (Update the standard library to Rust 2024)
 - rust-lang#138273 (metadata: Ignore sysroot when doing the manual native lib search in rustc)
 - rust-lang#138346 (naked functions: on windows emit `.endef` without the symbol name)
 - rust-lang#138370 (Simulate OOM for the `try_oom_error` test)

r? `@ghost`
`@rustbot` modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 13, 2025
Rollup merge of rust-lang#138370 - cuviper:try_oom_error, r=jhpratt

Simulate OOM for the `try_oom_error` test

We can create the expected error manually, rather than trying to produce
a real one, so the error conversion test can run on all targets. Before,
it was only running on 64-bit and not miri.

In Fedora, we also found that s390x was not getting the expected error,
"successfully" allocating the huge size because it was optimizing the
real `malloc` call away. It's possible to counter that by looking at the
pointer in any way, like a debug print, but it's more robust to just
deal with errors directly, since this test is only about conversion.

Related: rust-lang#133806
@bors bors merged commit 3bfce83 into rust-lang:master Mar 13, 2025
6 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Mar 13, 2025
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Mar 14, 2025
Simulate OOM for the `try_oom_error` test

We can create the expected error manually, rather than trying to produce
a real one, so the error conversion test can run on all targets. Before,
it was only running on 64-bit and not miri.

In Fedora, we also found that s390x was not getting the expected error,
"successfully" allocating the huge size because it was optimizing the
real `malloc` call away. It's possible to counter that by looking at the
pointer in any way, like a debug print, but it's more robust to just
deal with errors directly, since this test is only about conversion.

Related: rust-lang#133806
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants