Code Monkey home page Code Monkey logo

Comments (9)

chenhengqi avatar chenhengqi commented on August 28, 2024 1

Try using a newer version of LLVM.

from libbpf-bootstrap.

anakryiko avatar anakryiko commented on August 28, 2024 1

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.

anakryiko avatar anakryiko commented on August 28, 2024 1

@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.

anakryiko avatar anakryiko commented on August 28, 2024 1

@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.

ThinkerYzu1 avatar ThinkerYzu1 commented on August 28, 2024

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.

RuchiSaluja8 avatar RuchiSaluja8 commented on August 28, 2024

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.

RuchiSaluja8 avatar RuchiSaluja8 commented on August 28, 2024

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.

Screenshot from 2022-07-05 11-51-52

PS I also have other versions of LLVM and clang installed for other software. Will removing those versions solve this issue?

from libbpf-bootstrap.

ThinkerYzu1 avatar ThinkerYzu1 commented on August 28, 2024

Also, I could see the command of GEN_SKEL even without specifying V=1.
If you run make V=1 minimal, you should see that GEN_SKEL is expanded to XXXXX /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.

RuchiSaluja8 avatar RuchiSaluja8 commented on August 28, 2024

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.

Screenshot from 2022-07-05 11-51-52

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.