From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98654 invoked by alias); 27 Nov 2017 11:55:31 -0000 Mailing-List: contact libc-help-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: libc-help-owner@sourceware.org Received: (qmail 98642 invoked by uid 89); 27 Nov 2017 11:55:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=BAYES_00,KB_WAM_FROM_NAME_SINGLEWORD,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=Hx-languages-length:481, HTo:U*libc-help X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 27 Nov 2017 11:55:29 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D0CD880461; Mon, 27 Nov 2017 11:55:27 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7EB0D60602; Mon, 27 Nov 2017 11:55:23 +0000 (UTC) Subject: Re: determine whether code is running in a signal handler context To: Yubin Ruan , libc-help@sourceware.org Cc: Carlos O'Donell , Will Hawkins , spc@conman.org, noloader@gmail.com, Szabolcs Nagy References: From: Florian Weimer Message-ID: <2606c307-a853-1fff-07a1-7f775f61d2b5@redhat.com> Date: Mon, 27 Nov 2017 11:55:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00022.txt.bz2 On 11/27/2017 09:42 AM, Yubin Ruan wrote: > Still remember this thread? It turn out that determining whether or not you > are currently in a signal handler is trivial with libunwind: This is incorrect. libunwind (or any other unwinder) relies on information which is not always available. And since you need to unwind the stack completely (if not executing in a signal handler), it is very slow. Thanks, Florian