public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Carlos O'Donell <codonell@redhat.com>
To: DJ Delorie <dj@redhat.com>
Cc: siddhesh@gotplt.org, libc-alpha@sourceware.org
Subject: Re: RFC: tunables failure indications...
Date: Fri, 13 Dec 2019 20:14:00 -0000	[thread overview]
Message-ID: <046165eb-8b96-047d-1c1e-e43e135442de@redhat.com> (raw)
In-Reply-To: <xnr218qcxw.fsf@greed.delorie.com>

On 12/13/19 1:48 PM, DJ Delorie wrote:
> 
> ?
> 

Almost. _dl_fatal_printf is noreturn and calls _exit (127).

So all you need is the call to _dl_fatal_printf.

> From d64d1ddf3d79a1e51612f8e4ae3ecfd020246275 Mon Sep 17 00:00:00 2001
> From: DJ Delorie <dj@redhat.com>
> 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++] != '\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");
> +      _exit (1);
> +    }
>  
>    i--;
>  
> 


-- 
Cheers,
Carlos.

  reply	other threads:[~2019-12-13 20:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05 22:44 DJ Delorie
2019-12-06  8:33 ` Siddhesh Poyarekar
2019-12-10 16:26   ` Carlos O'Donell
2019-12-10 16:36     ` Siddhesh Poyarekar
2019-12-11 22:01       ` DJ Delorie
2019-12-12  3:50         ` Siddhesh Poyarekar
2019-12-12  4:03           ` DJ Delorie
2019-12-12  4:08             ` Siddhesh Poyarekar
2019-12-12 17:51               ` Carlos O'Donell
2019-12-13 18:48                 ` DJ Delorie
2019-12-13 20:14                   ` Carlos O'Donell [this message]
2019-12-13 20:36                     ` DJ Delorie
2019-12-13 20:41                       ` Carlos O'Donell
2019-12-16 22:16                         ` DJ Delorie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=046165eb-8b96-047d-1c1e-e43e135442de@redhat.com \
    --to=codonell@redhat.com \
    --cc=dj@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=siddhesh@gotplt.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).