Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upProcess didn't exit successfully: ... (signal: 4) in tests #25089
Comments
This comment has been minimized.
This comment has been minimized.
|
Try using lldb to get a stacktrace:
|
This comment has been minimized.
This comment has been minimized.
|
sfackler
added
the
I-crash
label
May 4, 2015
alexcrichton
added
the
A-codegen
label
May 4, 2015
This comment has been minimized.
This comment has been minimized.
|
It looks like this is a bug in trans, the cleanup for the #[test]
#[should_panic]
fn panic() {
should_panic(Box::new(1), empty());
}
struct Empty;
fn empty() -> Empty { Empty }
#[inline(never)]
fn should_panic(_: Box<u32>, _: Empty) {
panic!("test panic");
}Optimized IR: define internal void @_ZN5panic20hbd7799a4d53a7c18eaaE() unnamed_addr #0 {
entry-block:
%0 = tail call i8* @je_mallocx(i64 4, i32 0)
%1 = icmp eq i8* %0, null
br i1 %1, label %then-block-132-.i.i, label %normal-return
then-block-132-.i.i: ; preds = %entry-block
tail call void @_ZN3oom20h5ea7b8934ca1bc543ZaE()
unreachable
normal-return: ; preds = %entry-block
%2 = bitcast i8* %0 to i32*
store i32 1, i32* %2, align 4
invoke fastcc void @_ZN12should_panic20hfe6f725236e48244xaaE(i32* noalias dereferenceable(4) %2)
to label %normal-return1 unwind label %unwind_custom_
unwind_custom_: ; preds = %normal-return
%3 = landingpad { i8*, i32 } personality i32 (i32, i32, i64, %"1.std::rt::libunwind::_Unwind_Exception"*, %"1.std::rt::libunwind::_Unwind_Context"*)* @rust_eh_personality
cleanup
%4 = icmp eq i8* %0, inttoptr (i64 2097865012304223517 to i8*)
br i1 %4, label %"_ZN14Box$LT$u32$GT$9drop.118117h48c45852b94c565eE.exit", label %cond.i
cond.i: ; preds = %unwind_custom_
tail call void @je_sdallocx(i8* %0, i64 4, i32 0)
br label %"_ZN14Box$LT$u32$GT$9drop.118117h48c45852b94c565eE.exit"
"_ZN14Box$LT$u32$GT$9drop.118117h48c45852b94c565eE.exit": ; preds = %unwind_custom_, %cond.i
resume { i8*, i32 } %3
normal-return1: ; preds = %normal-return
ret void
}
; Function Attrs: noinline noreturn uwtable
define internal fastcc void @_ZN12should_panic20hfe6f725236e48244xaaE(i32* noalias dereferenceable(4)) unnamed_addr #1 {
entry-block:
%const = alloca %str_slice, align 8
%1 = bitcast %str_slice* %const to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* bitcast (%str_slice* @const1222 to i8*), i64 16, i32 8, i1 false)
invoke fastcc void @_ZN2rt6unwind12begin_unwind20h8221535833087833418E(%str_slice* noalias nocapture dereferenceable(16) %const)
to label %normal-return unwind label %unwind_custom_
normal-return: ; preds = %entry-block
call void @llvm.lifetime.end(i64 16, i8* %1)
unreachable
unwind_custom_: ; preds = %entry-block
%2 = landingpad { i8*, i32 } personality i32 (i32, i32, i64, %"1.std::rt::libunwind::_Unwind_Exception"*, %"1.std::rt::libunwind::_Unwind_Context"*)* @rust_eh_personality
cleanup
%3 = icmp eq i32* %0, inttoptr (i64 2097865012304223517 to i32*)
br i1 %3, label %"_ZN14Box$LT$u32$GT$9drop.118117h48c45852b94c565eE.exit", label %cond.i
cond.i: ; preds = %unwind_custom_
%4 = bitcast i32* %0 to i8*
tail call void @je_sdallocx(i8* %4, i64 4, i32 0)
br label %"_ZN14Box$LT$u32$GT$9drop.118117h48c45852b94c565eE.exit"
"_ZN14Box$LT$u32$GT$9drop.118117h48c45852b94c565eE.exit": ; preds = %unwind_custom_, %cond.i
resume { i8*, i32 } %2
}Note that both landing pads have calls to |
This comment has been minimized.
This comment has been minimized.
|
triage: I-nominated |
rust-highfive
added
the
I-nominated
label
Jun 3, 2015
alexcrichton
referenced this issue
Jun 3, 2015
Closed
Safe code causes an "illegal hardware instruction" at runtime #25972
This comment has been minimized.
This comment has been minimized.
|
Test case (for a unit test): struct Foo(i32);
impl Drop for Foo {
fn drop(&mut self) {
static mut DROPPED: bool = false;
unsafe {
assert!(!DROPPED);
DROPPED = true;
}
}
}
struct Empty;
fn empty() -> Empty { Empty }
fn should_panic(_: Foo, _: Empty) {
panic!("test panic");
}
fn main() {
should_panic(Foo(1), empty());
}
|
alexcrichton
added
the
T-compiler
label
Jun 3, 2015
eefriedman
added a commit
to eefriedman/rust
that referenced
this issue
Jun 7, 2015
eefriedman
added a commit
to eefriedman/rust
that referenced
this issue
Jun 7, 2015
eefriedman
added a commit
to eefriedman/rust
that referenced
this issue
Jun 7, 2015
eefriedman
added a commit
to eefriedman/rust
that referenced
this issue
Jun 7, 2015
eefriedman
referenced this issue
Jun 7, 2015
Merged
Clear cached landing pads before generating a call. #26062
This comment has been minimized.
This comment has been minimized.
|
triage: P-medium |
rust-highfive
added
P-medium
and removed
I-nominated
labels
Jun 17, 2015
nikomatsakis
added
the
regression-from-stable-to-nightly
label
Jun 17, 2015
bors
added a commit
that referenced
this issue
Jun 17, 2015
bors
closed this
in
#26062
Jun 17, 2015
brson
added a commit
to brson/rust
that referenced
this issue
Jun 18, 2015
thepowersgang
added a commit
to thepowersgang/rust
that referenced
this issue
Jul 25, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
zummenix commentedMay 4, 2015
I receive
Process didn't exit successfully: ... (signal: 4)doingcargo test.RUST_BACKTRACE=1 cargo testgives nothing. Output:I tried this code:
I expected to see that test is passes.
Meta
rustc --version --verbose: