From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 62994 invoked by alias); 31 Dec 2019 10:46:02 -0000 Mailing-List: contact glibc-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: , Sender: glibc-cvs-owner@sourceware.org List-Subscribe: Received: (qmail 62977 invoked by uid 9299); 31 Dec 2019 10:46:02 -0000 Date: Tue, 31 Dec 2019 10:46:00 -0000 Message-ID: <20191231104602.62976.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc/fw/builtin-syscalls-4] tunables: report sbrk() failure X-Act-Checkin: glibc X-Git-Author: DJ Delorie X-Git-Refname: refs/heads/fw/builtin-syscalls-4 X-Git-Oldrev: a2e487ce1c59d19345d9ecacc58de79febd869e4 X-Git-Newrev: a059f9505bbef1f22c6f52798a74184632929145 X-SW-Source: 2019-q4/txt/msg00669.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a059f9505bbef1f22c6f52798a74184632929145 commit a059f9505bbef1f22c6f52798a74184632929145 Author: DJ Delorie Date: Fri Dec 13 13:36:58 2019 -0500 tunables: report sbrk() failure Reviewed-by: Carlos O'Donell Diff: --- elf/dl-tunables.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c index e625ac1..f0d7d42 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--;