Skip to content

Strange runtime crash on x86_64-apple-darwin with simd #22033

@lilyball

Description

@lilyball

With the latest x86_64-apple-darwin nightly (rustc 1.0.0-nightly (ba2f13ef0 2015-02-04 20:03:55 +0000)), the following program crashes at runtime:

#![feature(core)]
use std::simd::*;
use std::mem;

fn main() {
    assert_eq!(16, mem::min_align_of::<u64x2>());
    let _ = unsafe { mem::transmute::<_,(u64,u64)>(u64x2(1,2)) };
}

Removing the assertion fixes the crash. But the crash itself happens on the following line. LLDB tells me this is EXC_BAD_ACCESS (code=EXC_I386_GPFLT) occurring at

   0x100000f4c:  callq  0x100001ce0               ; rt::unwind::begin_unwind_fmt::h0c200fcff22cbdd4buF
   0x100000f51:  jmp    0x100000f53               ; foo::main + 515 at foo.rs:7
   0x100000f53:  movaps 0x25966(%rip), %xmm0
-> 0x100000f5a:  movaps %xmm0, -0x118(%rbp)
   0x100000f61:  addq   $0x130, %rsp
   0x100000f68:  popq   %rbp
   0x100000f69:  retq   

The crash does not happen under optimization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.O-macosOperating system: macOS

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions