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

bcc/syms: Fix shared lib module offset <-> global addr conversion #4089

Merged

Commits on Jul 5, 2022

  1. bcc/syms: Fix shared lib module offset <-> global addr conversion

    `bcc` does various conversions of "global address" to "module offset" and
    vice versa. Previous work (iovisor#1670) modified the "global address" ->
    "module offset" calculation in `ProcSyms::Module::contains` to account
    for differences between the file offset a section is loading bytes from
    and the requested start address (relative to the base address of the
    `.so`). Unfortunately that change didn't also modify "module offset" ->
    "global address" calculations, such as the one in
    bcc_resolve_global_addr. Update that calculation to account for the
    same.
    
    This calculation discrepancy was most apparent for us in production when
    trying to attach USDTs to a shared lib with differing requested start
    address and file offset. This patch also adds a test w/ comments
    describing our specific situation and demonstrating how the patch fixes
    the issue.
    
    Signed-off-by: Dave Marchevsky <[email protected]>
    davemarchevsky committed Jul 5, 2022
    Configuration menu
    Copy the full SHA
    4b3cbf4 View commit details
    Browse the repository at this point in the history