Fatal Python error: Segmentation fault
- Dominant language
- C
- Stars
- 22.7k
- Forks
- 4.1k
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 3
Description
I'm trying to port BCC v0.15.0 into Buildroot (for embedded systems usage) which seems to go smoothly, however upon script execution I'm getting the following error on a Raspberry PI 3 (aarch64) :
$ python3 -q -X faulthandler ./hello_world.py
Fatal Python error: Segmentation fault
Current thread 0x0000007f8840b010 (most recent call first):
File "/usr/lib/python3.8/site-packages/bcc/__init__.py", line 370 in load_func
File "/usr/lib/python3.8/site-packages/bcc/__init__.py", line 1090 in _trace_autoload
File "/usr/lib/python3.8/site-packages/bcc/__init__.py", line 344 in __init__
File "./hello_world.py", line 12 in
Segmentation fault
I made the following capture using strace :
futex(0x7f8fb08bd8, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f8faf40f4, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f8fb010ec, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f8faf40ec, FUTEX_WAKE_PRIVATE, 2147483647) = 0
openat(AT_FDCWD, "/virtual/include/bcc/helpers.h", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/virtual/main.c", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f903ca000
mmap(0x7f903cb000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f903c9000
mmap(0x7f903ca000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f903c8000
mmap(0x7f903c9000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f903c7000
mmap(0x7f903c8000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f903c6000
mmap(0x7f903c7000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f903c5000
mmap(0x7f903c6000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f903c4000
mmap(0x7f903c5000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f903c3000
bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0\230\2\0\0\230\2\0\0 \t\0\0\0\0\0\0\0\0\0\2"..., btf_log_buf=NULL, btf_size=3024, btf_log_size=0, btf_log_level=0}, 120) = 3
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x1} ---
+++ killed by SIGSEGV +++
Segmentation fault
#
Does anyone already faced this issue?
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce ./hello_world.py under the Buildroot port on the Raspberry Pi 3 and start with bcc/__init__.py at load_func, _trace_autoload, and __init__. Inspect the strace around the BPF_BTF_LOAD call and the missing /virtual/include/bcc/helpers.h and /virtual/main.c files. Done means the script runs without a segmentation fault and its expected execution behavior is confirmed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, python, raspberry-pi
- Domain
- devtools, embedded-iot, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100