-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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 does not pick the right libraries #525
Comments
Not sure I understand the full issue or suggestion here. As it is now, we're just using standard gcc logic when compiling. If you run |
Oh, I probably should have explained better. The problem actually shows up at runtime and not while building bcc itself. In this case, it is with test_uprobes.py:
In test_uprobes.py, we use the below line to place a probe at malloc_stats() in libc: b.attach_uprobe(name="c", sym="malloc_stats", fn_name="count") This triggers a search for libc, which on powerpc ends up picking the wrong library to place the probe (/lib64/power8/libc.so.6 rather than /lib64/libc.so.6). As such, the probe never fires. The reason we pick the wrong library is because we are not considering the hwcap associated with the library. |
Yes, thanks for explaining, that certainly makes more sense! Actually the problem seems obvious in retrospect but its been a busy morning so far :) |
Just ran into this issue while building / testing on Debian 8 amd64.
Looks like
@rnav, would you mind doing the same check with python and |
Ugh. That's not it either...
It's definitely defined, and after reading the man page for
So something about that bpf probe didn't fire correctly... |
@mprzybylski you can put in a |
I thought of using the aux vector to figure out the hardware capabilities before picking up the right library, but with 32-bit and 64-bit libraries, that may not be enough. Perhaps we should just put a probe on all matching libraries? |
We discussed the same bug in #853. Sorry I didn't drop a note here before. #875 is a first pull request to improve this situation (I plan to update it this week-end). It tries to attach to the library that's currently loaded into the target process, if one is given. I also started working on the second strategy discussed in #853 (using the running architecture of the bcc process to help select the appropriate library), but I don't have much time, so it might take longer. If anyone else wants to take care of that one, please go ahead 😃 |
@rnav, sure enough, this is general problem for multiarch platforms. Thanks for pointing me in the right direction.
|
Hi @pchaigno which patches should be applied to make the test pass ? Right now on a Debian Jessie the build hangs on the py_uprobes test. |
@finelli You shouldn't need any patch for the tests to pass. What makes you think it's related to this issue? |
Products |
|
bcc is not considering the encoded hwcap when choosing libraries. As such, uprobes on a shared library does not work on powerpc, as seen with the uprobes test:
libc libraries in cache:
bcc always picks the first library here, which won't work on non-power8 machines.
We need to either implement stricter checks (look at hwcap and perhaps the platform) or consider probing on all libraries with the same name.
The text was updated successfully, but these errors were encountered: