Open xqms opened 2 years ago
Ah, maybe this is triggered when a function outside of the executable itself (e.g. shared library) is called?
For x
it shouldn't matter whether the call is to a shared lib or not, we are just instrumenting the call
instruction itself in the original function. It looks like bpftrace
is interpreting the probe uprobe:...:main
as referring to function _ZZ4mainENKUlvE_clEv
which is
$ echo _ZZ4mainENKUlvE_clEv | c++filt
main::{lambda()#1}::operator()() const
Definitely not the same. Is the binary something that you can share? That would make it easiest to repro, otherwise I can also try to cook up the same error independently.
Never mind I see what the issue is. I don't see an option in bpftrace to disable this though, will open an upstream bug. As a workaround, the easiest option at this point is to just not use x
in main (if you can move the code you're interested in, or even the whole body of main, to a new function it should work).
Ah ok, thank you ;)
If you need a repro case for the bpftrace bug:
#include <cstdio>
int main(int argc, char** argv)
{
auto lambda = [](int i){
printf("YES: %d\n", i);
};
for(int i = 0; i < 100; ++i)
lambda(i);
return 0;
}
compiled with g++ -g -std=c++17 -o test test.cpp
exhibits the same bug (press x on the lambda(i)
line).
Hey, great tool!
I'm seeing error messages like these whenever I try to trace a line with "x": (the initial tracepoint on main works)
Versions:
Do you have an idea what is going on here / what information I can provide? The source code of the "gui" executable is here: https://github.com/xqms/imgui_ros. But I'll try to create a minimal example that triggers this problem.