Skip to content

"memory allocation of .. bytes failed" appears when using cargo run test to run specific test name #14712

Closed
@chentodd

Description

@chentodd

Problem

cargo run test shows "memory allocation of .. bytes failed" when I run specific test case:

Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.20s
     Running `target/debug/cargo test source_replacement`
memory allocation of 63063237072 bytes failed
Aborted (core dumped)

I expect there are no issues when I use cargo run test to run the tests.

Steps

  1. Run rustup update to update needed tools to build cargo
  2. Clone cargo repository
  3. cd into cargo repository
  4. Change to master branch
  5. Run cargo check --workspace
  6. Run cargo build
  7. Run 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

Metadata

Metadata

Assignees

Labels

A-dep-infoArea: dep-info, .d filesC-bugCategory: bugS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Z-checksum-freshnessNightly: rebuild detection on file checksum instead of mtimeregression-from-stable-to-nightlyRegression in nightly that previously worked in stable.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions