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

Segfault in rustup-init on OS X 10.10.5/10.11.6 #679

Closed
qdot opened this issue Aug 23, 2016 · 13 comments
Closed

Segfault in rustup-init on OS X 10.10.5/10.11.6 #679

qdot opened this issue Aug 23, 2016 · 13 comments

Comments

@qdot
Copy link

qdot commented Aug 23, 2016

rustup-init (whatever is current as of 2016-08-22) segfaulted failed on 2 different mbp models, both running 10.10.5.

lldb output:

23Process 1740 launched: '/Users/qdot/Downloads/rustup-init' (x86_64)
23Process 1740 stopped
* thread #1: tid = 0x2890, 0x000000010024cbf0 rustup-init`je_huge_dalloc + 176, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x000000010024cbf0 rustup-init`je_huge_dalloc + 176
rustup-init`je_huge_dalloc:
->  0x10024cbf0 <+176>: movq   (%r8,%rdx,8), %r14
    0x10024cbf4 <+180>: movq   (%r14), %rbx
    0x10024cbf7 <+183>: movq   %rbx, -0x30(%rbp)
    0x10024cbfb <+187>: movq   %rsi, %rdi
(lldb) bt
* thread #1: tid = 0x2890, 0x000000010024cbf0 rustup-init`je_huge_dalloc + 176, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x000000010024cbf0 rustup-init`je_huge_dalloc + 176
    frame #1: 0x000000010023624f rustup-init`je_sdallocx + 1087
    frame #2: 0x000000010002cbd2 rustup-init`rustup_init::self_update::install::h7237ab7ae2a2da9d + 5154
    frame #3: 0x000000010003df21 rustup-init`rustup_init::main::h4ad9acfe630cd1dd + 5857
    frame #4: 0x0000000100230beb rustup-init`__rust_maybe_catch_panic + 27
    frame #5: 0x000000010022f2ff rustup-init`std::rt::lang_start::h352a66f5026f54bd + 399
    frame #6: 0x0000000100001484 rustup-init`start + 52
(lldb)
@ashrithr
Copy link

ashrithr commented Aug 23, 2016

Same here on mbp running 10.11.6.

curl https://sh.rustup.rs -sSf | sh
info: downloading installer
sh: line 250: 17140 Segmentation fault: 11  "$@"
rustup: command failed: /var/folders/5z/rggs791s4ml6fhs4bxzg7k1w0000gn/T/tmp.dBwAW49U/rustup-init

lldb output:

(lldb) run
Process 17188 launched: './rustup-init' (x86_64)
Process 17188 stopped
* thread #1: tid = 0x137e81, 0x000000010024cbf0 rustup-init`je_huge_dalloc + 176, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x000000010024cbf0 rustup-init`je_huge_dalloc + 176
rustup-init`je_huge_dalloc:
->  0x10024cbf0 <+176>: movq   (%r8,%rdx,8), %r14
    0x10024cbf4 <+180>: movq   (%r14), %rbx
    0x10024cbf7 <+183>: movq   %rbx, -0x30(%rbp)
    0x10024cbfb <+187>: movq   %rsi, %rdi
(lldb) bt
* thread #1: tid = 0x137e81, 0x000000010024cbf0 rustup-init`je_huge_dalloc + 176, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x000000010024cbf0 rustup-init`je_huge_dalloc + 176
    frame #1: 0x000000010023624f rustup-init`je_sdallocx + 1087
    frame #2: 0x000000010002cbd2 rustup-init`rustup_init::self_update::install::h7237ab7ae2a2da9d + 5154
    frame #3: 0x000000010003df21 rustup-init`rustup_init::main::h4ad9acfe630cd1dd + 5857
    frame #4: 0x0000000100230beb rustup-init`__rust_maybe_catch_panic + 27
    frame #5: 0x000000010022f2ff rustup-init`std::rt::lang_start::h352a66f5026f54bd + 399
    frame #6: 0x0000000100001484 rustup-init`start + 52

@qdot qdot changed the title Segfault in rustup-init on OS X 10.10.5 Segfault in rustup-init on OS X 10.10.5/10.11.6 Aug 23, 2016
@qdot
Copy link
Author

qdot commented Aug 23, 2016

Updated description to reflect more broken versions.

@defuz
Copy link

defuz commented Aug 23, 2016

I have the same error on 10.12 (Sierra beta). My report:

https://gist.github.com/defuz/5d3db5293834c387ea01e9e203ff3f39

@JoeHegarty
Copy link

I'm running into the same issue on multiple MBPs with 10.11 and 10.12.

@Diggsey
Copy link
Contributor

Diggsey commented Aug 24, 2016

I don't have a MBP to test this on, but could you try setting the environment variable RUSTUP_INIT_SKIP_SUDO_CHECK to be yes before running rustup-init and see if that fixes the problem?

@JoeHegarty
Copy link

Yes @Diggsey. That resolves the issue for me.

@brson
Copy link
Contributor

brson commented Aug 24, 2016

Ugly bug. Nice find @Diggsey. We'll try to get a fix out asap.

@brson
Copy link
Contributor

brson commented Aug 24, 2016

I can't reproduce on 10.8.5.

@brson
Copy link
Contributor

brson commented Aug 24, 2016

Was anybody who is affected by this able to install rustup successfully on OS X 10.10+ recently? This code has been in place since late July.

The bug is in this block of code. I've read through it several times, and while the transmute could be eliminated and there might be sketchy lifetimes around the CStr, I don't see the error.

For now I'm going to disable this function on macOS, but I'd appreciate help from anyone that can reproduce it. Maybe just some println debugging to see what's going wrong.

@brson
Copy link
Contributor

brson commented Aug 24, 2016

OK, I found a box to reproduce it on.

@brson
Copy link
Contributor

brson commented Aug 24, 2016

Seems like it only happens when built with the nightly compiler, not stable, so that would explain why it hasn't turned up before. We recently switch toolchains.

brson added a commit to brson/rustup.rs that referenced this issue Aug 24, 2016
@brson brson closed this as completed in e737612 Aug 24, 2016
brson added a commit that referenced this issue Aug 24, 2016
Fix mysterious crash on OS X 10.10+. Fixes #679
@brson brson reopened this Aug 24, 2016
@brson
Copy link
Contributor

brson commented Aug 24, 2016

Fix is landed. Thanks @alexcrichton. Reopening until deployed.

@brson
Copy link
Contributor

brson commented Aug 24, 2016

Fixed.

@brson brson closed this as completed Aug 24, 2016
alexcrichton added a commit to alexcrichton/rustup.rs that referenced this issue Aug 26, 2016
passy added a commit to woofwoofinc/cargo-sphinx that referenced this issue Aug 27, 2016
From rust-lang/rustup#679.
This seems to address the segfault we're seeing.
daithiocrualaoich pushed a commit to woofwoofinc/cargo-sphinx that referenced this issue Aug 27, 2016
From rust-lang/rustup#679.
This seems to address the segfault we're seeing.
nodakai pushed a commit to nodakai/rustup.rs that referenced this issue Apr 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants