Comments (9)
Try using a newer version of LLVM.
from libbpf-bootstrap.
make sure you are compiling BPF source code with -g
compiler flag, which will make Clang generate BTF information.
But crash shouldn't happen anyway, so can you share object file you are using to generate skeleton?
from libbpf-bootstrap.
@RuchiSaluja8 #92 should help with bpftool building issues
as for no .o, make clean and try again (but with older Clang to reproduce it)
from libbpf-bootstrap.
@RuchiSaluja8 actually, I think your original crash issue will be solved by #93, bpftool had issue with .bpf.o files that don't have BTF and it was fixed, but libbpf-bootstrap didn't have that fix in its bpftool submodule yet. I've updated bpftool to latest.
from libbpf-bootstrap.
It is necessary to generate skeletons with bpftool. The steps you provide work for me. Could you run bpftool manually to see what will happen? It is even better to get a stack trace with gdb.
By the way, you will see the command of GEN_SKEL with make V=1 minimal
.
from libbpf-bootstrap.
I am not sure if this is what you meant by running bpftool manually.. I am fairly new to libbpf and bpftool. Based on my understanding till now, I tried running this bpftool command : bpftool --debug prog load /home/imgadmin/libbpf-bootstrap/examples/c/.output/minimal.bpf.o /home/imgadmin/Desktop/libbpf-test-dir/minimal.skel.h
and got an error:
root@l156311423:~# bpftool --debug prog load /home/imgadmin/libbpf-bootstrap/examples/c/.output/minimal.bpf.o /home/imgadmin/Desktop/libbpf-test-dir/minimal.skel.h
libbpf: loading /home/imgadmin/libbpf-bootstrap/examples/c/.output/minimal.bpf.o
libbpf: section(1) .text, size 0, link 0, flags 6, type=1
libbpf: skip section(1) .text
libbpf: section(2) tp/syscalls/sys_enter_write, size 104, link 0, flags 6, type=1
libbpf: found program tp/syscalls/sys_enter_write
libbpf: section(3) license, size 13, link 0, flags 3, type=1
libbpf: license of /home/imgadmin/libbpf-bootstrap/examples/c/.output/minimal.bpf.o is Dual BSD/GPL
libbpf: section(4) .bss, size 4, link 0, flags 3, type=8
libbpf: section(5) .rodata, size 28, link 0, flags 2, type=1
libbpf: section(6) .symtab, size 192, link 8, flags 0, type=2
libbpf: section(7) .reltp/syscalls/sys_enter_write, size 32, link 6, flags 0, type=9
libbpf: section(8) .strtab, size 126, link 0, flags 0, type=3
libbpf: skip section(8) .strtab
libbpf: Corrupted ELF file: index of strtab invalid
Error: failed to open object file
Seems like there is an issue with the object file itself.
Can you tell me if I should try some other bpftool command manually?
Also, I could see the command of GEN_SKEL even without specifying V=1.
from libbpf-bootstrap.
Thanks for the suggestion @chenhengqi. I have installed the latest version of LLVM (after following the steps given here and adding the build directory's path to environment).
But I still see the same error when running make command.
PS I also have other versions of LLVM and clang installed for other software. Will removing those versions solve this issue?
from libbpf-bootstrap.
Also, I could see the command of GEN_SKEL even without specifying V=1.
If you runmake V=1 minimal
, you should see that GEN_SKEL is expanded toXXXXX /bpftool gen skeleton .output/minimal.bpf.o > .output/minimal.skel.h
.
The issue here is that bpftool fails to generate the skeleton. libbpf-bootstrap builds its bpftool instead of using the system one.
It may help if you generate the skeleton manually with the bpftool that is built by libbpf-bootstrap. It would be even better to have a stactrace.
from libbpf-bootstrap.
Thanks for the suggestion @chenhengqi. I have installed the latest version of LLVM (after following the steps given here and adding the build directory's path to environment). But I still see the same error when running make command.
PS I also have other versions of LLVM and clang installed for other software. Will removing those versions solve this issue?
After updating LLVM and CLang, I cloned this repository again and got different errors on running make minimal
:
https://gist.github.com/RuchiSaluja8/739b91f05169b0bc1ff108e514da3f25
@ThinkerYzu1 There is no gen skeleton output for minimal this time, only for profiler. The output for make V=1 minimal
is also in the gist link mentioned above.
@anakryiko BPF code compilation is done with -g
flag. There was no .o file generated for minimal this time.
However, running CLANG=Nope make -j8 minimal
worked to resolve the errors I was getting.
from libbpf-bootstrap.
Related Issues (20)
- Compilation fails in CentOS 7.6 HOT 3
- Retrieving argument values from newfstatat HOT 2
- Rust: How to attach a single bpf program to multiple network interfaces? HOT 3
- Make failed HOT 2
- Make error - poisoned strlcpy HOT 1
- Android xmake fails HOT 10
- add xdp synproxy in c example? HOT 2
- run fentry examples in Loongarch cpu failed HOT 2
- error: unable to create target: 'No available targets are compatible with triple "bpf"' HOT 1
- Does libbpf-bootstrap support sk_msg/stream_parser & sk_msg/stream_parser hook ?
- example uprobe no output HOT 4
- (ARM64) Rust Example Tracecon Does Not Compile HOT 2
- [Android] Failed to find valid kernel BTF HOT 19
- How to read arbitrary len bytes using helper bpf_skb_load_bytes()? HOT 2
- To compile the Rust example in libbpf-bootstrap for use on the Android platform or arm64 , what should I do? HOT 1
- when compile the Rust example in libbpf-bootstrap for target arm64 ,why build.rs use vmlinux.h is x86 ? HOT 8
- unknown func bpf_kallsyms_lookup_name#179 HOT 1
- Can you please add a bpf_for() example? HOT 1
- minimal_ns doesn't compile HOT 1
- Compilation failed, missing a header file? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libbpf-bootstrap.