Skip to content
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

rustc --test produces size zero dSYM image on macOS #45768

Closed
JohnColanduoni opened this issue Nov 4, 2017 · 6 comments
Closed

rustc --test produces size zero dSYM image on macOS #45768

JohnColanduoni opened this issue Nov 4, 2017 · 6 comments
Assignees
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) C-bug Category: This is a bug. O-macos Operating system: macOS P-high High 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

@JohnColanduoni
Copy link
Contributor

Running rustc --test -g main.rs with any of the following in main.rs on macOS:

#[test]
fn test_1() {
    assert!(false);
}
fn main() {
}
// Empty

Produces a main.dSYM containing an empty file at main.dSYM/Contents/Resources/DWARF/main. A bug in Rust's libbacktrace (courtesy of myself) causes any attempt to take a backtrace while such a dSYM file is present in the same directory as the executable (even if it is not produced from that executable) to die of SIGBUS. Even without that, this prevents both panic backtraces and debugging from taking advantage of debug data with executables containing test harnesses on macOS. As @alexcrichton determined, this is a regression in the range 4279e2b...8493813 and likely related to #45511.

cc @alexcrichton @kennytm

@sfackler sfackler added the regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. label Nov 4, 2017
@kennytm kennytm added A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. O-macos Operating system: macOS labels Nov 6, 2017
@alexcrichton
Copy link
Member

Hmm... An empty file sound suspiciously not like an LLVM bug. I believe we run, after the fact, dsymutil when linking is complete. I wonder if that program is generating an error which rustc is squelching by accident? Mind seeing if dsymutil is aborting and/or dying?

@kennytm kennytm removed the A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. label Nov 7, 2017
@Xudong-Huang
Copy link

Xudong-Huang commented Nov 8, 2017

I saw a lot of llvm-dsymutil core dumps during runing cargo test
my system info

$ cd ~/Library/Logs/DiagnosticReports
$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.12.6
BuildVersion:	16G1036

$ clang --version
Apple LLVM version 9.0.0 (clang-900.0.38)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

$ rustup show
Default host: x86_64-apple-darwin

installed toolchains
--------------------

stable-x86_64-apple-darwin
nightly-x86_64-apple-darwin (default)

active toolchain
----------------

nightly-x86_64-apple-darwin (default)
rustc 1.23.0-nightly (bd0e45a32 2017-11-06)

$ rustc --version
rustc 1.23.0-nightly (bd0e45a32 2017-11-06)

$ ll
total 112
-rw-------@ 1 huangxudong  staff    27K Nov  8 15:36 llvm-dsymutil_2017-11-08-153625_huangxudongs-Mac-Book-Pro.crash
-rw-------@ 1 huangxudong  staff    27K Nov  8 15:36 llvm-dsymutil_2017-11-08-153627_huangxudongs-Mac-Book-Pro.crash

please see
llvm-dsymutil_2017-11-08-153625_huangxudongs-Mac-Book-Pro.crash.txt

@JohnColanduoni
Copy link
Contributor Author

This is no longer happening for me on current master (e177df3).

@nikomatsakis nikomatsakis added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Nov 9, 2017
@nikomatsakis
Copy link
Contributor

triage: P-high

Do we believe this is fixed?

@nikomatsakis
Copy link
Contributor

Assigning to @alexcrichton since probably related to ThinLTO.

