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 upstd: Move pc-windows-gnu to SEH-based unwinding #31313
Conversation
rust-highfive
assigned
nikomatsakis
Jan 30, 2016
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
(rust_highfive has picked a reviewer for you, use r? to override) |
rust-highfive
assigned
brson
and unassigned
nikomatsakis
Jan 30, 2016
alexcrichton
force-pushed the
alexcrichton:gnu-seh
branch
2 times, most recently
from
821c985
to
4fa32ee
Jan 31, 2016
This comment has been minimized.
This comment has been minimized.
|
すてき |
This comment has been minimized.
This comment has been minimized.
Windows back traces being bad have very little to do with how unwinding is done, but rather with debug info. Symbol names are only preserved in the debug info and Windows is incapable of reading dwarf debug info and I highly doubt mingw is capable of emitting PDB/codeview debug info. If we want |
alexcrichton
force-pushed the
alexcrichton:gnu-seh
branch
from
c002554
to
4fa32ee
Jan 31, 2016
This comment has been minimized.
This comment has been minimized.
|
|
alexcrichton
force-pushed the
alexcrichton:gnu-seh
branch
from
4fa32ee
to
d8f9d20
Jan 31, 2016
This comment has been minimized.
This comment has been minimized.
alexcrichton
referenced this pull request
Jan 31, 2016
Closed
rustc_trans: Append to PATH instead of prepending #31131
This comment has been minimized.
This comment has been minimized.
|
I only got working backtraces two weeks ago (#30908) Unfortunately, that may not be possible. AFAIK #31319 won't help gnu since CodeView debuginfo is (again AFAIK) useless without an MSVC edit: see Clang documentation |
This comment has been minimized.
This comment has been minimized.
|
@rkruppe yeah I was hoping to leave in libbacktrace for GNU for now, but it unfortunately would still require using MinGW's support for unwinding the stack (e.g.
I am curious what others think though! My personal priorities may be a bit backwards relative to others' :) |
This comment has been minimized.
This comment has been minimized.
This is correct. We already rely on Windows to walk the stack to get a backtrace for If we did transition the |
This comment has been minimized.
This comment has been minimized.
|
If we did end up fully transitioning to only MSVC compilers we'd probably consider dropping support for the GNU ones yeah, but I should emphasize that these are just thoughts in my head and would certainly be very far out. Not necessarily any consensus on this strategy among anyone but me! |
This comment has been minimized.
This comment has been minimized.
|
To be frank I'm not attached to mingw, it's just what I've always been using to develop. I'm currently trying to build from source w/ MSVC and if that works, I will instantly stop caring about the |
This comment has been minimized.
This comment has been minimized.
MSVC is 10GB for link.exe. Its pain to install that instead of MinGW if you only need (to debug, in my case) Windows rustc, as opposed to MSVC Rust :) |
This comment has been minimized.
This comment has been minimized.
|
Sorry I don't mean to sidetrack discussion here, I don't think this is an appropriate location to discuss switching between |
This comment has been minimized.
This comment has been minimized.
I believe the point is that there will still be compilers that target |
This comment has been minimized.
This comment has been minimized.
Let's have a place then, so we can have a discussion before we start rolling in this direction. Should this be in the RFCs repo? |
This comment has been minimized.
This comment has been minimized.
Nobody is suggesting to deprecate |
This comment has been minimized.
This comment has been minimized.
|
|
alexcrichton
force-pushed the
alexcrichton:gnu-seh
branch
from
d8f9d20
to
246b50f
Feb 1, 2016
This comment has been minimized.
This comment has been minimized.
|
This looks like a good consolidation. I'm inclined to break stack traces again for it unless it's possible to rig up something to read the dwarf symbol info in short order. |
This comment has been minimized.
This comment has been minimized.
|
I checked briefly and there's no way to at least configure libbacktrace to only have symbol-demangling support, so I suspect there's nothing too too easy we could do to get a dwarf reader. In theory it's not too hard to write though... |
This comment has been minimized.
This comment has been minimized.
|
After the fix in #30908 libbacktrace still doesn't work properly with PE/COFF. It does show function names instead of |
This comment has been minimized.
This comment has been minimized.
|
Finally found the time to go through this PR. Impressive work! A note regarding rsbegin, rsend and LSDA parser: I wrote this code thinking that eventually we'd use them for Unix-y targets as well,- to reduce reliance on the GCC runtime. Is this something we'd want to do? |
alexcrichton
force-pushed the
alexcrichton:gnu-seh
branch
from
b3b1d75
to
793e80d
Feb 7, 2016
This comment has been minimized.
This comment has been minimized.
|
|
alexcrichton
force-pushed the
alexcrichton:gnu-seh
branch
from
793e80d
to
3299609
Feb 8, 2016
This comment has been minimized.
This comment has been minimized.
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
|
|
brson
added
the
relnotes
label
Feb 8, 2016
bors
added a commit
that referenced
this pull request
Feb 8, 2016
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
alexcrichton
force-pushed the
alexcrichton:gnu-seh
branch
from
3299609
to
b2a53fe
Feb 8, 2016
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Feb 9, 2016
This comment has been minimized.
This comment has been minimized.
|
|
alexcrichton
force-pushed the
alexcrichton:gnu-seh
branch
from
b2a53fe
to
7c7ecb4
Feb 9, 2016
This comment has been minimized.
This comment has been minimized.
alexcrichton
force-pushed the
alexcrichton:gnu-seh
branch
from
7c7ecb4
to
0487292
Feb 9, 2016
This comment has been minimized.
This comment has been minimized.
|
You appear to have r+'d the wrong commit |
This comment has been minimized.
This comment has been minimized.
|
@bors r=brson |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
|
tamird
reviewed
Feb 9, 2016
| /// This is only true for MSVC targets, and even then the 64-bit MSVC target | ||
| /// currently uses SEH-ish unwinding with DWARF info tables to the side (same as | ||
| /// 64-bit MinGW) instead of "full SEH". | ||
| /// This is currentlyt true for all Windows targets. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Well it appears I was a little too eager to land this, and I didn't thoroughly test it enough locally before doing so. My testing was all on It turns out that if LLVM has assertions enabled, they specifically have a check against this which means that we can't actually use funclets (the new exception handling things) on Basically it looks like this just isn't supported at this time for Alas! |
alexcrichton
closed this
Feb 9, 2016
This comment has been minimized.
This comment has been minimized.
|
Note that my threshold for "this doesn't work" is:
target triple = "i686-pc-windows-gnu"
define void @bar() {
ret void
}
define void @main() personality i32 (...)* @_except_handler3 {
entry-block:
invoke void @bar()
to label %exit unwind label %bad
exit:
ret void
bad:
%pad = cleanuppad within none []
cleanupret from %pad unwind to caller
}
declare i32 @_except_handler3(...)
Note that the MSVC |
alexcrichton
deleted the
alexcrichton:gnu-seh
branch
Feb 9, 2016
This comment has been minimized.
This comment has been minimized.
|
Is there an upstream issue? Should there be? |
This comment has been minimized.
This comment has been minimized.
|
In theory, yes. I chatted briefly in |
alexcrichton commentedJan 30, 2016
This commit moves the
*-pc-windows-gnutargets (e.g. the MinGW targets) touse SEH-based unwinding instead of libunwind-based unwinding. There are a number
of ramifications on these targets as a result:
particular compiler toolchain. The MinGW toolchains typically ship with either
SEH, Dwarf, or SjLj based unwinding and are binary-incompatible, but with SEH
unwinding we'll be able to link with any of the toolchains.
the amount of duplicated code we'll have to maintain (yay!).
longer used on Windows. The same unwinding code for MSVC is now used for GNU
as well, and unfortunately this has empirically led to worse stack traces in
the past. In theory, though, this should be fixed for both MSVC and GNU at the
same time!
rsend.oand
rsbegin.ostartup object files are no longer built. Additionally thecrt2.oanddllcrt2.ofiles are no longer distributed. It's assumed thatthe linker in use will inject these as usual. The
-nostdlibflag is nolonger passed to the linker to indicate this.
This change also opened up the possibility to reorganize a few modules, so the
following changes were also made:
custom_unwind_resumeoption and all support code was removed from transas this is no longer necessary.
sys_common::unwindmodule was refactored to have the platform-specificportions live in
sys::unwind.files around).
affairs.