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

rustc exits with SIGSEV (signal 11) #34194

Closed
neandrake opened this issue Jun 10, 2016 · 3 comments
Closed

rustc exits with SIGSEV (signal 11) #34194

neandrake opened this issue Jun 10, 2016 · 3 comments
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.

Comments

@neandrake
Copy link

I have a small project that I've been learning rust with. Just now I've added some code and the next time I run cargo build rustc exits with SIGSEV signal 11. I've previously not run into this issue while working on this project.

Minimal Reproducible Code: main.rs.txt

cspeckrun@specktop ~/P/n/t/barf> cargo build --verbose
   Compiling barf v0.1.0 (file:///Users/cspeckrun/Projects/neandrake/test/barf)
     Running `rustc src/main.rs --crate-name barf --crate-type bin -g --out-dir /Users/cspeckrun/Projects/neandrake/test/barf/target/debug --emit=dep-info,link -L dependency=/Users/cspeckrun/Projects/neandrake/test/barf/target/debug -L dependency=/Users/cspeckrun/Projects/neandrake/test/barf/target/debug/deps`
error: Could not compile `barf`.

Caused by:
  Process didn't exit successfully: `rustc src/main.rs --crate-name barf --crate-type bin -g --out-dir /Users/cspeckrun/Projects/neandrake/test/barf/target/debug --emit=dep-info,link -L dependency=/Users/cspeckrun/Projects/neandrake/test/barf/target/debug -L dependency=/Users/cspeckrun/Projects/neandrake/test/barf/target/debug/deps` (signal: 11, SIGSEGV: invalid memory reference)
cspeckrun@specktop ~/P/n/t/barf>

Meta

I'm working on Mac (OSX 10.11.5), with rust installed through Homebrew

Cargo & Rust Version:

cspeckrun@specktop ~/P/n/t/barf> rustc --version --verbose
rustc 1.9.0
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-apple-darwin
release: 1.9.0
cspeckrun@specktop ~/P/n/t/barf> cargo --version --verbose
cargo 0.10.0 (10ddd7d 2016-04-08)

Details on homebrew install:

cspeckrun@specktop ~/P/n/t/barf> brew info rust
rust: stable 1.9.0 (bottled), HEAD
Safe, concurrent, practical language
https://www.rust-lang.org/
Conflicts with: multirust
/usr/local/Cellar/rust/1.0.0 (13,947 files, 322M)
  Poured from bottle on 2015-05-16 at 08:45:38
/usr/local/Cellar/rust/1.1.0 (13,888 files, 324.4M)
  Poured from bottle on 2015-06-26 at 12:02:48
/usr/local/Cellar/rust/1.2.0 (4,034 files, 244.9M)
  Poured from bottle on 2015-08-13 at 09:49:46
/usr/local/Cellar/rust/1.3.0 (4,147 files, 245M)
  Poured from bottle on 2015-09-19 at 01:12:26
/usr/local/Cellar/rust/1.4.0 (3,968 files, 232.4M)
  Poured from bottle on 2015-11-03 at 23:02:54
/usr/local/Cellar/rust/1.5.0 (4,051 files, 215.8M)
  Poured from bottle on 2015-12-10 at 11:44:31
/usr/local/Cellar/rust/1.6.0 (8,908 files, 218.1M)
  Poured from bottle on 2016-01-24 at 17:57:02
/usr/local/Cellar/rust/1.7.0 (10,323 files, 228.2M)
  Poured from bottle on 2016-03-04 at 00:39:39
/usr/local/Cellar/rust/1.8.0 (9,398 files, 234.8M)
  Poured from bottle on 2016-04-17 at 02:59:36
/usr/local/Cellar/rust/1.9.0 (10,239 files, 239.8M) *
  Poured from bottle on 2016-05-27 at 19:44:00
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/rust.rb
==> Dependencies
Build: cmake ✔
Required: pkg-config ✔, openssl ✔, libssh2 ✔
Optional: llvm ✘
==> Options
--with-llvm
    Build with brewed LLVM. By default, Rust's LLVM will be used.
--HEAD
    Install HEAD version
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completion has been installed to:
  /usr/local/share/zsh/site-functions
@neandrake
Copy link
Author

I played around with the code to make it actually more minimal, as well as pointing to the line which introduces the error during compilation

#![allow(dead_code)]
#![allow(non_upper_case_globals)]

pub struct UID {
    uid: &'static str,
}

pub static ImplicitVRLittleEndian: &'static UID = &UID { uid: "1.2.840.10008.1.2" };

pub struct TransferSyntax {
    uid: &'static UID,
}

/**** The addition of the following line is what causes the error */
pub static ImplicitVRLittleEndian_TS: &'static TransferSyntax = &TransferSyntax { uid: &ImplicitVRLittleEndian };

fn main() {
    println!("Hello, world!");
}

@TimNN
Copy link
Contributor

TimNN commented Jun 10, 2016

This seems to have been fixed on nightly (playpen).

@apasel422 apasel422 added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Jun 17, 2016
dsprenkels added a commit to dsprenkels/rust that referenced this issue Jun 18, 2016
@dsprenkels
Copy link
Contributor

According to a quick git-bisect, #33523 contained the commit that fixed this.

bors added a commit that referenced this issue Jun 20, 2016
Add regression test for #34194

This pull request adds a regression test for #34194.

Closes #34194.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Projects
None yet
Development

No branches or pull requests

4 participants