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

Compiler panic on two-line feature gate #23110

Closed
hauleth opened this issue Mar 6, 2015 · 8 comments
Closed

Compiler panic on two-line feature gate #23110

hauleth opened this issue Mar 6, 2015 · 8 comments
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority

Comments

@hauleth
Copy link
Contributor

hauleth commented Mar 6, 2015

Compiler panics when I have separate lines for feature gates.

I tried this code:

https://github.com/hauleth/inter/blob/compiler-error/src/lib.rs (sorry for the project link, but I cannot reproduce it in any other environment)

When I try to compile any examples or tests I get (output for cargo test):

       Fresh log v0.2.5
       Fresh rustc-serialize v0.2.15
       Fresh libc v0.1.2
       Fresh rand v0.1.4
       Fresh num v0.1.15
   Compiling inter v0.0.1 (file:///home/hauleth/Workspace/inter)
     Running `rustc src/lib.rs --crate-name inter --crate-type lib -g -C metadata=7a3684a129aeb871 -C extra-filename=-7a3684a129aeb871 --out-dir /home/hauleth/Workspace/inter/target --emit=dep-info,link -L dependency=/home/hauleth/Workspace/inter/target -L dependency=/home/hauleth/Workspace/inter/target/deps --extern num=/home/hauleth/Workspace/inter/target/deps/libnum-05305060c7d6f43b.rlib`
     Running `rustc src/lib.rs --crate-name inter --crate-type lib -g --test -C metadata=5cc7200d4891a42a -C extra-filename=-5cc7200d4891a42a --out-dir /home/hauleth/Workspace/inter/target --emit=dep-info,link -L dependency=/home/hauleth/Workspace/inter/target -L dependency=/home/hauleth/Workspace/inter/target/deps --extern num=/home/hauleth/Workspace/inter/target/deps/libnum-05305060c7d6f43b.rlib`
     Running `rustc examples/sinus.rs --crate-name sinus --crate-type bin -g --out-dir /home/hauleth/Workspace/inter/target/examples --emit=dep-info,link -L dependency=/home/hauleth/Workspace/inter/target -L dependency=/home/hauleth/Workspace/inter/target/deps --extern num=/home/hauleth/Workspace/inter/target/deps/libnum-05305060c7d6f43b.rlib --extern inter=/home/hauleth/Workspace/inter/target/libinter-7a3684a129aeb871.rlib`
     Running `rustc examples/rounding.rs --crate-name rounding --crate-type bin -g --out-dir /home/hauleth/Workspace/inter/target/examples --emit=dep-info,link -L dependency=/home/hauleth/Workspace/inter/target -L dependency=/home/hauleth/Workspace/inter/target/deps --extern num=/home/hauleth/Workspace/inter/target/deps/libnum-05305060c7d6f43b.rlib --extern inter=/home/hauleth/Workspace/inter/target/libinter-7a3684a129aeb871.rlib`
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'assertion failed: bpos.to_usize() >= mbc.pos.to_usize() + mbc.bytes', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/codemap.rs:734


Build failed, waiting for other jobs to finish...
Could not compile `inter`.

Caused by:
  Process didn't exit successfully: `rustc examples/sinus.rs --crate-name sinus --crate-type bin -g --out-dir /home/hauleth/Workspace/inter/target/examples --emit=dep-info,link -L dependency=/home/hauleth/Workspace/inter/target -L dependency=/home/hauleth/Workspace/inter/target/deps --extern num=/home/hauleth/Workspace/inter/target/deps/libnum-05305060c7d6f43b.rlib --extern inter=/home/hauleth/Workspace/inter/target/libinter-7a3684a129aeb871.rlib` (exit code: 101)

Code fixup

It is fixed in master by joining feature gates in one call.

Meta

rustc --version --verbose:

rustc 1.0.0-nightly (3b3bb0e68 2015-03-04) (built 2015-03-05)
binary: rustc
commit-hash: 3b3bb0e682c2d252e9f62dd9df5cff9552af91ad
commit-date: 2015-03-04
build-date: 2015-03-05
host: x86_64-unknown-linux-gnu
release: 1.0.0-nightly
@pnkfelix
Copy link
Member

pnkfelix commented Mar 6, 2015

triage: P-high

not 1.0 blocker. (Tempted to make it P-low, but I think all ICE's should probably get at least P-high).

@rust-highfive rust-highfive added the P-medium Medium priority label Mar 6, 2015
@rust-highfive rust-highfive added this to the 1.0 beta milestone Mar 6, 2015
@pnkfelix pnkfelix added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Mar 6, 2015
@nrc nrc removed this from the 1.0 beta milestone Mar 11, 2015
@pyfisch
Copy link
Contributor

pyfisch commented Mar 15, 2015

@Manishearth
Copy link
Member

https://travis-ci.org/servo/html5ever/builds/56209902

(Ogeon/html5ever@40e1a73, on rustc 1.0.0-nightly (199bdcfef 2015-03-26) (built 2015-03-27))

@Ygg01
Copy link

Ygg01 commented Mar 28, 2015

I have a similar problem. Unfortunately I have it in a when I calls make examples on a branch of html5ever.

https://github.com/Ygg01/html5ever/blob/91adf3158aa13d8384704497d0e34000659a66ca/examples/xml5tokenize.rs

I've noted it only happens if I include xml5tokenize in examples. Also removing feature gates, didn't help:

Here is the backtrace it produced: https://gist.github.com/Ygg01/dcaee0167b8edbb6c71b

Meta

rustc 1.0.0-nightly (ecf8c64e1 2015-03-21) (built 2015-03-22)
binary: rustc
commit-hash: ecf8c64e1b1b60f228f0c472c0b0dab4a5b5aa61
commit-date: 2015-03-21
build-date: 2015-03-22
host: x86_64-unknown-linux-gnu
release: 1.0.0-nightly

@kmcallister
Copy link
Contributor

I'm seeing that on my html5ever branch as well :/

@kmcallister
Copy link
Contributor

In that case the crash happens in debug info and is fixed by removing -g.

kmcallister added a commit to servo/html5ever that referenced this issue Mar 31, 2015
kmcallister added a commit to servo/html5ever that referenced this issue Mar 31, 2015
@Manishearth
Copy link
Member

Can anyone reproduce this now?

@Manishearth Manishearth added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Nov 5, 2015
@brson
Copy link
Contributor

brson commented Jul 14, 2016

Old bug with no repros.

@brson brson closed this as completed Jul 14, 2016
bors-servo pushed a commit to servo/html5ever that referenced this issue Jul 1, 2018
Enable debugging information in dev and test builds.

It's pretty surprising when tests and dev builds can't be debugged. Debugging information was disabled in 1223b23 (2015-3-31) because of rust-lang/rust#23110, which was closed 2016-7-14. It should be okay to turn it back on now.
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. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority
Projects
None yet
Development

No branches or pull requests

9 participants