From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 96218 invoked by alias); 13 Dec 2019 18:48:37 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 96199 invoked by uid 89); 13 Dec 2019 18:48:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS 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=1576262913; 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=UjQ68xr0lLK7q2GRtzDyajFVPc4d5t1SenmlEeoh21M=; b=ThqiuZ1llcePj6mRWKtJdLMGDfUmt4J/IJMZ97pAxl3yYBsWGxchOB4a8wj1VhQew4+J3p ijv/2u833RoMdPq0egygvGu9PiNCCd7BZs+Vg+K5RQgVL3Bbpb1axWOQ+RdBHh/S0N4lr8 IRMNqvPQnGdoKG4v6WHfNwXuj1CESfM= From: DJ Delorie To: "Carlos O'Donell" Cc: siddhesh@gotplt.org, libc-alpha@sourceware.org Subject: Re: RFC: tunables failure indications... In-Reply-To: <5070057b-0687-5ed6-36b7-c30440dc0c14@redhat.com> (codonell@redhat.com) Date: Fri, 13 Dec 2019 18:48:00 -0000 Message-ID: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-SW-Source: 2019-12/txt/msg00499.txt.bz2 ? >From d64d1ddf3d79a1e51612f8e4ae3ecfd020246275 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Fri, 13 Dec 2019 13:36:58 -0500 Subject: tunables: report sbrk() failure diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c index e625ac1a7d..3a3f8096c2 100644 --- a/elf/dl-tunables.c +++ b/elf/dl-tunables.c @@ -45,12 +45,14 @@ tunables_strdup (const char *in) while (in[i++] !=3D '\0'); char *out =3D __sbrk (i); =20 - /* FIXME: In reality if the allocation fails, __sbrk will crash attempti= ng to - set the thread-local errno since the TCB has not yet been set up. Th= is - 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 =3D=3D (void *)-1) - return NULL; + { + _dl_fatal_printf("sbrk() failure while processing tunables\n"); + _exit (1); + } =20 i--; =20