Skip to content

rustc from homebrew produces SIGBUS: access to undefined memory when -v is provided #125350

@DrGo

Description

@DrGo

I tried this code:

use std::path::{Path,PathBuf};
use std::{env,fs}; 

//TODO
// read src folder into a vec
// convert to typst
// compile to pdf

fn main() ->Result<(), AppError>{
   println!("Hello, world!");
    Ok(())
}

cargo build -v

I expected to see this happen: explanation
code checked and compiled

Instead, this happened: explanation
crash only when -v is provided

Caused by:
  process didn't exit successfully: `CARGO=/opt/homebrew/Cellar/rust/1.78.0/bin/cargo CARGO_BIN_NAME=rst CARGO_CRATE_NAME=rst CARGO_MANIFEST_DIR=/Users/drgo/local/code/booker/rs CARGO_PKG_AUTHORS='' CARGO_PKG_DESCRIPTION='' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=rst CARGO_PKG_README='' CARGO_PKG_REPOSITORY='' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.1.0 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=1 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' CARGO_PRIMARY_PACKAGE=1 DYLD_FALLBACK_LIBRARY_PATH='/Users/drgo/local/code/booker/rs/target/debug/deps:/Users/drgo/lib:/usr/local/lib:/usr/lib' rustc --crate-name rst --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=98 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C metadata=a4aaf64bcde3c91c -C extra-filename=-a4aaf64bcde3c91c --out-dir /Users/drgo/local/code/booker/rs/target/debug/deps -C incremental=/Users/drgo/local/code/booker/rs/target/debug/incremental -L dependency=/Users/drgo/local/code/booker/rs/target/debug/deps` (exit status: 1)

Meta

rustc --version --verbose:

ustc 1.78.0 (9b00956e5 2024-04-29) (Homebrew)
binary: rustc
commit-hash: 9b00956e56009bab2aa15d7bff10916599e3d6d6
commit-date: 2024-04-29
host: aarch64-apple-darwin
release: 1.78.0
LLVM version: 18.1.4
Backtrace

backtrace is not produced probably because of the crash

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-discussionCategory: Discussion or questions that doesn't represent real issues.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions