rust-lang / cargo

The Rust package manager
https://doc.rust-lang.org/cargo
Apache License 2.0
12.76k stars 2.42k forks source link

cargo build crashed at MacOS Big Sur with malloc failed error #12324

Closed hxiaodon closed 1 year ago

hxiaodon commented 1 year ago

Problem

When I try building some rust project at my laptop(Mac OS 11.7.8),such as databend or bevy, the cargo tool will crash with the following messages

hxiaodon@bogon databend % make build
bash ./scripts/build/build-debug.sh
Build(DEBUG) start...
    Updating crates.io index
cargo(5971,0x108fd7e00) malloc: *** error for object 0x6767486278562000: pointer being freed was not allocated                  
cargo(5971,0x108fd7e00) malloc: *** set a breakpoint in malloc_error_break to debug
./scripts/build/build-debug.sh: line 11:  5971 Abort trap: 6           cargo build --bin=databend-query --bin=databend-meta --bin=databend-metactl --bin=open-sharing --bin=databend-query-oss --bin=databend-meta-oss
make: *** [build] Error 134

My Macbook pro's model is the Retina, 15-inch, Mid 2014 and the highest MacOS supported version is Big Sur, so I have no other choices to solve this crash problem by upgrading system

Any suggestions for my issue? Thanks!

Steps

  1. Prepare a Macbook which has installed the MacOS BigSur.
  2. Deploy the rustup toolchain on this macbook
  3. Download and build the databend project

Then what you will see is

hxiaodon@bogon databend % make build
bash ./scripts/build/build-debug.sh
Build(DEBUG) start...
    Updating crates.io index
cargo(5971,0x108fd7e00) malloc: *** error for object 0x6767486278562000: pointer being freed was not allocated                  
cargo(5971,0x108fd7e00) malloc: *** set a breakpoint in malloc_error_break to debug
./scripts/build/build-debug.sh: line 11:  5971 Abort trap: 6           cargo build --bin=databend-query --bin=databend-meta --bin=databend-metactl --bin=open-sharing --bin=databend-query-oss --bin=databend-meta-oss
make: *** [build] Error 134

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.72.0-nightly (b0fa79679 2023-06-03)

weihanglo commented 1 year ago

Could you provide the detailed version via the output of cargo -vV? Thanks!

hxiaodon commented 1 year ago

Could you provide the detailed version via the output of cargo -vV? Thanks!

Hi,below is the output

hxiaodon@bogon databend % cargo build -vv
  Downloaded proc-macro-hack v0.5.20+deprecated
  Downloaded float_eq v1.0.1
  Downloaded form_urlencoded v1.1.0
  Downloaded fixedbitset v0.4.2
  Downloaded futures-io v0.3.28
  Downloaded futures-executor v0.3.28
  Downloaded fnv v1.0.7
  Downloaded futures v0.3.28
  Downloaded fs-err v2.9.0
  Downloaded frunk_proc_macros v0.1.1
  Downloaded futures-macro v0.3.28
  Downloaded findshlibs v0.10.2
  Downloaded geo-types v0.7.9
  Downloaded fs2 v0.4.3
  Downloaded foreign_vec v0.1.0
  Downloaded flate2 v1.0.25
  Downloaded fastrand v1.9.0
  Downloaded futures-core v0.3.28
  Downloaded getrandom v0.2.8
  Downloaded frunk_core v0.4.1
  Downloaded getopts v0.2.21
  Downloaded generic-array v0.14.6
  Downloaded gix-config-value v0.10.1
  Downloaded gix-chunk v0.4.1
  Downloaded gix-diff v0.28.0
  Downloaded geographiclib-rs v0.2.3
  Downloaded gix-traverse v0.24.0
  Downloaded gix-diff v0.26.3
  Downloaded gix-lock v3.0.2
  Downloaded gix-date v0.4.3
  Downloaded gix-lock v5.0.0
  Downloaded gix-features v0.28.1
  Downloaded gix-traverse v0.22.2
  Downloaded gix-revision v0.10.4
  Downloaded gix-refspec v0.7.3
  Downloaded glob v0.3.1
  Downloaded gix-sec v0.6.2
  Downloaded gix-discover v0.16.0
  Downloaded filetime v0.2.20
  Downloaded gix-validate v0.7.3
  Downloaded gix-quote v0.4.3
  Downloaded gix-index v0.15.0
  Downloaded futures-lite v1.12.0
  Downloaded gix-bitmap v0.2.2
  Downloaded gix-hash v0.10.3
  Downloaded gix-credentials v0.12.0
  Downloaded gix-object v0.26.4
  Downloaded gix-credentials v0.9.2
  Downloaded gix-hashtable v0.1.2
  Downloaded gix-ref v0.27.1
  Downloaded gix-refspec v0.9.0
  Downloaded gix-odb v0.43.0
  Downloaded futures-util v0.3.28
  Downloaded globiter v0.1.0
  Downloaded gix-attributes v0.8.3
  Downloaded gix-glob v0.5.5
  Downloaded geo v0.24.0
  Downloaded gix-odb v0.40.2
  Downloaded gix-pack v0.30.3
  Downloaded gix v0.42.0
  Downloaded gix-index v0.12.4
  Downloaded geohash v0.13.0
  Downloaded gix-tempfile v5.0.1
  Downloaded frunk v0.4.1
  Downloaded futures-sink v0.3.28
  Downloaded frunk_derives v0.4.1
  Downloaded gix-url v0.16.0
  Downloaded gix-actor v0.19.0
  Downloaded ff v0.12.1
  Downloaded gix-prompt v0.3.2
  Downloaded gix-worktree v0.12.3
  Downloaded frunk_proc_macro_helpers v0.1.1
  Downloaded gix-command v0.2.4
  Downloaded gix-tempfile v3.0.2
  Downloaded gix-features v0.26.5
  Downloaded funty v2.0.0
  Downloaded group v0.12.1
  Downloaded gix-mailmap v0.11.0
  Downloaded gix-attributes v0.10.0
  Downloaded gix-actor v0.17.2
  Downloaded futures-channel v0.3.28
  Downloaded float_next_after v1.0.0
  Downloaded ghost v0.1.8
  Downloaded flagset v0.4.3
  Downloaded gix-revision v0.12.0
  Downloaded flatbuffers v23.1.21
  Downloaded getrandom v0.1.16
  Downloaded futures-task v0.3.28
  Downloaded gix-object v0.28.0
  Downloaded gix-mailmap v0.9.3
  Downloaded gix-config v0.16.3
  Downloaded gix-path v0.7.2
  Downloaded ff v0.13.0
  Downloaded frunk_proc_macros_impl v0.1.1
  Downloaded gix-url v0.13.3
  Downloaded gix-ref v0.24.1
  Downloaded gix-pack v0.33.1
  Downloaded gix-config v0.19.0
  Downloaded gix-discover v0.13.1
  Downloaded gix v0.36.1
  Downloaded gimli v0.27.3
warning: spurious network error (3 tries remaining): [35] SSL connect error (LibreSSL SSL_connect: SSL_ERROR_ZERO_RETURN in connection to crates.io:443 )
  Downloaded group v0.13.0
  Downloaded minimal-lexical v0.2.1
cargo(7934,0x111292e00) malloc: *** error for object 0x7fc4588a82c8: pointer being freed was not allocated
cargo(7934,0x111292e00) malloc: *** set a breakpoint in malloc_error_break to debug
hxiaodon commented 1 year ago

This issue seems disappeared after cleaning the git and cargo's http.proxy setting. I will keep an eye on it, thanks!

hxiaodon commented 1 year ago

Close this issue temporarily since my scenario is not a common case for others