This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: determine whether code is running in a signal handler context
- From: Yubin Ruan <ablacktshirt at gmail dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: libc-help at sourceware dot org, "Carlos O'Donell" <carlos at redhat dot com>, Will Hawkins <whh8b at virginia dot edu>, spc at conman dot org, noloader at gmail dot com, Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- Date: Mon, 27 Nov 2017 20:50:29 +0800
- Subject: Re: determine whether code is running in a signal handler context
- Authentication-results: sourceware.org; auth=none
- References: <CAJYFCiPkMNCr0X61AQ9MqhXyagOb0k4tTp5mRAD171VLkedVYQ@mail.gmail.com> <CAJYFCiOOhQz1XurSEFe08f7V4cyVFED24_5QmVtYqhu0TTWk4g@mail.gmail.com> <2606c307-a853-1fff-07a1-7f775f61d2b5@redhat.com>
2017-11-27 19:55 GMT+08:00 Florian Weimer <fweimer@redhat.com>:
> 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