From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.efficios.com (mail.efficios.com [167.114.26.124]) by sourceware.org (Postfix) with ESMTPS id AF595396E403 for ; Thu, 30 Apr 2020 20:39:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AF595396E403 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 64053292513; Thu, 30 Apr 2020 16:39:44 -0400 (EDT) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id emilbNfX2Mgl; Thu, 30 Apr 2020 16:39:44 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 28A472923DD; Thu, 30 Apr 2020 16:39:44 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 28A472923DD X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id g40zJ7mM_GMY; Thu, 30 Apr 2020 16:39:44 -0400 (EDT) Received: from mail03.efficios.com (mail03.efficios.com [167.114.26.124]) by mail.efficios.com (Postfix) with ESMTP id 1D28A291F1D; Thu, 30 Apr 2020 16:39:44 -0400 (EDT) Date: Thu, 30 Apr 2020 16:39:44 -0400 (EDT) From: Mathieu Desnoyers To: Florian Weimer Cc: carlos , Joseph Myers , Szabolcs Nagy , libc-alpha Message-ID: <987784768.78623.1588279184094.JavaMail.zimbra@efficios.com> In-Reply-To: <87r1w4k8vr.fsf@oldenburg2.str.redhat.com> References: <20200428171513.22926-1-mathieu.desnoyers@efficios.com> <878sidkk0z.fsf@oldenburg2.str.redhat.com> <1972833271.77975.1588265754974.JavaMail.zimbra@efficios.com> <874kt0lx6i.fsf@oldenburg2.str.redhat.com> <729499446.78182.1588267203324.JavaMail.zimbra@efficios.com> <87zhaskgsp.fsf@oldenburg2.str.redhat.com> <1904112038.78406.1588275546194.JavaMail.zimbra@efficios.com> <87r1w4k8vr.fsf@oldenburg2.str.redhat.com> Subject: Re: [RFC PATCH glibc 1/3] glibc: Perform rseq(2) registration at C startup and thread creation (v18) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [167.114.26.124] X-Mailer: Zimbra 8.8.15_GA_3918 (ZimbraWebClient - FF75 (Linux)/8.8.15_GA_3895) Thread-Topic: glibc: Perform rseq(2) registration at C startup and thread creation (v18) Thread-Index: htTeHtAd5vuOg5tGLWazvH0ASWiDbQ== X-Spam-Status: No, score=-14.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Apr 2020 20:39:45 -0000 ----- On Apr 30, 2020, at 4:37 PM, Florian Weimer fweimer@redhat.com wrote: > * 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. Well rigor in error reporting has to start somewhere, doesn't it ? ;) > >> 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. OK, will leave the default case as "glibc fatal error: unexpected rseq errno" for now. Thanks, Mathieu > > Thanks, > Florian -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com