Skip to content

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

Closed
@JohnColanduoni

Description

@JohnColanduoni

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

Metadata

Metadata

Assignees

Labels

A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.O-macosOperating system: macOSP-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions