From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 80468 invoked by alias); 27 Nov 2017 12:50:33 -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 80450 invoked by uid 89); 27 Nov 2017 12:50:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KB_WAM_FROM_NAME_SINGLEWORD,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy= X-HELO: mail-wm0-f50.google.com Received: from mail-wm0-f50.google.com (HELO mail-wm0-f50.google.com) (74.125.82.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 27 Nov 2017 12:50:32 +0000 Received: by mail-wm0-f50.google.com with SMTP id x63so33845885wmf.2 for ; Mon, 27 Nov 2017 04:50:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=WTQBZKy4UhRgPPbXu2QhbLa1pS8W+VTLSBpznK+NnlQ=; b=BRvzO3hDnlyJbnu5ONNgbaLyaPehd33jcWN1FUolkVp1q02Bp5TZYAmvDF8cPtl46K tUxsqMQpu9xm0KaSfzs9aevHDEys2f2HMtYEI+r1dVoxjvSdyXoWBHwF05XdTUZHa/l/ 6vRe1JBtKs/jUebAXa0N8F9eeVJJ/EQmjcD9ZTRLo1FEscBWSedq53fT3HMjOMKed2e6 lyCNJagmaP6oH7K61JVEowt6z9q1q428G67hEg4oU6NyRhtYtocVfHNrUxOh1Tlm+D89 CKfR/Rq3Ob0BGKm9stesXkMifVXwyfAdOMwKUYZ1f3ooPnOqIqcxhAkRPk1tcwo19QWQ RHig== X-Gm-Message-State: AJaThX401c+9bD6G4OuQ/H/z/mVBU96Rx9yr+IWzEt0R5FIPJUZt3/KM oYbaoztv5B8rbVtoPtBIscMDqySBgfyAJ5icLw== X-Google-Smtp-Source: AGs4zMZ4s1fpK4635HQ5icC6ff/uEY4KK1qEmiw2rnlCHUcPIBXaKQSLq7zqx+u2zClX7N2mzx5z8piG4PqNRGXt+rc= X-Received: by 10.80.225.3 with SMTP id h3mr6797517edl.128.1511787029940; Mon, 27 Nov 2017 04:50:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.135.140 with HTTP; Mon, 27 Nov 2017 04:50:29 -0800 (PST) In-Reply-To: <2606c307-a853-1fff-07a1-7f775f61d2b5@redhat.com> References: <2606c307-a853-1fff-07a1-7f775f61d2b5@redhat.com> From: Yubin Ruan Date: Mon, 27 Nov 2017 12:50:00 -0000 Message-ID: Subject: Re: determine whether code is running in a signal handler context To: Florian Weimer Cc: libc-help@sourceware.org, "Carlos O'Donell" , Will Hawkins , spc@conman.org, noloader@gmail.com, Szabolcs Nagy Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00027.txt.bz2 2017-11-27 19:55 GMT+08:00 Florian Weimer : > 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. what information? > And since you need to unwind the stack > completely (if not executing in a signal handler), it is very slow. slow speed is acceptable though. Yubin