Closed
Description
Problem
cargo crash when I change registry in ~/.cargo/config
OS: CentOS Linux release 7.3.1611 (Core)
By the way my machine use proxy to connect Internet.
*** Error in `/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo': double free or corruption (!prev): 0x00007fb9ac2c1880 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7c503)[0x7fb9a94a5503]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo(+0x8cd806)[0x7fb9aae19806]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo(+0x8cd69e)[0x7fb9aae1969e]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo(+0x8e22f7)[0x7fb9aae2e2f7]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo(+0x8bef04)[0x7fb9aae0af04]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo(_ZN5cargo3ops7resolve20resolve_ws_with_opts17h01d5332c4f804ec9E+0x666)[0x7fb9aaaba306]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo(_ZN5cargo3ops13cargo_compile10create_bcx17h79470c5de3e513acE+0x393)[0x7fb9aa9fe093]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo(_ZN5cargo3ops13cargo_compile10compile_ws17hc05b461b8c8955ecE+0x8e)[0x7fb9aa9fd2ce]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo(_ZN5cargo3ops13cargo_compile7compile17ha79b172fff332ebeE+0x96)[0x7fb9aa9fd206]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo(+0x1ed7a1)[0x7fb9aa7397a1]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo(+0x1c60a0)[0x7fb9aa7120a0]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo(+0x1eede5)[0x7fb9aa73ade5]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo(+0x1b7203)[0x7fb9aa703203]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo(+0x1e7569)[0x7fb9aa733569]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo(_ZN3std2rt19lang_start_internal17hdd488b91dc742b96E+0x30a)[0x7fb9ab0447fa]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo(+0x1f0fd2)[0x7fb9aa73cfd2]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7fb9a944ab35]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo(+0x178f01)[0x7fb9aa6c4f01]
======= Memory map: ========
7fb9a4000000-7fb9a4021000 rw-p 00000000 00:00 0
7fb9a4021000-7fb9a8000000 ---p 00000000 00:00 0
7fb9a9429000-7fb9a95df000 r-xp 00000000 fd:01 25202154 /usr/lib64/libc-2.17.so
7fb9a95df000-7fb9a97df000 ---p 001b6000 fd:01 25202154 /usr/lib64/libc-2.17.so
7fb9a97df000-7fb9a97e3000 r--p 001b6000 fd:01 25202154 /usr/lib64/libc-2.17.so
7fb9a97e3000-7fb9a97e5000 rw-p 001ba000 fd:01 25202154 /usr/lib64/libc-2.17.so
7fb9a97e5000-7fb9a97ea000 rw-p 00000000 00:00 0
7fb9a97ea000-7fb9a97ec000 r-xp 00000000 fd:01 25202160 /usr/lib64/libdl-2.17.so
7fb9a97ec000-7fb9a99ec000 ---p 00002000 fd:01 25202160 /usr/lib64/libdl-2.17.so
7fb9a99ec000-7fb9a99ed000 r--p 00002000 fd:01 25202160 /usr/lib64/libdl-2.17.so
7fb9a99ed000-7fb9a99ee000 rw-p 00003000 fd:01 25202160 /usr/lib64/libdl-2.17.so
7fb9a99ee000-7fb9a9aee000 r-xp 00000000 fd:01 25202162 /usr/lib64/libm-2.17.so
7fb9a9aee000-7fb9a9cee000 ---p 00100000 fd:01 25202162 /usr/lib64/libm-2.17.so
7fb9a9cee000-7fb9a9cef000 r--p 00100000 fd:01 25202162 /usr/lib64/libm-2.17.so
7fb9a9cef000-7fb9a9cf0000 rw-p 00101000 fd:01 25202162 /usr/lib64/libm-2.17.so
7fb9a9cf0000-7fb9a9d07000 r-xp 00000000 fd:01 25202181 /usr/lib64/libpthread-2.17.so
7fb9a9d07000-7fb9a9f06000 ---p 00017000 fd:01 25202181 /usr/lib64/libpthread-2.17.so
7fb9a9f06000-7fb9a9f07000 r--p 00016000 fd:01 25202181 /usr/lib64/libpthread-2.17.so
7fb9a9f07000-7fb9a9f08000 rw-p 00017000 fd:01 25202181 /usr/lib64/libpthread-2.17.so
7fb9a9f08000-7fb9a9f0c000 rw-p 00000000 00:00 0
7fb9a9f0c000-7fb9a9f13000 r-xp 00000000 fd:01 25202185 /usr/lib64/librt-2.17.so
7fb9a9f13000-7fb9aa112000 ---p 00007000 fd:01 25202185 /usr/lib64/librt-2.17.so
7fb9aa112000-7fb9aa113000 r--p 00006000 fd:01 25202185 /usr/lib64/librt-2.17.so
7fb9aa113000-7fb9aa114000 rw-p 00007000 fd:01 25202185 /usr/lib64/librt-2.17.so
7fb9aa114000-7fb9aa129000 r-xp 00000000 fd:01 25301469 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7fb9aa129000-7fb9aa328000 ---p 00015000 fd:01 25301469 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7fb9aa328000-7fb9aa329000 r--p 00014000 fd:01 25301469 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7fb9aa329000-7fb9aa32a000 rw-p 00015000 fd:01 25301469 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7fb9aa32a000-7fb9aa34a000 r-xp 00000000 fd:01 25202147 /usr/lib64/ld-2.17.so
7fb9aa537000-7fb9aa53c000 rw-p 00000000 00:00 0
7fb9aa543000-7fb9aa544000 rw-p 00000000 00:00 0
7fb9aa544000-7fb9aa545000 r--s 00000000 00:04 458753 /SYSV00000072 (deleted)
7fb9aa545000-7fb9aa546000 ---p 00000000 00:00 0
7fb9aa546000-7fb9aa549000 rw-p 00000000 00:00 0
7fb9aa549000-7fb9aa54a000 r--p 0001f000 fd:01 25202147 /usr/lib64/ld-2.17.so
7fb9aa54a000-7fb9aa54b000 rw-p 00020000 fd:01 25202147 /usr/lib64/ld-2.17.so
7fb9aa54b000-7fb9aa54c000 rw-p 00000000 00:00 0
7fb9aa54c000-7fb9ab367000 r-xp 00000000 fd:01 142727009 /root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo
7fb9ab566000-7fb9ab60c000 r--p 00e1a000 fd:01 142727009 /root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo
7fb9ab60c000-7fb9ab614000 rw-p 00ec0000 fd:01 142727009 /root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo
7fb9ab614000-7fb9ab619000 rw-p 00000000 00:00 0
7fb9ac1bc000-7fb9ac46b000 rw-p 00000000 00:00 0 [heap]
7ffc7e06f000-7ffc7e090000 rw-p 00000000 00:00 0 [stack]
7ffc7e0a1000-7ffc7e0a3000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Aborted
Steps
- Install rust toolchain by rustup-init.sh
- Change ~/.cargo/config to:
[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = 'ustc'
[source.ustc]
registry = "https://mirrors.ustc.edu.cn/crates.io-index/"
- Create a new project by cargo new
- Add some dependencies in the new project Cargo.toml file:
[package]
name = "hello"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
serde = { version = "1.0.118" }
- Run cargo build in the new project path then cargo crash after Updating index and Downloading message
- Comment out "replace-with = 'ustc'" in ~/.cargo/config then retry cargo build, it has no preblem
Possible Solution(s)
No response
Notes
Using the same ~/.cargo/config in my other machine which use different networks is OK.
Version
cargo 1.56.0 (4ed5d137b 2021-10-04)
release: 1.56.0
commit-hash: 4ed5d137baff5eccf1bae5a7b2ae4b57efad4a7d
commit-date: 2021-10-04