-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Segfault after failing BPF_MAP_CREATE #515
Comments
I've run into something similar when mixing iovisor's packaged libbcc with Debian/Canonical's packaged bpftrace (which has been built to use Debian/Canoncial's packaged libbpfcc, and not iovisor version). The fix was to either use Debian/Canonical's libbpfcc library instead, or to build bpftrace locally with the iovisor libbcc. Can you say where you got both bpftrace and libbcc/libbpfcc? |
I built both from source, bcc using tag v0.8.0 (because of build problems in master) and bpftrace using the latest code (roughly two weeks ago I guess). But I was experimenting with a docker container at the time, which had its own version of both packages but built at a different time. The container is also using v0.8.0 of bcc, but used whatever state was current for bpftrace at build time. The crashing happened only with the bpftrace on my host and with a version that had worked correctly before the container tests, so perhaps the different binary in the container caused some changes in the (shared) debug filesystem...? I'm not familiar with debugfs, so no clue if something like that can happen. |
I just tried again on the host, and I can reproduce the crash. This time both the container and my host version of bpftrace are built with tag v0.9 (bcc still at v0.8.0). I'll leave it like this for now, please let me know if you'd like to get some more info from the current crashing release binary. Otherwise I can build a debug version and try to provoke the crash again somehow. |
We now terminate when a map cannot be created, which should prevent this segv
|
I ran into a segmentation fault after all my bpftrace calls suddenly started failing due to "Error creating map: @". It seems the failure doesn't stop the execution, and at some point later bpftrace runs into a segfault. I then tried to rebuild with debug symbols to analyze the crash a bit better, but suddenly I couldn't reproduce it any more. I also rebuilt the release binary, but that too continued to work without issues. Thus, below are all the notes that I managed to take before the recompilation, unfortunately I don't have a core dump. I don't know what provoked the initial error, but I guess the segfault afterwards (and the
MAP_UPDATE_ELEM
calls with an invalid fd) is at least something that can be taken care of.strace of the crash:
debugging session with gdb:
It seems that
strlen
gets called with a pointer to address "5". For further context (in case there are multiplestrlen
s in the calling function), here's the caller:As I said, those are the notes I made before rebuilding and before not being able to reproduce the issue anymore. Feel free to ask questions, but I won't be able to provide more details about the stack itself.
The text was updated successfully, but these errors were encountered: