unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer via Libc-alpha <libc-alpha@sourceware.org>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: libc-alpha <libc-alpha@sourceware.org>,
	Joseph Myers <joseph@codesourcery.com>
Subject: Re: [RFC PATCH glibc 1/3] glibc: Perform rseq(2) registration at C startup and thread creation (v18)
Date: Thu, 30 Apr 2020 22:37:28 +0200	[thread overview]
Message-ID: <87r1w4k8vr.fsf@oldenburg2.str.redhat.com> (raw)
In-Reply-To: <1904112038.78406.1588275546194.JavaMail.zimbra@efficios.com> (Mathieu Desnoyers's message of "Thu, 30 Apr 2020 15:39:06 -0400 (EDT)")

* Mathieu Desnoyers:

> Considering this, I wonder if we should be strict and e.g. do:
>
> const char *msg = NULL;
>
> switch (INTERNAL_SYSCALL_ERRNO (ret))
>   {
>   case ENOSYS:
>   case EPERM:
>     /* rseq system call is unavailable or not permitted.  */
>     __rseq_abi.cpu_id = RSEQ_CPU_ID_REGISTRATION_FAILED;
>     break;
>   case EINVAL:
>     msg = "glibc fatal error: rseq already registered for this thread\n";
>     break;
>   case EBUSY:
>     msg = "glibc fatal error: rseq parameters are invalid";
>   case EFAULT:
>     msg = "glibc fatal error: rseq is an invalid address";
>     break;
>   default:
>     msg = "glibc fatal error: unexpected rseq errno";
>     break;
>   }
> if (msg)
>   __libc_fatal (msg);

Not sure if this is necessary.  I think it's the first fatal error with
that kind of verbosity, and it's an odd place to start, all things
considered.

> Also considering that __libc_fatal only takes a string as parameter,
> I wonder if there is a facility to print the errno string I could use
> instead of __libc_fatal () ?

I wouldn't get too creative here given that this failure happens so
early during startup, and initialization is somewhat incomplete.

Thanks,
Florian


  parent reply	other threads:[~2020-04-30 20:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-28 17:15 [RFC PATCH glibc 1/3] glibc: Perform rseq(2) registration at C startup and thread creation (v18) Mathieu Desnoyers via Libc-alpha
2020-04-28 17:15 ` [RFC PATCH glibc 2/3] glibc: sched_getcpu(): use rseq cpu_id TLS on Linux (v7) Mathieu Desnoyers via Libc-alpha
2020-04-28 17:15 ` [RFC PATCH glibc 3/3] rseq registration tests (v10) Mathieu Desnoyers via Libc-alpha
2020-04-30 12:20 ` [RFC PATCH glibc 1/3] glibc: Perform rseq(2) registration at C startup and thread creation (v18) Florian Weimer via Libc-alpha
2020-04-30 16:11   ` Mathieu Desnoyers via Libc-alpha
2020-04-30 16:36     ` Florian Weimer via Libc-alpha
2020-04-30 16:55       ` Mathieu Desnoyers via Libc-alpha
2020-04-30 17:07         ` Florian Weimer via Libc-alpha
2020-04-30 17:20           ` Mathieu Desnoyers via Libc-alpha
2020-04-30 17:46             ` Florian Weimer via Libc-alpha
2020-04-30 19:39               ` Mathieu Desnoyers via Libc-alpha
2020-04-30 19:53                 ` Mathieu Desnoyers via Libc-alpha
2020-04-30 19:59                   ` Mathieu Desnoyers via Libc-alpha
2020-04-30 20:34                     ` Florian Weimer via Libc-alpha
2020-04-30 20:37                       ` Mathieu Desnoyers via Libc-alpha
2020-04-30 20:37                 ` Florian Weimer via Libc-alpha [this message]
2020-04-30 20:39                   ` Mathieu Desnoyers via Libc-alpha

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=87r1w4k8vr.fsf@oldenburg2.str.redhat.com \
    --to=libc-alpha@sourceware.org \
    --cc=fweimer@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=mathieu.desnoyers@efficios.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).