This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to use backtrace() safely in signal handler.


On Thu, Dec 5, 2019 at 10:02 PM Carlos O'Donell <carlos@systemhalted.org>
wrote:

> On Thu, Dec 5, 2019 at 8:16 AM Paul Guo <paulguo@gmail.com> wrote:
> > but I want to know how unsafe it is and see if I could use that safely in
> > signal handler with some limitations.
>
> Why do you want to call backtrace() from a signal handler?
>
>

Typically program sigsegv handler wants a backtrace and saves them somwhere
and
then rethrows the signal (and then program quits). This is a very
convenient practice
and seems to be not unusual in some softwares.


In the past this was the accepted practice for doing crash backtrace
> handling.
>
> In-process crash backtrace handling is a security risk and unsafe.
>
> Is there any reason why you don't pursue out-of-process handling?
>
> Cheers,
> Carlos.
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]