rust-lang / rust-lang/rust

Crash with hardend_malloc

Open
#153,829 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

C-discussion T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Problem

I use SecureBlue which utilitizes a hardend memory allocator by using LD_PRELOAD.

cargo build --release
error: process didn't exit successfully: `rustc -vV` (signal: 6, SIGABRT: process abort signal)
--- stderr
fatal allocator error: invalid uninitialized allocator usage
Steps
  1. Setup SecureBlue
  2. Remove target directory
  3. cargo build --release
  4. See error
Possible Solution(s)

It would be nice to allow using the hardend_malloc like many other programs already do.

Notes

https://github.com/secureblue/hardened_malloc

Usng 'LD_PRELOAD='' cargo' I could bypass it and fallback to the standard malloc. But I would like to utilize the hardend_malloc for security reasons.

Version
cargo 1.94.0 (Homebrew)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing cargo build --release under SecureBlue with its hardened allocator enabled, then inspect the reported rustc -vV abort and the effect of LD_PRELOAD. Determine which Rust toolchain component triggers the invalid uninitialized allocator usage; done means the release build works with the hardened allocator without bypassing it.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.