Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: rustup is not installed at '/home/n/.cargo' #691

Closed
lilith opened this issue Aug 26, 2016 · 9 comments
Closed

error: rustup is not installed at '/home/n/.cargo' #691

lilith opened this issue Aug 26, 2016 · 9 comments
Labels

Comments

@lilith
Copy link

lilith commented Aug 26, 2016

I haven't touched this box for a few weeks. I came back, and (forgetting I already installed rustup), tried

curl https://sh.rustup.rs -sSf | sh

This produces

n@nathanael-xeon:~/Documents$ curl https://sh.rustup.rs -sSf | sh
info: downloading installer
Segmentation fault (core dumped)
rustup: command failed: /tmp/tmp.UWJtLBWTNB/rustup-init

I check my system versions and info:

n@nathanael-xeon:~/Documents$ rustc -V
rustc 1.11.0 (9b21dcd6a 2016-08-15)
n@nathanael-xeon:~/Documents$ cargo -V
cargo 0.12.0-nightly (6b98d1f 2016-07-04)
n@nathanael-xeon:~/Documents$ rustup -V
rustup 0.1.12 (c6e430a 2016-05-12)
n@nathanael-xeon:~/Documents$ uname -a
Linux nathanael-xeon 3.19.0-66-generic #74~14.04.1-Ubuntu SMP Tue Jul 19 19:56:11 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Let me try using my existing rustup installation

n@nathanael-xeon:~/Documents$ rustup self update
error: rustup is not installed at '/home/n/.cargo'
n@nathanael-xeon:~/Documents$ rustup self uninstall
error: rustup is not installed at '/home/n/.cargo'
n@nathanael-xeon:~/Documents$ rustup update
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: downloading component 'rustc'
 43.3 MiB /  43.3 MiB (100 %)   2.8 MiB/s ETA:   0 s                
info: downloading component 'rust-std'
 55.8 MiB /  55.8 MiB (100 %)   2.9 MiB/s ETA:   0 s                
info: downloading component 'rust-docs'
  7.2 MiB /   7.2 MiB (100 %)   2.7 MiB/s ETA:   0 s                
info: downloading component 'cargo'
  4.1 MiB /   4.1 MiB (100 %)   2.6 MiB/s ETA:   0 s                
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'rust-docs'
info: installing component 'cargo'
error: rustup is not installed at '/home/n/.cargo'

Hmm. Before I attempt to wipe everything away, is there any detail I should preserve (if this is worth fixing)?

I did note that 'multirust' is not present:

n@nathanael-xeon:~/Documents$ ls -R ~/.cargo/bin
cargo  racer  rustc  rustdoc  rust-gdb  rust-lldb  rustup

At one time, I used multirust, but I rid myself of it and got a working rustup installation (or, at one time, so I believed. Rust 1.8 is working, so...)

EDIT: It looks like ~/.multirust was still hanging around. Renaming the folder did nothing. It's ~89MB compressed, if it would help.

Deleting the folder did something.

Before deletion:

n@nathanael-xeon:~/Documents$ which rustc
/home/n/.cargo/bin/rustc
n@nathanael-xeon:~/Documents$ rustc -V
rustc 1.11.0 (9b21dcd6a 2016-08-15)

After:

n@nathanael-xeon:~/Documents$ rustc -V
error: no default toolchain configured

And it would appear that ~/.multirust/version keeps getting recreated with the contents 12.

/usr/local/lib/rustlib/uninstall.sh doesn't exist, so I'm not sure how to complete the exorcism.

@lilith
Copy link
Author

lilith commented Aug 26, 2016

I tried renaming ~/.cargo, but rustup still segfaults.

@lilith
Copy link
Author

lilith commented Aug 26, 2016

Running valgrind produces some interesting uninitialized writes (strange valgrind worked, given jemalloc supposedly dropped support for it)!

