-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
ICE: librustc_trans/mir/constant.rs:682: Unexpected non-fat-pointer operand #38942
Comments
Inline assembly cannot be an issue as this is an ICE on stable rustc. #38727 is fixed on nightly, so you’ll have to test/do travis run on i686 apple with nightly rustc. |
Here's a Travis run on nightly rustc with i686 apple platform: https://travis-ci.org/fenollp/minrs/jobs/190236515#L233 That bug looks fixed. However now I have
which Google doesn't seem to know about! |
cc @eddyb @Mark-Simulacrum stuff related to type_is_immediate change could have caused this. |
* ci: thx github.com/japaric/trust * ci: bump trust to v0.1.1 * ci: DISABLE_TESTS=1 * ci: DISABLE_TESTS=1 on AppVeyor too * ci: allow_failures * ci: fix OSX builds * ci: honor script.sh logic for AppVeyor too * ci: try i686 apple with nightly rustc for rust-lang/rust/issues/38942 * ci: really fix OSX builds * ci: really really fix OSX builds * ci: fix allow_failures * ci: run something if you really want to * ci: do not disable tests * ci: Cargo.lock * ci: exec basic help for starters * ci: late night fix
So all it takes to reproduce is building https://github.com/fenollp/minrs on an i686-mac? |
Or must it specifically be run on travis? If so, we should try to isolate what is different there! |
Assigning to @pnkfelix for now, who will attempt to reproduce with a cross-compile. |
Summary: I have now managed to reproduce. Steps follow. Initial comment: Hmm, well I think I have the cross-compile set up now (I wrote the steps I followed below), but I think I am hitting the first ICE described ("internal compiler error: ../src/librustc_trans/mir/operand.rs:82: impossible case reached"), so I have not yet replicated the "Unexpected non-fat-pointer operand"). Steps to set up cross compile
Update: but then again, with the stable channel I am hitting the same ICE ...? Maybe I still have something wrong here. Update to update: I think I misread some of the initial discussion; the original description was filed against stable, so I cannot actually compare against a stable version because it is guaranteed to hit the described ICE. I'm going to see if changing my particular nightly changes anything here. Okay, backtracking to the specific nightly of So, how to do that:
|
Can you use |
Talked to @eddyb on IRC. The last line of output from the rust log for
|
I noticed this before, might be of interest:
appears when the constant.rs bug gets triggered, however the operand.rs one has |
@fenollp Ah that would definitely be able to trigger 2 distinct bugs. |
Okay here is a minimized example for the unexpected fat pointer operand ICE. It only comes up with i686 (-apple-darwin), though hopefully that is not relevant), not with x86_64 Code: // This causeds an ICE when targeting i686-apple-darwin (from a
// x86_64-apple-darwin host).
#![crate_name = "cocoa"]
#![crate_type = "rlib"]
#![allow(non_upper_case_globals)]
pub mod appkit {
use std::fmt::{self};
#[repr(u64)]
pub enum NSEventType {
NSEventTypePressure = 34,
}
pub struct NSEventMask {
bits: u64,
}
pub const NSEventMaskPressure: NSEventMask =
NSEventMask{bits: 1 << (NSEventType::NSEventTypePressure as u64),};
impl fmt::Debug for NSEventMask {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
if NSEventMaskPressure.bits != 0 {
match f.write_str("NSEventMaskPressure") {
Ok(val) => val,
Err(err) => {
return Err(From::from(err))
}
}
}
Ok(())
}
}
} And here's the run:
|
Also reproduced minimized example still ICE's with a more recent nightly:
|
Oh this is a non-immediate |
The more-minimal version. Thanks for minimizing @pnkfelix! #![crate_type = "rlib"]
#[repr(u64)]
pub enum NSEventType {
NSEventTypePressure,
}
pub const A: u64 = NSEventType::NSEventTypePressure as u64;
fn banana() -> u64 {
A
} |
(if #38854 does fix it, we probably should try to add this as a regression test if possible before closing, assuming we can readily do cross target unit test.) |
Do you even need the shift? I bet it's just the cast. The test doesn't need to be special as long as we build for 32-bit targets, it will get caught. |
…crichton Add regression test for issue rust-lang#38942 Closes rust-lang#38942. Kudos to @pnkfelix and @nagisa, who did all the hard work of creating a reduced test case.
Here is the Travis job that fails: https://travis-ci.org/fenollp/minrs/jobs/190200414
Which is part of this build https://travis-ci.org/fenollp/minrs/builds/190200409
This only happens on
i686-apple-darwin
& on Travis' OSX hardware.Possibly linked: #38727 #16383 #37437 #38735
The text was updated successfully, but these errors were encountered: