unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] elf: Don't call fatal_error in _dl_signal_error
Date: Wed, 3 Apr 2024 13:00:33 -0700	[thread overview]
Message-ID: <CAMe9rOqr6m5ARTa_M30vcsG7O3P+FLUF9FLg=ijw6gSWQ8YnmA@mail.gmail.com> (raw)
In-Reply-To: <ab3399e3-64ac-46fb-8e00-2ef3f38ff9c4@linaro.org>

On Wed, Apr 3, 2024 at 12:54 PM Adhemerval Zanella Netto
<adhemerval.zanella@linaro.org> wrote:
>
>
>
> On 03/04/24 09:39, H.J. Lu wrote:
> > Don't call fatal_error in _dl_signal_error since _dl_signal_error should
> > only be called from _dl_catch_exception and get_catch should never return
> > NULL.  Otherwise, fatal_error should be called directly instead.
>
> Is this related to BZ#31596 or did you catch it by code review?  I think

Yes, it is related.  I noticed by code review.

> this is required for lazy binding being fatal error on initializer
> functions (elf/dl-open.c:829).

elf/dl-open.c:829 calls _dl_catch_exception.

> > ---
> >  elf/dl-catch.c | 13 ++++---------
> >  1 file changed, 4 insertions(+), 9 deletions(-)
> >
> > diff --git a/elf/dl-catch.c b/elf/dl-catch.c
> > index 2109516dba..a023555165 100644
> > --- a/elf/dl-catch.c
> > +++ b/elf/dl-catch.c
> > @@ -117,16 +117,11 @@ _dl_signal_error (int errcode, const char *objname, const char *occasion,
> >    if (! errstring)
> >      errstring = N_("DYNAMIC LINKER BUG!!!");
> >
> > -  if (lcatch != NULL)
> > -    {
> > -      _dl_exception_create (lcatch->exception, objname, errstring);
> > -      *lcatch->errcode = errcode;
> > +  _dl_exception_create (lcatch->exception, objname, errstring);
> > +  *lcatch->errcode = errcode;
> >
> > -      /* We do not restore the signal mask because none was saved.  */
> > -      __longjmp (lcatch->env[0].__jmpbuf, 1);
> > -    }
> > -  else
> > -    fatal_error (errcode, objname, occasion, errstring);
> > +  /* We do not restore the signal mask because none was saved.  */
> > +  __longjmp (lcatch->env[0].__jmpbuf, 1);
> >  }
> >  rtld_hidden_def (_dl_signal_error)
> >



-- 
H.J.

  reply	other threads:[~2024-04-03 20:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-03 12:39 [PATCH] elf: Don't call fatal_error in _dl_signal_error H.J. Lu
2024-04-03 19:54 ` Adhemerval Zanella Netto
2024-04-03 20:00   ` H.J. Lu [this message]
2024-04-04 16:56     ` Adhemerval Zanella Netto
2024-04-08 15:28 ` Florian Weimer

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to='CAMe9rOqr6m5ARTa_M30vcsG7O3P+FLUF9FLg=ijw6gSWQ8YnmA@mail.gmail.com' \
    --to=hjl.tools@gmail.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.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 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 read-only IMAP folder(s) and NNTP newsgroup(s).