alexcrichton added a commit to alexcrichton/rust that referenced this issue Nov 10, 2017
Right now ThinLTO is generating bad dwarf which is tracked by rust-lang#45511, but this
is causing issues on OSX (rust-lang#45768) where `dsymutil` is segfaulting and failing to
produce output.

Closes rust-lang#45768
@alexcrichton
Copy link
Member

I've posted a fix for this as #45908, we can reenable ThinLTO when #45511 is fixed

bors added a commit that referenced this issue Nov 12, 2017
…imulacrum

rustbuild: Disable ThinLTO for libtest

Right now ThinLTO is generating bad dwarf which is tracked by #45511, but this
is causing issues on OSX (#45768) where `dsymutil` is segfaulting and failing to
produce output.

Closes #45768
alexcrichton added a commit to alexcrichton/rust that referenced this issue Nov 20, 2017
This commit updates LLVM to fix rust-lang#45511 (https://reviews.llvm.org/D39981) and
also reenables ThinLTO for libtest now that we shouldn't hit rust-lang#45768. This also
opportunistically enables ThinLTO for libstd which was previously blocked
(rust-lang#45661) on test failures related to debuginfo with a presumed cause of rust-lang#45511.

Closes rust-lang#45511
bors added a commit that referenced this issue Nov 22, 2017
rustbuild: Update LLVM and enable ThinLTO

This commit updates LLVM to fix #45511 (https://reviews.llvm.org/D39981) and
also reenables ThinLTO for libtest now that we shouldn't hit #45768. This also
opportunistically enables ThinLTO for libstd which was previously blocked
(#45661) on test failures related to debuginfo with a presumed cause of #45511.

Closes #45511
alexcrichton added a commit to alexcrichton/rust that referenced this issue Nov 24, 2017
This commit updates LLVM to fix rust-lang#45511 (https://reviews.llvm.org/D39981) and
also reenables ThinLTO for libtest now that we shouldn't hit rust-lang#45768. This also
opportunistically enables ThinLTO for libstd which was previously blocked
(rust-lang#45661) on test failures related to debuginfo with a presumed cause of rust-lang#45511.

Closes rust-lang#45511
bors added a commit that referenced this issue Nov 25, 2017
rustbuild: Update LLVM and enable ThinLTO

This commit updates LLVM to fix #45511 (https://reviews.llvm.org/D39981) and
also reenables ThinLTO for libtest now that we shouldn't hit #45768. This also
opportunistically enables ThinLTO for libstd which was previously blocked
(#45661) on test failures related to debuginfo with a presumed cause of #45511.

Closes #45511
ritiek added a commit to ritiek/rust that referenced this issue Nov 26, 2017
MIR: adopt borrowck test

Fix trailing whitespace

span_bug! on unexpected action

Make RegionVid use newtype_index!

Closes rust-lang#45843

Check rvalue aggregates during check_stmt in tycheck, add initial, (not passing) test

Fix failing test

Remove attributes and test comments accidentally left behind, add in span_mirbugs

Normalize LvalueTy for ops and format code to satisfy tidy check

only normalize operand types when in an ADT constructor

avoid early return

handle the active field index in unions

normalize types in ADT constructor

Fixes rust-lang#45940

Fix borrowck compiler errors for upvars contain "spurious" dereferences

Fixes rust-lang#46003

added associated function Box::leak

Box::leak - improve documentation

Box::leak - fixed bug in documentation

Box::leak - relaxed constraints wrt. lifetimes

Box::leak - updated documentation

Box::leak - made an oops, fixed now =)

Box::leak: update unstable issue number (46179).

Add test for rust-lang#44953

Add missing Debug impls to std_unicode

Also adds #![deny(missing_debug_implementations)] so they don't get
missed again.

Amend RELEASES for 1.22.1

and fix the date for 1.22.0

Rename param in `[T]::swap_with_slice` from `src` to `other`.

The idea of ‘source’ and ‘destination’ aren’t very applicable for this
operation since both slices can both be considered sources and
destinations.

Clarify stdin behavior of `Command::output`.

Fixes rust-lang#44929.

Add hints for the case of confusing enum with its variants

Add failing testcases

Add module population and case of enum in place of expression

Use for_each_child_stable in find_module

Use multiline text for crate conflict diagnostics

Make float::from_bits transmute (and update the documentation to reflect this).

The current implementation/documentation was made to avoid sNaN because of
potential safety issues implied by old/bad LLVM documentation. These issues
aren't real, so we can just make the implementation transmute (as permitted
by the existing documentation of this method).

Also the documentation didn't actually match the behaviour: it said we may
change sNaNs, but in fact we canonicalized *all* NaNs.

Also an example in the documentation was wrong: it said we *always* change
sNaNs, when the documentation was explicitly written to indicate it was
implementation-defined.

This makes to_bits and from_bits perfectly roundtrip cross-platform, except
for one caveat: although the 2008 edition of IEEE-754 specifies how to
interpet the signaling bit, earlier editions didn't. This lead to some platforms
picking the opposite interpretation, so all signaling NaNs on x86/ARM are quiet
on MIPS, and vice-versa.

NaN-boxing is a fairly important optimization, while we don't even guarantee
that float operations properly preserve signalingness. As such, this seems like
the more natural strategy to take (as opposed to trying to mangle the signaling
bit on a per-platform basis).

This implementation is also, of course, faster.

Simplify an Iterator::fold to Iterator::any

This method of once-diagnostics doesn't allow nesting

UI tests extract the regular output from the 'rendered' field in json

Merge cfail and ui tests into ui tests

Add a MIR pass to lower 128-bit operators to lang item calls

Runs only with `-Z lower_128bit_ops` since it's not hooked into targets yet.

Include tuple projections in MIR tests

Add type checking for the lang item

As part of doing so, add more lang items instead of passing u128 to the i128 ones where it doesn't matter in twos-complement.

Handle shifts properly

* The overflow-checking shift items need to take a full 128-bit type, since they need to be able to detect idiocy like `1i128 << (1u128 << 127)`
* The unchecked ones just take u32, like the `*_sh?` methods in core
* Because shift-by-anything is allowed, cast into a new local for every shift

incr.comp.: Make sure we don't lose unused green results from the query cache.

rustbuild: Update LLVM and enable ThinLTO

This commit updates LLVM to fix rust-lang#45511 (https://reviews.llvm.org/D39981) and
also reenables ThinLTO for libtest now that we shouldn't hit rust-lang#45768. This also
opportunistically enables ThinLTO for libstd which was previously blocked
(rust-lang#45661) on test failures related to debuginfo with a presumed cause of rust-lang#45511.

Closes rust-lang#45511

std: Flag Windows TLS dtor symbol as #[used]

Turns out ThinLTO was internalizing this symbol and eliminating it. Worse yet if
you compiled with LTO turns out no TLS destructors would run on Windows! The
`#[used]` annotation should be a more bulletproof implementation (in the face of
LTO) of preserving this symbol all the way through in LLVM and ensuring it makes
it all the way to the linker which will take care of it.

Add enum InitializationRequiringAction

Fix tidy tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) C-bug Category: This is a bug. O-macos Operating system: macOS P-high High 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.
Projects
None yet
Development

No branches or pull requests

7 participants