-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Process didn't exit successfully: ... (signal: 4) in tests #25089
Labels
A-codegen
Area: Code generation
I-crash
Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
P-medium
Medium priority
regression-from-stable-to-nightly
Performance or correctness regression from stable to nightly.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
Try using lldb to get a stacktrace:
|
|
sfackler
added
the
I-crash
Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
label
May 4, 2015
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 |
triage: I-nominated |
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
Relevant to the compiler team, which will review and decide on the PR/issue.
label
Jun 3, 2015
eefriedman
added a commit
to eefriedman/rust
that referenced
this issue
Jun 7, 2015
Using the wrong landing pad has obvious bad effects, like dropping a value twice. Testcase written by Alex Crichton. Fixes rust-lang#25089.
triage: P-medium |
nikomatsakis
added
the
regression-from-stable-to-nightly
Performance or correctness regression from stable to nightly.
label
Jun 17, 2015
bors
added a commit
that referenced
this issue
Jun 17, 2015
Using the wrong landing pad has obvious bad effects, like dropping a value twice. Testcase written by Alex Crichton. Fixes #25089.
brson
pushed a commit
to brson/rust
that referenced
this issue
Jun 18, 2015
Using the wrong landing pad has obvious bad effects, like dropping a value twice. Testcase written by Alex Crichton. Fixes rust-lang#25089.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-codegen
Area: Code generation
I-crash
Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
P-medium
Medium priority
regression-from-stable-to-nightly
Performance or correctness regression from stable to nightly.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I receive
Process didn't exit successfully: ... (signal: 4)
doingcargo test
.RUST_BACKTRACE=1 cargo test
gives nothing. Output:I tried this code:
I expected to see that test is passes.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: