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

Missing function names (due to overlapping unit ranges?) on debug files of ls #311

Closed
mstange opened this issue Jul 24, 2024 · 2 comments · Fixed by #313
Closed

Missing function names (due to overlapping unit ranges?) on debug files of ls #311

mstange opened this issue Jul 24, 2024 · 2 comments · Fixed by #313

Comments

@mstange
Copy link
Contributor

mstange commented Jul 24, 2024

Updating the addr2line dependency in samply caused test failures, see mstange/samply#310 .

Steps to reproduce:

  1. Have a checkout of the samply repo next to your checkout of this addr2line repo.
  2. Run the following from the root of the addr2line repo: cargo run --features bin --bin addr2line -- -pCfi -e ../samply/fixtures/other/ls-linux/260a3e6e46db57abf718f6a3562c6eedccf269.debug --sup ../samply/fixtures/other/ls-linux/coreutils.debug 0xd6f4

Expected results:

It should print

do_lstat at ./src/ls.c:1184
 (inlined by) gobble_file at ./src/ls.c:3403

Actual results:

It now prints

gobble_file.constprop.0 at ./src/ls.c:1184

This is a regression from #306.

Logging the unit ranges just before the unit_ranges.sort_by_key(|i| i.range.end); call gives the following:

[src/unit.rs:354:9] &mut unit_ranges = [
    UnitRange {
        unit_id: 0,
        min_begin: 0,
        range: Range {
            begin: 15296,
            end: 22632,
        },
    },
    UnitRange {
        unit_id: 0,
        min_begin: 0,
        range: Range {
            begin: 22944,
            end: 68112,
        },
    },
    UnitRange {
        unit_id: 68,
        min_begin: 0,
        range: Range {
            begin: 22944,
            end: 68112,
        },
    },
    UnitRange {
        unit_id: 68,
        min_begin: 0,
        range: Range {
            begin: 15296,
            end: 22632,
        },
    },
    UnitRange {
        unit_id: 69,
        min_begin: 0,
        range: Range {
            begin: 68112,
            end: 84904,
        },
    },
]

It seems that the 22944..68112 range is present twice.

I haven't debugged any further than this.

@philipc
Copy link
Contributor

philipc commented Jul 24, 2024

I'll look into it. This crate needs better tests, maybe I should copy samply's.

@philipc
Copy link
Contributor

philipc commented Jul 25, 2024

The duplicate range is due to a partial unit. Ignoring unit ranges for the partial unit makes it work. It previously worked because the reverse order made us find the compilation unit first. I'm trying to understand more about the partial unit ranges before doing a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants