Closed
Description
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
ResumeInst needs to be in a function with a personality.
resume { i8*, i32 } %3
LLVM ERROR: Broken function found, compilation aborted!
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!
Activity
dylanmckay commentedon Sep 26, 2016
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:
dylanmckay commentedon Sep 26, 2016
Pretty sure we duplicated a bunch of stuff
shepmaster commentedon Sep 26, 2016
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.
dylanmckay commentedon Sep 26, 2016
The branch I linked before has my WIP stuff
shepmaster commentedon Sep 26, 2016
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.
dylanmckay commentedon Sep 26, 2016
Yeah I am
Other differences I can see:
configure
script like myselfshepmaster commentedon Sep 26, 2016
Yeah, for a long time the
configure
script couldn't handle the CMake-based LLVM. That was addressed when they wanted to upgrade to 3.9 for Emscripten, but I'm still used to the way that I got working ;-)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...
dylanmckay commentedon Sep 26, 2016
I'm merging our two branches, and will prune stuff and see if I can get a build working
shepmaster commentedon Sep 26, 2016
👍 I'll be off to bed shortly. I'll expect a magically working compiler in the morning 😈
shepmaster commentedon Sep 26, 2016
Woo, my last hail-Mary effort worked. I guess something doesn't quite get rebuilt properly all the time, so my
make clean
helped:dylanmckay commentedon Sep 26, 2016
I've also gotten the
ResumeInst
error after merging the two branches. I'll try cleaning and rebuildingdylanmckay commentedon Sep 26, 2016
I've rebuilt twice and am still getting that error, weird.
dylanmckay commentedon Sep 26, 2016
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 commentedon Sep 29, 2016
I've got a very hacky reproduction:
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.
8 remaining items
dylanmckay commentedon Oct 1, 2016
I've opened #20, although it currently causes a segfault.
dylanmckay commentedon Oct 1, 2016
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
dylanmckay commentedon Oct 1, 2016
I've fixed the segfault and am upstreaming it in rust-lang#36896
Found another segfault
shepmaster commentedon Oct 2, 2016
I think this is the most recent segfault:
shepmaster commentedon Oct 2, 2016
I got my debugging info setup correctly:
so
Parent
andStart
are null. I did cherry-pick your change c9ec72ab8f1ee61644d41db8ebe19757336bcffb.I don't understand how this code could ever work if
nullptr
is hardcoded...dylanmckay commentedon Oct 3, 2016
I'm looking at that too. I believe this was broken in r276686. There is still a default constructor for
Archive::Child
but it givesnullptr
as theParent
which will always segfault. Nobody must've noticed this in code review.Upstream LLVM regression :(
shepmaster commentedon Oct 3, 2016
So what's the right process here?
dylanmckay commentedon Oct 3, 2016
We can email
llvm-commits
and CC in the original author, or we could fix it ourselves and I could upstream it.The fix will basically be to change this in
Archive.cpp
So that it handles
Parent
being null. One issue is thatHeader
itself doesn't have a default constructor, and it is a non-nullable field onArchive::Child
so it's not as easy as calling a different constructor.dylanmckay commentedon Oct 4, 2016
I've just sent an email to
llvm-commits
CCing @shepmaster and the original author.dylanmckay commentedon Oct 5, 2016
Lang Hames is currently working on a fix, we should be able to update LLVM again after that and we should be good.
dylanmckay commentedon Oct 6, 2016
This has been fixed as of r283387. I'm merging master in again now.
dylanmckay commentedon Oct 6, 2016
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.
dylanmckay commentedon Oct 6, 2016
The
ResumeInst
thing has been fixed, I'm now raising #22 to look at the current error I'm getting.