All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ihor Solodrai" <ihor.solodrai@linux.dev>
To: "Domenico Andreoli" <domenico.andreoli@linux.com>,
	alan.maguire@oracle.com, acme@kernel.org
Cc: dwarves@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: parallel pahole hangs while building modules from nvidia-open-kernel-dkms
Date: Fri, 28 Mar 2025 20:25:08 +0000	[thread overview]
Message-ID: <310663685bc9fcc1e16490ca9f08b25825ddea91@linux.dev> (raw)
In-Reply-To: <Z-JzFrXaopQCYd6h@localhost>

On 3/25/25 2:10 AM, Domenico Andreoli wrote:
> Hi,
>
>   This a forward of Debian bug report [0] where you can find more
> details. At [1] and [2] you can get the kernel and module to reproduce.
> I could reproduce on both amd64 and arm64 using pahole 1.29.
>
> This is marked as serious severity because it makes the autobuilder hang
> as well [3].
>
> Could you please help?
>
> Regards,
> Domenico
>
>
> The command to succeed:
>
> This simplified (sequential) command succeeds:
>
> cp nvidia-modeset.base.ko nvidia-modeset.ko
> LLVM_OBJCOPY="x86_64-linux-gnu-objcopy" pahole -J --btf_features=encode_force,var,float,enum64,decl_tag,type_tag,optimized_func,consistent_func,decl_tag_kfuncs --btf_features=distilled_base --btf_base vmlinux nvidia-modeset.ko -j1
> echo $?
>
> producing this output:
> ===== 8< =====
> dwarf_expr: unhandled 0x12 DW_OP_ operation
> Unsupported DW_TAG_reference_type(0x10): type: 0x28172

Domenico, Alan, Arnaldo,

I was able to reproduce this error using the input files provided by
Domenico [1][2].

    ./build/pahole -J --btf_features=encode_force,var,float,enum64,decl_tag,type_tag,optimized_func,consistent_func,decl_tag_kfuncs --btf_features=distilled_base --btf_base debian-repro/vmlinux debian-repro/nvidia-modeset.base.ko -j1
    dwarf_expr: unhandled 0x12 DW_OP_ operation
    Unsupported DW_TAG_reference_type(0x10): type: 0x28172
    Error while encoding BTF.
    libbpf: failed to find '.BTF' ELF section in debian-repro/nvidia-modeset.base.ko
    pahole: debian-repro/nvidia-modeset.base.ko: Invalid argument


The unhandled tag points to src/common/displayport/src/dp_auxretry.cpp
[3] of nvidia-modeset.base.ko

Now, as far as I know, BTF can't represent C++-style references
directly (maybe indirectly with tags?).

According to the code, pahole simply bails out in case it encounters
`DW_TAG_reference_type` during BTF encoding. So the question is why
BTF generation is even attempted for a module written in C++? It does
not appear to be a supported use-case.

Please correct me if I'm wrong about this.

Alan, sorry for jumping into this uninvited. I trust you'll take over
from here. Thanks!

I've sent a patch with a fix for the hanging [4].

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=1100503;filename=vmlinux.zst;msg=19
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=1100503;filename=nvidia-modeset.base.ko.zst;msg=12
[3] https://github.com/NVIDIA/open-gpu-kernel-modules/blob/main/src/common/displayport/src/dp_auxretry.cpp
[4] https://lore.kernel.org/bpf/20250328174003.3945581-1-ihor.solodrai@linux.dev/

> Error while encoding BTF.
> 0
> ===== >8 =====
>
> [...]

  parent reply	other threads:[~2025-03-28 20:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-25  9:10 parallel pahole hangs while building modules from nvidia-open-kernel-dkms Domenico Andreoli
2025-03-25 11:32 ` Alan Maguire
2025-03-26 20:48 ` Ihor Solodrai
2025-03-28  9:05   ` Domenico Andreoli
2025-03-28 16:25     ` Ihor Solodrai
2025-03-28 17:55       ` Ihor Solodrai
2025-03-28 20:25 ` Ihor Solodrai [this message]
2025-03-31 13:17   ` Alan Maguire

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=310663685bc9fcc1e16490ca9f08b25825ddea91@linux.dev \
    --to=ihor.solodrai@linux.dev \
    --cc=acme@kernel.org \
    --cc=alan.maguire@oracle.com \
    --cc=bpf@vger.kernel.org \
    --cc=domenico.andreoli@linux.com \
    --cc=dwarves@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.