From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22969 invoked by alias); 10 Jan 2018 19:09:32 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 22958 invoked by uid 89); 10 Jan 2018 19:09:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=resume X-HELO: mail-qk0-f181.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=VGAdIYk8NQs03CrGNzTj0NBad7pTMwIWFlsWPMQht3Q=; b=g/aaieXcRZhy/JKwBV4rQtJQyWCoiw2O+kOFovUQZQYkEe/LNAlcu/4F2mFJ0EQd9w sBczbEUK0nq5nNnjx5v/ki/UYBi0gpHbx7EdHOwxQh3fWIyPar8MVFYfYssgkPNgEKFm 5r8r15OPMtzFzgySDfIyFjNtT+Xk+g1lzv0NJXsEk+39AsTq96Fzs0MxMWZVHkTBNAIX 9zYMgGhXoMmp2SD1E0NKHrRjtvOWd+ecQnvuzMQ8rnvuA4B2SLgLI9bm34hS735m5rbU QXMiYVep0O/GTdRFfZ/LPCfa7EuKseoWC5mE+xHW/eN8dOFWRKM2+aAR4j93W5Ja+6NC slnQ== X-Gm-Message-State: AKwxyteCG8x1m0EjTkhhbOWFG5iskaDZJj4oviHn9cdeELEoLh4lvpCO cEgJD8EpLFedUxoG8PHDLczNRsa9AGA= X-Google-Smtp-Source: ACJfBotrvr7sLWed2/psODHUFswTypnmztkm1gEXsluBq0el9kPluouaT+HBkB4fEkEtEGRJqdKLng== X-Received: by 10.200.27.52 with SMTP id y49mr9046441qtj.161.1515611368249; Wed, 10 Jan 2018 11:09:28 -0800 (PST) Subject: Re: [PATCH] nptl: Open libgcc.so with RTLD_NOW during pthread_cancel To: Florian Weimer , libc-alpha@sourceware.org References: <20180110104903.A4F88439942E1@oldenburg.str.redhat.com> From: Carlos O'Donell Message-ID: Date: Wed, 10 Jan 2018 19:09:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180110104903.A4F88439942E1@oldenburg.str.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-01/txt/msg00336.txt.bz2 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 > > [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.