From patchwork Fri Dec 13 20:21:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: DJ Delorie X-Patchwork-Id: 36838 Received: (qmail 12243 invoked by alias); 13 Dec 2019 20:36:59 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 12218 invoked by uid 89); 13 Dec 2019 20:36:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy= X-HELO: us-smtp-delivery-1.mimecast.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576269416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to; bh=didtTznFFn0+8u+30aBaPZh2LKPNgptCg8SzND2aGrY=; b=Ue4aB3Q0CCuoCzcGhoiFb907JjOTsokK/M/Y2cYqAu0FD/kfvkgdYZI7BPKrMsgjcM7vPL elh74ePR81AqOYJauRgW0ySOTae2y0ZZIR7nbK1h9Qf2GEjdt3lQp/KpFwMAeKop0RG271 NFZqufPFwLdUJYA+W/diq8PPxEw7lgY= From: DJ Delorie To: "Carlos O'Donell" Cc: siddhesh@gotplt.org, libc-alpha@sourceware.org Subject: Re: RFC: tunables failure indications... In-Reply-To: <046165eb-8b96-047d-1c1e-e43e135442de@redhat.com> (codonell@redhat.com) Date: Fri, 13 Dec 2019 15:21:20 -0500 Message-ID: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 "Carlos O'Donell" writes: > Almost. _dl_fatal_printf is noreturn and calls _exit (127). Done. From b50d6a577bf2f118923ce0e1b159c4d659815405 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Fri, 13 Dec 2019 13:36:58 -0500 Subject: tunables: report sbrk() failure Reviewed-by: Carlos O'Donell diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c index e625ac1a7d..f0d7d42770 100644 --- a/elf/dl-tunables.c +++ b/elf/dl-tunables.c @@ -45,12 +45,11 @@ tunables_strdup (const char *in) while (in[i++] != '\0'); char *out = __sbrk (i); - /* FIXME: In reality if the allocation fails, __sbrk will crash attempting to - set the thread-local errno since the TCB has not yet been set up. This - needs to be fixed with an __sbrk implementation that does not set - errno. */ + /* For most of the tunables code, we ignore user errors. However, + this is a system error - and running out of memory at program + startup should be reported, so we do. */ if (out == (void *)-1) - return NULL; + _dl_fatal_printf ("sbrk() failure while processing tunables\n"); i--;