This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, libfortran] PR 48931 Async-signal-safety of backtrace signal handler, Part 2
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Fortran List <fortran at gcc dot gnu dot org>
- Date: Sun, 29 May 2011 09:52:01 -0700
- Subject: Re: [Patch, libfortran] PR 48931 Async-signal-safety of backtrace signal handler, Part 2
- References: <BANLkTikcEgpU5MarN=9AVBEUQ60qW97cTw@mail.gmail.com>
On Sun, May 29, 2011 at 01:17:05PM +0300, Janne Blomqvist wrote:
>
> FX reminded me that execvp() is not guaranteed to be
> async-signal-safe, hence we must use execve(). So instead during
> library initialization try to find addr2line.
>
> Regtested on x86_64-unknown-linux-gnu, Ok for trunk?
>
> 2011-05-29 Janne Blomqvist <jb@gcc.gnu.org>
>
> PR libfortran/48931
> * libgfortran.h (find_addr2line): New prototype.
> * runtime/backtrace.c (show_backtrace): Use async-signal-safe
> execve and stored path of addr2line.
> * runtime/compile_options.c (maybe_find_addr2line): New function.
> (set_options): Call maybe_find_addr2line if backtracing is enabled.
> * runtime/main.c (find_addr2line): New function.
> (init): Call find_addr2line if backtracing is enabled.
> (cleanup): Free addr2line_path.
>
I suppose I should let FX review the patch, but I know he's
been busy lately. So, the patch is OK. Thanks.
--
Steve