public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Maguire <alan.maguire@oracle.com>
To: Domenico Andreoli <domenico.andreoli@linux.com>
Cc: Ihor Solodrai <ihor.solodrai@linux.dev>,
	dwarves@vger.kernel.org, bpf@vger.kernel.org, acme@kernel.org,
	andrii@kernel.org, eddyz87@gmail.com, mykolal@fb.com,
	kernel-team@meta.com
Subject: Re: [PATCH dwarves] dwarf_loader: fix termination on BTF encoding error
Date: Wed, 2 Apr 2025 10:56:05 +0100	[thread overview]
Message-ID: <cd5e3955-9c3d-4c06-8908-c279af33fa92@oracle.com> (raw)
In-Reply-To: <Z-vtiuRaolc91Nkc@localhost>

On 01/04/2025 14:43, Domenico Andreoli wrote:
> On Tue, Apr 01, 2025 at 01:57:25PM +0100, Alan Maguire wrote:
>> On 28/03/2025 17:40, Ihor Solodrai wrote:
>>> When BTF encoding thread aborts because of an error, dwarf loader
>>> worker threads get stuck in cus_queue__enqdeq_job() at:
>>>
>>>     pthread_cond_wait(&cus_processing_queue.job_added, &cus_processing_queue.mutex);
>>>
>>> To avoid this, introduce an abort flag into cus_processing_queue, and
>>> atomically check for it in the deq loop. The flag is only set in case
>>> of a worker thread exiting on error. Make sure to pthread_cond_signal
>>> to the waiting threads to let them exit too.
>>>
>>> In cus__process_file fix the check of an error returned from
>>> dwfl_getmodules: it may return a positive number when a
>>> callback (cus__process_dwflmod in our case) returns an error.
>>>
>>> Link: https://lore.kernel.org/dwarves/Z-JzFrXaopQCYd6h@localhost/
>>>
>>> Reported-by: Domenico Andreoli <domenico.andreoli@linux.com>
>>> Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
>>
>> Thanks for the fix! I've tested this with the problematic module+vmlinux
>> BTF and the previously-hanging pahole goes on to fail as expected; also
>> run it through the work-in-progress CI, building and testing on x86_64
>> and aarch64, no issues found. If anyone else has a chance to ack or test
>> it, that would be great. Thanks!
> 
> Tested-by: Domenico Andreoli <domenico.andreoli@linux.com>
> 
> I rebuilt the Debian package with that patch applied and it then started
> to fail consistently because of the extra c++ symbols.
> 
> When I use the switch --lang_exclude=rust,c++11, it works without
> errors.
> 
> Thank you Alan and Ihor for the fast support!
> 

Fix applied to next branch at
https://git.kernel.org/pub/scm/devel/pahole/pahole.git , thanks!

Alan

      reply	other threads:[~2025-04-02  9:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-28 17:40 [PATCH dwarves] dwarf_loader: fix termination on BTF encoding error Ihor Solodrai
2025-04-01 12:57 ` Alan Maguire
2025-04-01 13:43   ` Domenico Andreoli
2025-04-02  9:56     ` Alan Maguire [this message]

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=cd5e3955-9c3d-4c06-8908-c279af33fa92@oracle.com \
    --to=alan.maguire@oracle.com \
    --cc=acme@kernel.org \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=domenico.andreoli@linux.com \
    --cc=dwarves@vger.kernel.org \
    --cc=eddyz87@gmail.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=kernel-team@meta.com \
    --cc=mykolal@fb.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox