-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
"memory allocation of .. bytes failed" appears when using cargo run test
to run specific test name
#14712
Comments
I wasn't able to reproduce. Unsure what the difference is. |
The RAM size is critical.
I reproduced it on a machine with 4 GiB RAM.
Testing other combinations:
So it looks like the requirements are
to trigger a core dump. I may investigate it more when having time. At least we need to be sure that it is really an edge case for cargo itself. |
Did a Labeled as low priority though feel free to help debug it! |
I got hit by this bug when running Edit: doing a |
I encountered this problem recently. And I did |
It does help if you have more than 63063237072 bytes available in your RAM 😆. Since there is a non Cargo project affected, I removed the |
I compiled master Cargo (e75214e) with
Backtrace
It was this dep info file cargo/src/cargo/core/compiler/fingerprint/mod.rs Line 2259 in e75214e
As a result, Cargo then wrongly decoded cargo/src/cargo/core/compiler/fingerprint/mod.rs Lines 2271 to 2273 in e75214e
Feel like decoding a bool also for old dep-info is too fragile, though I may not be available in the next few hours to come up with a fix. |
@AlexTMjugador would you mind sharing steps to reproduce? Like which version of Cargo you used for the first build, and which cargo you use that encountered a core-dumped. I have a hacky fix at hand, but unsure if it is worthy. Fingerprints generally are not shared between different toolchains. Unless you manually build cargo or have a pretty specialized toolchain setup, I still feel like normal users won't be bitten by this. |
Sure! Please find the exact steps to reproduce this issue attached below. To ensure a clean and consistent environment, I used a temporary Docker container based on the Terminal session of reproduction steps
|
docs(fingerprint): document the encoding of Cargo's depinfo ### What does this PR try to resolve? When investigating #14712, I figured that it lacks of docs for the Cargo's depinfo format. Hence documenting them. This PR also move dep info files related items to a separate module. ### How should we test and review this PR? No behavior change, though I may submit a hack of #14712 after this. I didn't move dep-info specific documentation into that new module. It feels more nature for keeping them all in the fingerprint module.
Thanks @AlexTMjugador for the reproduction! It was really helpful :) Confirmed that this issue is an incompatibility bug introduced by The way it happened to Cargo itself is obvious: For the PackSquash repo, it is a bit subtle. The reproduction uses two different nightly versions. Cargo passes BTW, the first bad dep-info files in PackSquash is |
Problem
cargo run test
shows "memory allocation of .. bytes failed" when I run specific test case:I expect there are no issues when I use
cargo run test
to run the tests.Steps
rustup update
to update needed tools to buildcargo
cargo
repositorycd
intocargo
repositorymaster
branchcargo check --workspace
cargo build
cargo run test source_replacement
here is the test video that contains step.5 to step.7 for the reference: 20241021_cargo_test_video.zip
Possible Solution(s)
No response
Notes
The error message in this issue is similar to #7543
Version
cargo 1.84.0 (edd36eb 2024-10-21)
release: 1.84.0
commit-hash: edd36eb
commit-date: 2024-10-21
host: x86_64-unknown-linux-gnu
libgit2: 1.8.1 (sys:0.19.0 vendored)
libcurl: 8.5.0 (sys:0.4.74+curl-8.9.0 system ssl:OpenSSL/3.0.13)
os: Ubuntu 24.4.0 (noble) [64-bit]
additional hardware information of test machine:
Memory: 16 GB
The text was updated successfully, but these errors were encountered: