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
proccontrol: fix process attachment without an exe #147
Conversation
In linux_process::computeAddrWidth(), it's trying to guess the address size without disk access, but commit c8d7481 started opening the exe to figure out its endianness. This is especially a problem if a process was attached without specifying its executable. We can modify the auxv scan to look at *both* little-endian and big- endian words. If either are all zero, we know this is a 64-bit process. We could even report which endian it is from this, although we still wouldn't know that for 32-bit processes.
Commit c8d7481 made `Codegen::generate` start opening the executable to determine the ABI version of the process. However, the llproc exe isn't always set, if the process was attached without specifying it. We can instead get the right path from `proc_->libraries().getExecutable()`.
|
cc @mcfadden8 -- please double-check that this still accomplishes what you needed for PPC64LE. |
|
These changes appear to be right for PPC64LE. I'll download the branch and give the fix a try on the PPC64LE we have here. |
|
I am having difficulty compiling the latest version of the testsuite on PPC64LE. I am seeing the following compilation error: Has anyone else seen this? I'll write up a separate PR in testsuite if I determine that this isn't somthing strange in my environment. |
|
Yeah, I pulled the testsuite and I see the same |
|
Oops. I was writing dyninst/testsuite#11 while you were opening yours |
|
I confirmed that I am able to successfully run the proccontrol testsuite on ppc64le against a version of proccontrol with the above patches applied. Thanks for catching/fixing this. |
|
That's ok, I just cross-referenced it. 😄 |
|
Thanks for confirming! Let's merge it then, and I'll cherry-pick it for master too. |
This fixes two cases where the low-level process was assumed to have a valid executable path, but it may not if a process was attached without ever specifying the exe.
computeAddrWidthwe can rewrite the test to work with both big- and little-endian auxv.Codegen, we can get the executable path from thelibraries()pool instead.Fixes #146