public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Carlos O'Donell <carlos@redhat.com>
To: Florian Weimer <fweimer@redhat.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH] nptl: Open libgcc.so with RTLD_NOW during pthread_cancel
Date: Wed, 10 Jan 2018 19:09:00 -0000	[thread overview]
Message-ID: <c5dbae0e-18ec-8f76-061b-3436b55b4de7@redhat.com> (raw)
In-Reply-To: <20180110104903.A4F88439942E1@oldenburg.str.redhat.com>

On 01/10/2018 02:49 AM, Florian Weimer wrote:
> Disabling lazy binding reduces stack usage during unwinding.
> 
> Note that RTLD_NOW only makes a difference if libgcc.so has not
> already been loaded, so this is only a partial fix.
> 
> 2018-01-10  Florian Weimer  <fweimer@redhat.com>
> 
> 	[BZ #22636]
> 	* sysdeps/nptl/unwind-forcedunwind.c (pthread_cancel_init): Open
> 	libgcc.so with RTLD_NOW, to avoid lazy binding during unwind.
> 
> diff --git a/sysdeps/nptl/unwind-forcedunwind.c b/sysdeps/nptl/unwind-forcedunwind.c
> index ab4350de99..67b8e74b53 100644
> --- a/sysdeps/nptl/unwind-forcedunwind.c
> +++ b/sysdeps/nptl/unwind-forcedunwind.c
> @@ -49,7 +49,7 @@ pthread_cancel_init (void)
>        return;
>      }
>  
> -  handle = __libc_dlopen (LIBGCC_S_SO);
> +  handle = __libc_dlopen_mode (LIBGCC_S_SO, RTLD_NOW | __RTLD_DLOPEN);
>  
>    if (handle == NULL
>        || (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL
> 

Should we not also do this for sysdeps/gnu/unwind-resume.c ?

-- 
Cheers,
Carlos.

  parent reply	other threads:[~2018-01-10 19:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-10 10:49 Florian Weimer
2018-01-10 11:10 ` Adhemerval Zanella
2018-01-10 19:09 ` Carlos O'Donell [this message]
2018-01-10 19:21   ` Florian Weimer
2018-01-10 19:29     ` Carlos O'Donell
2018-01-10 20:03       ` Florian Weimer
2018-01-10 20:21         ` Carlos O'Donell

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=c5dbae0e-18ec-8f76-061b-3436b55b4de7@redhat.com \
    --to=carlos@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.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).