On Tue, May 9, 2023 at 8:36 AM Yafang Shao <laoar.shao@xxxxxxxxx> wrote: > > On Tue, May 2, 2023 at 11:40 AM Alexei Starovoitov > <alexei.starovoitov@xxxxxxxxx> wrote: > > > > Alan, > > > > wdyt on below? > > > > Hi Alexei, > > Per my understanding, not only does pahole have issues, but also there > are issues in the kernel. > This panic is caused by the inconsistency between BTF and kallsyms as such: > bpf_check_attach_target > tname = btf_name_by_offset(btf, t->name_off); // btf > addr = kallsyms_lookup_name(tname); // kallsyms > > So if the function displayed in /proc/sys/btf/vmlinux is not the same > with the function displayed in /proc/kallsyms, we will get a wrong > addr. I think it is not proper to rely wholly on the userspace tools > to make them the same. The kernel should also imrpve the verifier to > make sure they are really the same function. WDYT? Are you saying it's not proper to rely on compilers and linkers to build the kernel? pahole, resolved_btfid, kallsym gen, objtool are part of the compilation process. The bugs in them are discovered from time to time and have to be fixed. Just like compiler and linker bugs.