public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Paul Holzinger <pholzing@redhat.com>
To: Stefano Brivio <sbrivio@redhat.com>, passt-dev@passt.top
Cc: Ed Santiago <santiago@redhat.com>
Subject: Re: [PATCH] pasta: Save errno on signal handler entry, restore on return when needed
Date: Fri, 2 Aug 2024 15:57:14 +0200	[thread overview]
Message-ID: <18571d4e-8ada-467c-b5d6-c4a6b33efcfe@redhat.com> (raw)
In-Reply-To: <20240802133448.3778368-1-sbrivio@redhat.com>


On 02/08/2024 15:34, Stefano Brivio wrote:
> Ed reported this:
>
>    # Error: pasta failed with exit code 1:
>    # Couldn't drop cap 3 from bounding set
>    # : No child processes
>
> in a Podman CI run with tests being run in parallel. The error message
> itself, by the way, is fixed by commit 1cd773081f12 ("log: Drop
> newlines in the middle of the perror()-like messages"), but how can we
> possibly get ECHILD as failure code for prctl()?
>
> Well, we don't, but if we exit early enough, pasta_child_handler()
> might run before we're even done with isolation steps, and it calls
> waitid(), which sets errno. We need to restore it before returning
> from the signal handler (if we return after calling functions that
> might set it), as signal-safety(7) also implies:
>
>         Fetching and setting the value of errno is async-signal-safe
>         provided that the signal handler saves errno on entry and
>         restores its value before returning.
>
> Eventually, we'll probably need to switch to signalfd(2) the day we
> want to implement multithreading, but this will do for the moment.
>
> Reported-by: Ed Santiago <santiago@redhat.com>
> Link: https://github.com/containers/podman/issues/23478
> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: Paul Holzinger <pholzing@redhat.com>




  reply	other threads:[~2024-08-02 13:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-02 13:34 [PATCH] pasta: Save errno on signal handler entry, restore on return when needed Stefano Brivio
2024-08-02 13:57 ` Paul Holzinger [this message]
2024-08-03  3:59 ` David Gibson

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=18571d4e-8ada-467c-b5d6-c4a6b33efcfe@redhat.com \
    --to=pholzing@redhat.com \
    --cc=passt-dev@passt.top \
    --cc=santiago@redhat.com \
    --cc=sbrivio@redhat.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.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).