Skip to content

ICE When trying to build the rust opencl binding #20805

@caryhaynie

Description

@caryhaynie

While trying to update rust-opencl to build against the latest rust nightly, I ran in to the following:

/Users/cary/rust-opencl/src/hl.rs:456:29: 469:18 error: internal compiler error: aliasability violation with closure
/Users/cary/rust-opencl/src/hl.rs:456 write.write(|&: offset, p, len| {
/Users/cary/rust-opencl/src/hl.rs:457 let mut e: cl_event = ptr::null_mut();
/Users/cary/rust-opencl/src/hl.rs:458 let err = clEnqueueWriteBuffer(self.cqueue,
/Users/cary/rust-opencl/src/hl.rs:459 mem.id(),
/Users/cary/rust-opencl/src/hl.rs:460 CL_FALSE,
/Users/cary/rust-opencl/src/hl.rs:461 offset as libc::size_t,
...
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with RUST_BACKTRACE=1 for a backtrace
thread 'rustc' panicked at 'Box', /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/libsyntax/diagnostic.rs:123

stack backtrace:
1: 0x11314b4b5 - sys::backtrace::write::h64ca2fb259c4ae97lCt
2: 0x11316d94f - failure::on_fail::h64ff5ae6887860cc0Hz
3: 0x1130d95ca - rt::unwind::begin_unwind_inner::h1d4bc098fd350446Qpz
4: 0x110de30b7 - rt::unwind::begin_unwind::h1123425023578864118
5: 0x110de304c - diagnostic::SpanHandler::span_bug::he8deb1e61e0360e4nQF
6: 0x11020d9cd - session::Session::span_bug::h67200d92e3673ccdYQq
7: 0x10fe07031 - borrowck::BorrowckCtxt<'a, 'tcx>::report_aliasability_violation::h5042d69593442126B4f
8: 0x10fe0e963 - borrowck::gather_loans::check_aliasability::h21b570198b22ae04Fvc
9: 0x10fe0cde3 - borrowck::gather_loans::GatherLoanCtxt<'a, 'tcx>.euv..Delegate<'tcx>::borrow::h841515cb9f354927pqc
10: 0x10fdfeacd - middle::expr_use_visitor::ExprUseVisitor<'d, 't, 'tcx, TYPER>::walk_captures::unboxed_closure.13810
11: 0x10fdfa65d - middle::expr_use_visitor::ExprUseVisitor<'d, 't, 'tcx, TYPER>::walk_expr::h13689288423279767843
12: 0x10fdfe361 - middle::expr_use_visitor::ExprUseVisitor<'d, 't, 'tcx, TYPER>::consume_expr::h15590379015244547509
13: 0x10fdf97ff - middle::expr_use_visitor::ExprUseVisitor<'d, 't, 'tcx, TYPER>::walk_expr::h13689288423279767843
14: 0x10fdfe361 - middle::expr_use_visitor::ExprUseVisitor<'d, 't, 'tcx, TYPER>::consume_expr::h15590379015244547509
15: 0x10fdf908b - middle::expr_use_visitor::ExprUseVisitor<'d, 't, 'tcx, TYPER>::walk_block::h12567878441358035813
16: 0x10fdf949f - middle::expr_use_visitor::ExprUseVisitor<'d, 't, 'tcx, TYPER>::walk_expr::h13689288423279767843
17: 0x10fdfe361 - middle::expr_use_visitor::ExprUseVisitor<'d, 't, 'tcx, TYPER>::consume_expr::h15590379015244547509
18: 0x10fdf908b - middle::expr_use_visitor::ExprUseVisitor<'d, 't, 'tcx, TYPER>::walk_block::h12567878441358035813
19: 0x10fe24318 - borrowck::build_borrowck_dataflow_data::hfa09ea6d1940ae40QRe
20: 0x10fe20d6b - borrowck::borrowck_fn::h53d8931196ae5f75cPe
21: 0x10fe22f87 - visit::walk_expr::h4659549509342750598
22: 0x10fe22e02 - visit::walk_expr::h4659549509342750598
23: 0x10fe231f2 - visit::walk_block::h10475317576522808201
24: 0x10fe215fc - borrowck::borrowck_fn::h53d8931196ae5f75cPe
25: 0x10fe23cae - visit::walk_method_helper::h2285262828809068003
26: 0x10fe21f2c - borrowck::borrowck_item::hb33a72754e4746199Ne
27: 0x10fe225cf - visit::walk_mod::h12679472845435306486
28: 0x10fe2208f - borrowck::check_crate::h0953eedb9233150cZIe
29: 0x10f97aeaa - driver::phase_3_run_analysis_passes::h4c5cf0d8fe5d55degwa
30: 0x10f95f420 - driver::compile_input::h31580cbd7ea87613xba
31: 0x10fa2afda - monitor::unboxed_closure.22557
32: 0x10fa29735 - thunk::F.Invoke<A, R>::invoke::h6367419564961841226
33: 0x10fa28510 - rt::unwind::try::try_fn::h7763956589852599824
34: 0x1131d42a9 - rust_try_inner
35: 0x1131d4296 - rust_try
36: 0x10fa28c0c - thunk::F.Invoke<A, R>::invoke::h16724184168577887652
37: 0x11315b154 - sys::thread::thread_start::hbd8f2f8bdd3a3baadrw
38: 0x7fff91bd4899 - _pthread_body
39: 0x7fff91bd472a - _pthread_struct_init

Could not compile opencl.

rustc info:

rustc 1.0.0-nightly (44a287e 2015-01-08 17:03:40 -0800)
binary: rustc
commit-hash: 44a287e
commit-date: 2015-01-08 17:03:40 -0800
host: x86_64-apple-darwin
release: 1.0.0-nightly

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions