diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1e229f6f..ef52903b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -91,6 +91,11 @@ jobs: env: CARGO_PROFILE_DEV_SPLIT_DEBUGINFO: packed CARGO_PROFILE_TEST_SPLIT_DEBUGINFO: packed + # Test that, on macOS, binaries with no UUID work + - run: cargo clean && cargo test + if: matrix.os == 'macos-latest' + env: + RUSTFLAGS: "-C link-arg=-Wl,-no_uuid" # Test that, on Linux, packed/unpacked debuginfo both work - run: cargo clean && cargo test diff --git a/src/symbolize/gimli/macho.rs b/src/symbolize/gimli/macho.rs index 9d21c7d2..ec567384 100644 --- a/src/symbolize/gimli/macho.rs +++ b/src/symbolize/gimli/macho.rs @@ -22,7 +22,7 @@ impl Mapping { let map = super::mmap(path)?; let (macho, data) = find_header(&map)?; let endian = macho.endian().ok()?; - let uuid = macho.uuid(endian, data, 0).ok()??; + let uuid = macho.uuid(endian, data, 0).ok()?; // Next we need to look for a `*.dSYM` file. For now we just probe the // containing directory and look around for something that matches @@ -30,9 +30,11 @@ impl Mapping { // contains and try to find a macho file which has a matching UUID as // the one of our own file. If we find a match that's the dwarf file we // want to return. - if let Some(parent) = path.parent() { - if let Some(mapping) = Mapping::load_dsym(parent, uuid) { - return Some(mapping); + if let Some(uuid) = uuid { + if let Some(parent) = path.parent() { + if let Some(mapping) = Mapping::load_dsym(parent, uuid) { + return Some(mapping); + } } }