about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2019-12-13 13:36:58 -0500
committerDJ Delorie <dj@redhat.com>2019-12-16 16:51:00 -0500
commita059f9505bbef1f22c6f52798a74184632929145 (patch)
tree0fcca95771a118df8681e71ad164979dcae363e0 /elf
parenta2e487ce1c59d19345d9ecacc58de79febd869e4 (diff)
downloadglibc-a059f9505bbef1f22c6f52798a74184632929145.tar.gz
glibc-a059f9505bbef1f22c6f52798a74184632929145.tar.xz
glibc-a059f9505bbef1f22c6f52798a74184632929145.zip
tunables: report sbrk() failure
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-tunables.c9
1 files changed, 4 insertions, 5 deletions
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--;