Navigation Menu

Skip to content
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.

symbol: Account for prelinked shared objects #148

Merged
merged 1 commit into from Jun 26, 2018

Conversation

amboar
Copy link
Contributor

@amboar amboar commented May 4, 2018

Some projects, such as those derived from Yocto, tend to prelink their
binaries and libraries to reduce runtime overhead. Currently this trips
up pyflame in its symbol address calculations, and leads to ptrace
failures due to spurious addresses:

$ pyflame -t python -c "print 'foo'"
Unexpected ptrace(2) exception: Failed to PTRACE_PEEKDATA (pid 1482, addr 0x9f9b1d70): Input/output error
Unexpected ptrace(2) exception: Failed to PTRACE_PEEKDATA (pid 1482, addr 0x9f9b1d70): Input/output error
Unexpected ptrace(2) exception: Failed to PTRACE_PEEKDATA (pid 1482, addr 0x9f9b1d70): Input/output error
Unexpected ptrace(2) exception: Failed to PTRACE_PEEKDATA (pid 1482, addr 0x9f9b1d70): Input/output error
Unexpected ptrace(2) exception: Failed to PTRACE_PEEKDATA (pid 1482, addr 0x9f9b1d70): Input/output error
...

Add support for reading a prelinked base p_vaddr out of the ELF and
adjust the PyAddresses values accordingly.

Signed-off-by: Andrew Jeffery andrew@aj.id.au

Some projects, such as those derived from Yocto, tend to prelink their
binaries and libraries to reduce runtime overhead. Currently this trips
up pyflame in its symbol address calculations, and leads to ptrace
failures due to spurious addresses:

   $ pyflame -t python -c "print 'foo'"
   Unexpected ptrace(2) exception: Failed to PTRACE_PEEKDATA (pid 1482, addr 0x9f9b1d70): Input/output error
   Unexpected ptrace(2) exception: Failed to PTRACE_PEEKDATA (pid 1482, addr 0x9f9b1d70): Input/output error
   Unexpected ptrace(2) exception: Failed to PTRACE_PEEKDATA (pid 1482, addr 0x9f9b1d70): Input/output error
   Unexpected ptrace(2) exception: Failed to PTRACE_PEEKDATA (pid 1482, addr 0x9f9b1d70): Input/output error
   Unexpected ptrace(2) exception: Failed to PTRACE_PEEKDATA (pid 1482, addr 0x9f9b1d70): Input/output error
   ...

Add support for reading a prelinked base p_vaddr out of the ELF and
adjust the PyAddresses values accordingly.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
@CLAassistant
Copy link

CLAassistant commented May 4, 2018

CLA assistant check
All committers have signed the CLA.

@amboar
Copy link
Contributor Author

amboar commented May 4, 2018

I'm chasing up the CLA with the lawyers, hopefully will be able to sign it soon.

@amboar
Copy link
Contributor Author

amboar commented Jun 18, 2018

Is there anything I can do to move this along? I've signed the CLA.

@eklitzke
Copy link
Collaborator

This change, and your other PR, both look good and I will release a new version with both changes!

I apologize for the delay in merging; I don't work at Uber any longer, so I poll this project on an irregular interval.

@eklitzke eklitzke merged commit bb4fb28 into uber-archive:master Jun 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants