Skip to content
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

pahole 1.27 segfaults when generating BTF for modules built with LTO #2032

Open
nathanchance opened this issue Jun 13, 2024 · 8 comments
Open
Labels
[FEATURE] LTO Related to building the kernel with LLVM Link Time Optimization [PATCH] Accepted A submitted patch has been accepted upstream Reported upstream This bug was filed on LLVM’s issue tracker, Phabricator, or the kernel mailing list. [TOOL] pahole The issue is relevant to pahole (BTF)

Comments

@nathanchance
Copy link
Member

This was initially reported at https://gitlab.archlinux.org/archlinux/packaging/packages/pahole/-/issues/1. See my upstream report for more information: https://lore.kernel.org/20240613214019.GA1423015@thelio-3990X/

@nathanchance nathanchance added [FEATURE] LTO Related to building the kernel with LLVM Link Time Optimization Reported upstream This bug was filed on LLVM’s issue tracker, Phabricator, or the kernel mailing list. [TOOL] pahole The issue is relevant to pahole (BTF) labels Jun 13, 2024
@nathanchance
Copy link
Member Author

A patch now exists for this: https://lore.kernel.org/all/ZnCWRMfRDMHqSxBb@x1/

@nathanchance nathanchance added the [PATCH] Exists There is a patch that fixes this issue label Jun 17, 2024
@nathanchance
Copy link
Member Author

@nathanchance nathanchance added [PATCH] Accepted A submitted patch has been accepted upstream and removed [PATCH] Exists There is a patch that fixes this issue labels Jun 19, 2024
@dileks
Copy link
Collaborator

dileks commented Jul 24, 2024

@nathanchance

Did you try LATEST pahole.git#next in this scenario?

commit 3801aa0c1174db56540a84947a568bd918730ea4
("dwarf_loader: Remove 'struct dwarf_tag' variable size")

@nathanchance
Copy link
Member Author

The patch is accepted, so the next branch is fixed. It hasn’t been released though, so I am keeping the issue open until then.

@dileks
Copy link
Collaborator

dileks commented Jul 24, 2024

What is your suggestion?

pahole version 1.27 plus above patch only?
Use v1.26?

Here pahole-v1.27-7-g693522ee3a94 is the last working version.

@nathanchance
Copy link
Member Author

I would either stick with 1.26 or checkout and build at 94a01bde592c555b3eb526aeb4c2ad695c5660d8, which is effectively what Arch Linux did: https://gitlab.archlinux.org/archlinux/packaging/packages/pahole/-/commit/505221149a546ad608db56aa3465380a8bff0690.

@dileks
Copy link
Collaborator

dileks commented Jul 24, 2024

OK, thanks.

This is pahole v1.27-3-g94a01bde592c:

commit 94a01bde592c
("dwarf_loader: Add missing cus__add(cus, cu) to cus__merge_and_process_cu()")

@dileks
Copy link
Collaborator

dileks commented Jul 25, 2024

With a selfmade pahole version v1.27-3-g94a01bde592c:

[ start-build.txt ] 
dileks     54335   54326  0 20:35 tty4     00:00:00 /usr/bin/perf stat make V=1 -k -j4 ARCH=x86_64 LLVM=1 LLVM=/opt/llvm/bin/ PAHOLE=/opt/pahole/bin/pahole KBUILD_BUILD_HOST=iniza KBUILD_BUILD_USER=sedat.dilek@gmail.com KBUILD_BUILD_TIMESTAMP=2024-07-24 KDEB_PKGVERSION=6.10.1-1~trixie+dileks1 LOCALVERSION=-1-amd64-clang18-kcfi olddefconfig bindeb-pkg

root@iniza:~# cat /proc/version 
Linux version 6.10.1-1-amd64-clang18-kcfi (sedat.dilek@gmail.com@iniza) (ClangBuiltLinux clang version 18.1.8 (https://github.com/llvm/llvm-project.git 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff), ClangBuiltLinux LLD 18.1.8) #1~trixie+dileks1 SMP PREEMPT_DYNAMIC 2024-07-24

config-6.10.1-1-amd64-clang18-kcfi.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[FEATURE] LTO Related to building the kernel with LLVM Link Time Optimization [PATCH] Accepted A submitted patch has been accepted upstream Reported upstream This bug was filed on LLVM’s issue tracker, Phabricator, or the kernel mailing list. [TOOL] pahole The issue is relevant to pahole (BTF)
Projects
None yet
Development

No branches or pull requests

2 participants