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 upResumeInst needs to be in a function with a personality #18
Comments
This comment has been minimized.
This comment has been minimized.
|
Interesting, I'm not getting that. I've been working off the branch you pushed before https://github.com/avr-rust/rust/commits/avr-support-4.0 I am getting this error though:
|
This comment has been minimized.
This comment has been minimized.
|
Pretty sure we duplicated a bunch of stuff |
This comment has been minimized.
This comment has been minimized.
That wouldn't be too surprising, but I definitely hacked-and-slashed some stuff to get it working. There's a few places where I lost functionality. Do you have a branch of your in-progress changes? Maybe something will jump out at us if we compare the two. |
This comment has been minimized.
This comment has been minimized.
|
The branch I linked before has my WIP stuff |
This comment has been minimized.
This comment has been minimized.
|
Oh, I didn't even notice it was in this repo ;-) I do notice that you are building LLVM inside of the Rust directory; are you letting the Rust build process drive that? I've got LLVM built in a separate directory and am linking to it. |
This comment has been minimized.
This comment has been minimized.
Yeah I am Other differences I can see:
|
This comment has been minimized.
This comment has been minimized.
Yeah, for a long time the
I don't know that there's a bunch more, but I think I changed it from the initial commit because I got missing symbol errors, which might be fixed from your inclusion of the Objective-C library... |
This comment has been minimized.
This comment has been minimized.
|
I'm merging our two branches, and will prune stuff and see if I can get a build working |
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
|
Woo, my last hail-Mary effort worked. I guess something doesn't quite get rebuilt properly all the time, so my ; Function Attrs: inlinehint uwtable
define internal void @_ZN4core3mem6forget17h6a12bc5fd51e1250E(i64) unnamed_addr #2 !dbg !633 {
entry-block:
%arg0 = alloca i64
%t = alloca i64
%personalityslot = alloca { i8*, i32 }
store i64 %0, i64* %arg0
call void @llvm.dbg.declare(metadata i64* %arg0, metadata !641, metadata !642), !dbg !643
call void @llvm.dbg.declare(metadata i64* %t, metadata !644, metadata !642), !dbg !646
br label %start
start: ; preds = %entry-block
%1 = load i64, i64* %arg0, !dbg !647
store i64 %1, i64* %t, !dbg !647
%2 = load i64, i64* %t, !dbg !648
br label %bb2, !dbg !648
bb1: ; No predecessors!
%3 = load { i8*, i32 }, { i8*, i32 }* %personalityslot, !dbg !647
resume { i8*, i32 } %3
bb2: ; preds = %start
ret void, !dbg !646
} |
This comment has been minimized.
This comment has been minimized.
|
I've also gotten the |
This comment has been minimized.
This comment has been minimized.
|
I've rebuilt twice and am still getting that error, weird. |
This comment has been minimized.
This comment has been minimized.
|
Looks like others have had this bug before too https://botbot.me/mozilla/rust-internals/2016-08-11/?msg=71118645&page=1 That must mean that it's unrelated to our changes, and is an incompatibility between LLVM 4.0 and 3.9 nagisa suggests that it's likely to be an ABI incompatibility that's causing it. |
shepmaster
referenced this issue
Sep 26, 2016
Closed
LLVM_VERSION_MINOR is 0 in LLVM trunk now #36295
This comment has been minimized.
This comment has been minimized.
|
I've got a very hacky reproduction: #![feature(lang_items)]
#![feature(start)]
#![feature(intrinsics)]
#![feature(no_core)]
#![feature(on_unimplemented)]
#![feature(fundamental)]
#![no_std]
#![no_core]
#[start]
fn start(_argc: isize, _argv: *const *const u8) -> isize {
forget(42);
0
}
#[lang = "eh_personality"]
extern fn eh_personality() {}
#[lang = "panic_fmt"]
extern fn panic_fmt() -> ! { loop {} }
mod intrinsics {
extern "rust-intrinsic" {
pub fn forget<T>(_: T) -> ();
}
}
#[inline]
pub fn forget<T>(t: T) {
unsafe { intrinsics::forget(t) }
}
#[lang = "sized"]
#[rustc_on_unimplemented = "`{Self}` does not have a constant size known at compile-time"]
#[fundamental]
pub trait Sized {}
#[lang = "copy"]
pub trait Copy {}And this is how I reproduce
Really, I'm running that process in LLDB, but it forks the real compiler, so I need to do something like:
Doing this, I break at the following frames:
So it currently looks like we are indeed not setting the personality on the function. |
This comment has been minimized.
This comment has been minimized.
|
Sounds like an upstream Rust bug, perhaps we should raise it there? |
This comment has been minimized.
This comment has been minimized.
|
Perhaps. I'm never quite sure how upstream wants to treat LLVM upgrades that they don't need directly. I suppose I could open an issue there later today with the appropriate information. In the worst case, they can close it. |
This comment has been minimized.
This comment has been minimized.
|
@shepmaster: Does this occur when disabling MIR and using the old backend? |
This comment has been minimized.
This comment has been minimized.
|
I'm... not sure how to disable MIR anymore... I'm looking, but maybe you recall? |
This comment has been minimized.
This comment has been minimized.
|
Maybe it was permanently enabled? cb9b0ed |
This comment has been minimized.
This comment has been minimized.
|
Looks like you're right, that's tricky. I do think it's weird that the only things being done in the IR you posted before:
I don't think any of this would trigger exceptions, it does literally nothing (as per the definition of call void @llvm.dbg.declare(metadata i64* %arg0, metadata !641, metadata !642), !dbg !643
call void @llvm.dbg.declare(metadata i64* %t, metadata !644, metadata !642), !dbg !646 |
This comment has been minimized.
This comment has been minimized.
|
The IR validator for 'ResumeInst must be in a function with a personality' was introduced in LLVM commit r277360. We could always quick-fix this by reverting the commit on our fork of LLVM. |
This comment has been minimized.
This comment has been minimized.
|
I think I may have fixed the bug, will keep this updated. |
This comment has been minimized.
This comment has been minimized.
|
I've opened #20, although it currently causes a segfault. |
This comment has been minimized.
This comment has been minimized.
|
I'm pretty happy to revert out the verifier addition in LLVM that caused this breakage and not think about it until upstream Rust fixes this when they next update LLVM tbh |
This comment has been minimized.
This comment has been minimized.
|
I've fixed the segfault and am upstreaming it in rust-lang#36896 Found another segfault |
dylanmckay
referenced this issue
Oct 2, 2016
Closed
Set EH personality when resuming stack unwinding #36895
This comment has been minimized.
This comment has been minimized.
|
I think this is the most recent segfault:
|
This comment has been minimized.
This comment has been minimized.
|
I got my debugging info setup correctly:
so I don't understand how this code could ever work if |
This comment has been minimized.
This comment has been minimized.
|
I'm looking at that too. I believe this was broken in r276686. There is still a default constructor for Upstream LLVM regression :( |
This comment has been minimized.
This comment has been minimized.
So what's the right process here? |
This comment has been minimized.
This comment has been minimized.
|
We can email The fix will basically be to change this in Archive::Child::Child(const Archive *Parent, const char *Start, Error *Err)
: Parent(Parent), Header(Parent, Start, Parent->getData().size() -
(Start - Parent->getData().data()), Err) {So that it handles |
This comment has been minimized.
This comment has been minimized.
|
I've just sent an email to |
This comment has been minimized.
This comment has been minimized.
|
Lang Hames is currently working on a fix, we should be able to update LLVM again after that and we should be good. |
This comment has been minimized.
This comment has been minimized.
|
This has been fixed as of r283387. I'm merging master in again now. |
This comment has been minimized.
This comment has been minimized.
|
I needed to rebase on top of master again because Rust stopped building with Apple Clang 8, more merge conflicts, JS backend added, etc. I think I'm on top of it now, we'll see how this build goes. |
This comment has been minimized.
This comment has been minimized.
|
The |
shepmaster commentedSep 26, 2016
Trying to update to avr-llvm/llvm@3c0d2ad, I've made some good progress and some nasty hacks, but now I'm stuck at this intriguing LLVM error
Unfortunately, I have not been able to generate an LLVM IR dump of the invalid input before the failure occurs, and I can't get useful debugging symbols in LLVM or add debugging prints to the LLVM codebase. Frustrating!