n@nathanael-xeon:~/Documents$ valgrind --track-origins=yes /tmp/tmp.5q7Y0SpOko/rustup-init 
==12220== Memcheck, a memory error detector
==12220== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==12220== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==12220== Command: /tmp/tmp.5q7Y0SpOko/rustup-init
==12220== 
==12220== Conditional jump or move depends on uninitialised value(s)
==12220==    at 0x5656BD: std::path::Path::exists::h7a4153731a96a583 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1E6FB4: rustup_init::main::he9ea588d309e0baa (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x57B606: __rust_maybe_catch_panic (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x572292: std::rt::lang_start::h352a66f5026f54bd (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x56AAF44: (below main) (libc-start.c:287)
==12220==  Uninitialised value was created by a stack allocation
==12220==    at 0x56552F: std::path::Path::exists::h7a4153731a96a583 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220== 
==12220== Conditional jump or move depends on uninitialised value(s)
==12220==    at 0x5656BD: std::path::Path::exists::h7a4153731a96a583 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1D48CA: rustup_init::self_update::install::h5c8318effea204c9 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1E80EC: rustup_init::main::he9ea588d309e0baa (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x57B606: __rust_maybe_catch_panic (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x572292: std::rt::lang_start::h352a66f5026f54bd (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x56AAF44: (below main) (libc-start.c:287)
==12220==  Uninitialised value was created by a stack allocation
==12220==    at 0x56552F: std::path::Path::exists::h7a4153731a96a583 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220== 
==12220== Conditional jump or move depends on uninitialised value(s)
==12220==    at 0x5656BD: std::path::Path::exists::h7a4153731a96a583 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1D4908: rustup_init::self_update::install::h5c8318effea204c9 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1E80EC: rustup_init::main::he9ea588d309e0baa (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x57B606: __rust_maybe_catch_panic (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x572292: std::rt::lang_start::h352a66f5026f54bd (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x56AAF44: (below main) (libc-start.c:287)
==12220==  Uninitialised value was created by a stack allocation
==12220==    at 0x56552F: std::path::Path::exists::h7a4153731a96a583 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220== 
==12220== Conditional jump or move depends on uninitialised value(s)
==12220==    at 0x5656BD: std::path::Path::exists::h7a4153731a96a583 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1D496E: rustup_init::self_update::install::h5c8318effea204c9 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1E80EC: rustup_init::main::he9ea588d309e0baa (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x57B606: __rust_maybe_catch_panic (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x572292: std::rt::lang_start::h352a66f5026f54bd (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x56AAF44: (below main) (libc-start.c:287)
==12220==  Uninitialised value was created by a stack allocation
==12220==    at 0x56552F: std::path::Path::exists::h7a4153731a96a583 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220== 
==12220== Conditional jump or move depends on uninitialised value(s)
==12220==    at 0x1DA43A: rustup_init::self_update::do_anti_sudo_check::home_mismatch::heb4fde5439976c13 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1D58B0: rustup_init::self_update::install::h5c8318effea204c9 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1E80EC: rustup_init::main::he9ea588d309e0baa (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x57B606: __rust_maybe_catch_panic (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x572292: std::rt::lang_start::h352a66f5026f54bd (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x56AAF44: (below main) (libc-start.c:287)
==12220==  Uninitialised value was created by a stack allocation
==12220==    at 0x1DA3CA: rustup_init::self_update::do_anti_sudo_check::home_mismatch::heb4fde5439976c13 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220== 
==12220== Conditional jump or move depends on uninitialised value(s)
==12220==    at 0x1DA449: rustup_init::self_update::do_anti_sudo_check::home_mismatch::heb4fde5439976c13 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1D58B0: rustup_init::self_update::install::h5c8318effea204c9 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1E80EC: rustup_init::main::he9ea588d309e0baa (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x57B606: __rust_maybe_catch_panic (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x572292: std::rt::lang_start::h352a66f5026f54bd (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x56AAF44: (below main) (libc-start.c:287)
==12220==  Uninitialised value was created by a stack allocation
==12220==    at 0x1DA3CA: rustup_init::self_update::do_anti_sudo_check::home_mismatch::heb4fde5439976c13 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220== 
==12220== Conditional jump or move depends on uninitialised value(s)
==12220==    at 0x584064: sdallocx (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1DA457: rustup_init::self_update::do_anti_sudo_check::home_mismatch::heb4fde5439976c13 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1D58B0: rustup_init::self_update::install::h5c8318effea204c9 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1E80EC: rustup_init::main::he9ea588d309e0baa (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x57B606: __rust_maybe_catch_panic (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x572292: std::rt::lang_start::h352a66f5026f54bd (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x56AAF44: (below main) (libc-start.c:287)
==12220==  Uninitialised value was created by a stack allocation
==12220==    at 0x1DA3CA: rustup_init::self_update::do_anti_sudo_check::home_mismatch::heb4fde5439976c13 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220== 
==12220== Conditional jump or move depends on uninitialised value(s)
==12220==    at 0x58455B: sdallocx (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1DA457: rustup_init::self_update::do_anti_sudo_check::home_mismatch::heb4fde5439976c13 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1D58B0: rustup_init::self_update::install::h5c8318effea204c9 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1E80EC: rustup_init::main::he9ea588d309e0baa (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x57B606: __rust_maybe_catch_panic (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x572292: std::rt::lang_start::h352a66f5026f54bd (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x56AAF44: (below main) (libc-start.c:287)
==12220==  Uninitialised value was created by a stack allocation
==12220==    at 0x1DA3CA: rustup_init::self_update::do_anti_sudo_check::home_mismatch::heb4fde5439976c13 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220== 
==12220== Conditional jump or move depends on uninitialised value(s)
==12220==    at 0x584576: sdallocx (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1DA457: rustup_init::self_update::do_anti_sudo_check::home_mismatch::heb4fde5439976c13 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1D58B0: rustup_init::self_update::install::h5c8318effea204c9 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1E80EC: rustup_init::main::he9ea588d309e0baa (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x57B606: __rust_maybe_catch_panic (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x572292: std::rt::lang_start::h352a66f5026f54bd (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x56AAF44: (below main) (libc-start.c:287)
==12220==  Uninitialised value was created by a stack allocation
==12220==    at 0x1DA3CA: rustup_init::self_update::do_anti_sudo_check::home_mismatch::heb4fde5439976c13 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220== 
==12220== Invalid read of size 8
==12220==    at 0x59D417: je_huge_dalloc (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1DA457: rustup_init::self_update::do_anti_sudo_check::home_mismatch::heb4fde5439976c13 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1D58B0: rustup_init::self_update::install::h5c8318effea204c9 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1E80EC: rustup_init::main::he9ea588d309e0baa (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x57B606: __rust_maybe_catch_panic (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x572292: std::rt::lang_start::h352a66f5026f54bd (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x56AAF44: (below main) (libc-start.c:287)
==12220==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==12220== 
==12220== 
==12220== Process terminating with default action of signal 11 (SIGSEGV)
==12220==  Access not within mapped region at address 0x0
==12220==    at 0x59D417: je_huge_dalloc (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1DA457: rustup_init::self_update::do_anti_sudo_check::home_mismatch::heb4fde5439976c13 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1D58B0: rustup_init::self_update::install::h5c8318effea204c9 (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x1E80EC: rustup_init::main::he9ea588d309e0baa (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x57B606: __rust_maybe_catch_panic (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x572292: std::rt::lang_start::h352a66f5026f54bd (in /tmp/tmp.5q7Y0SpOko/rustup-init)
==12220==    by 0x56AAF44: (below main) (libc-start.c:287)

@lilith
Copy link
Author

lilith commented Aug 26, 2016

Likely the problem is in here.

https://github.com/rust-lang-nursery/rustup.rs/blob/f20d52558a1562d3e185d5b154885e7dc08fb86f/src/rustup-cli/self_update.rs#L292-L325

It would appear that everything is OK if ~/.multirust/version has a trailing lf, but if the file is only two bytes, BOOM.

This should let you reproduce it:

n@nathanael-xeon:~/Documents$ mkdir ~/.multirust || printf "12" > ~/.multirust/version && ls -lah ~/.multirust/version
mkdir: cannot create directory ‘/home/n/.multirust’: File exists
-rw-rw-r-- 1 n n 2 Aug 25 21:07 /home/n/.multirust/version

@brson
Copy link
Contributor

brson commented Aug 26, 2016

@nathanaeljones Thanks for the investigation.

I can reproduce the segfault with your instructions. And I've verified that rustup 0.6.0 does not crash, the link for which is https://static.rust-lang.org/rustup/archive/0.6.0/x86_64-unknown-linux-gnu/rustup-init.

@brson brson added the bug label Aug 26, 2016
@brson
Copy link
Contributor

brson commented Aug 26, 2016

related to arm7 crash #687

@brson
Copy link
Contributor

brson commented Aug 26, 2016

Slight tweak for the repro

$ mkdir ~/.multirust; printf "12" > ~/.multirust/version && ls -lah ~/.multirust/version
$ curl -O https://static.rust-lang.org/rustup/archive/0.6.1/x86_64-unknown-linux-gnu/rustup-init
$ chmod u+x rustup-init
$ ./rustup-init
Segmentation fault (core dumped)

@brson
Copy link
Contributor

brson commented Aug 27, 2016

Should be fixed.

@Bulletninja
Copy link

Bulletninja commented Nov 1, 2021

Trying to run https://github.com/public-awesome/terra-spacecamp from gitpod

But when it gets to the last line of Dockerfile https://github.com/public-awesome/terra-spacecamp/blob/main/.gitpod.Dockerfile :

#RUN rustup update stable \
#   && rustup target add wasm32-unknown-unknown

and i get:

error: rustup is not installed at '/workspace/.cargo'
$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/gitpod/.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu
1.55.0-x86_64-unknown-linux-gnu (default)

active toolchain
----------------

1.55.0-x86_64-unknown-linux-gnu (default)
rustc 1.55.0 (c8dfcfe04 2021-09-06)

@kinnison
Copy link
Contributor

kinnison commented Nov 8, 2021

@Bulletninja That sounds like a Docker related problem. If you continue to have issues then please open a fresh issue, don't respond to ancient issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants