-
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 |
This is necessary due to rust-lang/cargo#14712
This is necessary due to rust-lang/cargo#14712
* feat: add models and error types for publicdb * fix(bridge-client): remove offset from wallet suffix * feat: add wrappers for operatordb * feat: use macros instead of fn for compile-time checks * feat: complete migrating all db traits to use models * docs(db): add docstrings where relevant * refactor(primitives): move functions around for cohesion * tests(db): add tests for sqlite impl * chore: update deps * chore(db): remove unused derivations * tests(primitives): add tests for deposit * refactor: replace custom BitcoinD impl with corepc-node * refactor(tx-graph): make connectors and txs pure * security: update url to resolve vulnerability in idna https://rustsec.org/advisories/RUSTSEC-2024-0421 * feat: use main branch of strata in deps * chore: apply fixes from clippy * chore: update rust-nightly to latest working version * feat: update sp1 deps to v4 * style: format files * chore: run codespell * meta: update PR template * fix(ci): skip guest build in clippy * refactor(duty-tracker): rename bridge_out to withdrawal_fufillment Also add logs * fix(tests): update data for bridge-proof * fix(bridge-proof): remove unused import * feat(ci): enable RUST_BACKTRACE in tests * fix(ci): update toolchain to match rust-toolchain.toml This is necessary due to rust-lang/cargo#14712 * revert: use nightly 1.82 * chore(primitives): fix lint issues * fix(btcio): run tests in separate tokio runtime * meta: update rustc version * feat(ci): add codecov config * refactor(ci): enable and keep only relevant workflows * docs: fix docs links * refactor: only keep relevant modules and group related ones together * docs(tx-graph): document public items * chore: apply lint fixes * fix(ci): run db migration before docs * refactor(connectors): make leaves more ergonomic and add tests for c0 and a30 * fix(tests): actually run btc client tests * refactor(tx-graph): use named fields in ConnectorA31 * chore: fix lint issues * chore(tx-graph): remove unused crates * ci: run only one test at a time * ci: re-enable parallel tests * tests(btcio)!: disable client tests in CI for now This test fails in CI due to an excessive memory allocation bug. * feat(tests): add test-data * feat(bridge-proof): add mock feature and skip verifier script gen when enabled * feat(btcio): add types for gettxout * tests(tx-graph): add unit test for tx-graph till payout * ci: run unit tests with mock * chore: update sp1 to 4.0.0 and replace tx-parser with l1tx * fix(bridge-guest): update elf path * style: format toml files * chore: update strata * refactor(tx-graph): convert witness parsing functions to fallible ones * tests(tx-graph): add test for disprove on public input commitments * chore(Makefile): remove sec recipe from pr * fix(Makefile): remove functional test recipe * ci: add zizmor * ci: use action to show audit status as PR comment * ci: set persist-credentials on checkout to false * ci: install uvenv manually instead of using astral-sh * chore(proof-utils): remove unnecessary deps * ci: run zizmor directly * ci: allow security workflow to post pr comments * fix(ci): address issues reported by zizmor * fix(ci): resolve shellcheck issues * tests(tx-graph): check assert data tx weights * chore: add build and codecov flags to Readme
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: