Skip to content

ICE: assertion failed: self.appropriate_rvalue_mode(bcx.ccx()) == ByValue #26162

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

Closed
mattgodbolt opened this issue Jun 10, 2015 · 4 comments
Closed

Comments

@mattgodbolt
Copy link

While refactoring some code I tripped over this one. As most of the program has changed, I'm not sure what the actual cause is. Posting here in case someone can help me fathom what it is.

Looks superficially similar to #23888 but it's not clear that my changes have introduced an == on "fat raw pointers".

src/geometry.rs:72:26: 72:29 warning: unused variable: rng, #[warn(unused_variables)] on by default
src/geometry.rs:72 fn random_pos(&self, rng: &mut F64Rng) -> Vec3d {
^~~
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: self.appropriate_rvalue_mode(bcx.ccx()) == ByValue', /home/rustbuild/src/rust-buildbot/slave/stable-dist-rustc-linux/build/src/librustc_trans/trans/datum.rs:646

stack backtrace:
1: 0x7f7444b3f449 - sys::backtrace::write::hbc46dc0cfb3b9537d4r
2: 0x7f7444b47156 - panicking::on_panic::h74d3c14d86c58ac8jrw
3: 0x7f7444b0a462 - rt::unwind::begin_unwind_inner::h382cea404b11eb00t6v
4: 0x7f744420137e - rt::unwind::begin_unwind::h11527883117899559464
5: 0x7f7444291db2 - trans::datum::Datum<'tcx, K>::to_llscalarish::h13658016800508616489
6: 0x7f7444314d08 - trans::expr::trans_binary::h675be97e90ac8015O6B
7: 0x7f744430b72c - trans::expr::trans_unadjusted::h36bc1189b1eec85e9zA
8: 0x7f7444244ad4 - trans::expr::trans::h7f89da2569c8dc1bgdA
9: 0x7f744430d086 - trans::expr::trans_rvalue_dps_unadjusted::h7c0140fcbfb13319C5A
10: 0x7f74442e0fd7 - trans::expr::trans_into::h10885d95ed8d401aX6z
11: 0x7f7444265b0e - trans::controlflow::trans_block::hfa898015a1217b0b02u
12: 0x7f744430c6e9 - trans::expr::trans_rvalue_dps_unadjusted::h7c0140fcbfb13319C5A
13: 0x7f74442e0fd7 - trans::expr::trans_into::h10885d95ed8d401aX6z
14: 0x7f744434b753 - trans::_match::trans_match_inner::h6119af2a2800890b61H
15: 0x7f744430c6b3 - trans::expr::trans_rvalue_dps_unadjusted::h7c0140fcbfb13319C5A
16: 0x7f74442e0fd7 - trans::expr::trans_into::h10885d95ed8d401aX6z
17: 0x7f7444265b0e - trans::controlflow::trans_block::hfa898015a1217b0b02u
18: 0x7f74442645b1 - trans::base::trans_closure::h8e5687f4ccb96c5eLCh
19: 0x7f74442660ea - trans::base::trans_fn::h0bc8fb6dbe17d6adtNh
20: 0x7f7444269c44 - trans::base::trans_item::h4f9c99b1e4474396Fbi
21: 0x7f7444269ab8 - trans::base::trans_item::h4f9c99b1e4474396Fbi
22: 0x7f744427756d - trans::base::trans_crate::haa02506df24d5efcF0i
23: 0x7f744508d0fa - driver::phase_4_translate_to_llvm::h86d6fb84c5c936d5hOa
24: 0x7f7445064faa - driver::compile_input::hb78754f2f33c01efQba
25: 0x7f74451264d1 - run_compiler::h258d36d5501c1cdfz4b
26: 0x7f7445124122 - boxed::F.FnBox::call_box::h7239693171334256553
27: 0x7f7445123659 - rt::unwind::try::try_fn::h14329119008520845439
28: 0x7f7444bb9ac8 - rust_try_inner
29: 0x7f7444bb9ab5 - rust_try
30: 0x7f7445123908 - boxed::F.FnBox::call_box::h17332056298259451807
31: 0x7f7444b46041 - sys::thread::create::thread_start::h490278b5c3c0b49faqv
32: 0x7f743f3c8181 - start_thread
33: 0x7f744479047c - __clone
34: 0x0 -

Could not compile path_tracer.

Caused by:
Process didn't exit successfully: rustc src/lib.rs --crate-name path_tracer --crate-type lib -g --out-dir /home/mgodbolt/dev/path-tracer/target/debug --emit=dep-info,link -L dependency=/home/mgodbolt/dev/path-tracer/target/debug -L dependency=/home/mgodbolt/dev/path-tracer/target/debug/deps --extern image=/home/mgodbolt/dev/path-tracer/target/debug/deps/libimage-0d2eddca90a3c251.rlib --extern threadpool=/home/mgodbolt/dev/path-tracer/target/debug/deps/libthreadpool-213781c0d8fba90b.rlib --extern rand=/home/mgodbolt/dev/path-tracer/target/debug/deps/librand-b924d9fc5b3eb5b8.rlib --extern num_cpus=/home/mgodbolt/dev/path-tracer/target/debug/deps/libnum_cpus-d64cdaf0c78cf4e8.rlib --extern argparse=/home/mgodbolt/dev/path-tracer/target/debug/deps/libargparse-e91dcf4972ac931d.rlib (exit code: 101)

I've checked in the code at https://github.com/mattgodbolt/path-tracer/tree/ice and will leave that 'ice' branch pointing at the broken build while I try and find a workaround and/or fix.

@mitaa
Copy link
Contributor

mitaa commented Jun 10, 2015

This looks like a spot where fat raw pointers are compared:
mattgodbolt/path-tracer@3fe1401#diff-1f0541119ecba5576327a7349c7d9aefR52

// scene.rs
use renderable::{Hit, Renderable};

...

if obj as *const Renderable == light as *const Renderable { true } else { false }
// renderable.rs
pub trait Renderable : Send + Sync {

@mattgodbolt
Copy link
Author

Ah! I hadn't changed that part recently! Thanks. What makes them 'fat' in this instance?

@mitaa
Copy link
Contributor

mitaa commented Jun 10, 2015

obj as *const Renderable creates a Trait object - Trait objects are DST's.

(http://doc.rust-lang.org/book/trait-objects.html#why-pointers?)

@mattgodbolt
Copy link
Author

Thanks for clarifying! I will close as a duplicate.
On Wed, Jun 10, 2015 at 6:55 AM, mitaa [email protected] wrote:

obj as *const Renderable creates a Trait object - Trait objects are DST's.

http://doc.rust-lang.org/book/trait-objects.html#why-pointers?


Reply to this email directly or view it on GitHub
#26162 (comment).

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

2 participants