]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
tunables: report sbrk() failure
authorDJ Delorie <dj@redhat.com>
Fri, 13 Dec 2019 18:36:58 +0000 (13:36 -0500)
committerDJ Delorie <dj@redhat.com>
Mon, 16 Dec 2019 21:51:00 +0000 (16:51 -0500)
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
elf/dl-tunables.c

index e625ac1a7dc94cb0c4033de57b5c77e42f1f7ce8..f0d7d42770f6fff55c2f94072ff2751104c7a5d2 100644 (file)
@@ -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--;