[Patch, libfortran] PR 48931 Async-signal-safety of backtrace signal handler
Janne Blomqvist
blomqvist.janne@gmail.com
Tue May 24 11:38:00 GMT 2011
On Sun, May 22, 2011 at 23:21, FX <fxcoudert@gmail.com> wrote:
> Dear Janne,
>
> Sorry I'm a bit late on this, but since async-signal-safe code is so hard to get right (at least for me), I wanted to help review your new code. It's very nice to have this instead of my initial ugly implementation, and I have only spotted on issue: AFAICT, execvp() is not safe to use here; only execle() and execve() are.
Ah, good catch! That's a bit of a bummer though, since the nice thing
about execvp() is that it searches the path for the executable, so
it'll work even if the user has addr2line installed somewhere else
than /usr/bin. For execve(), one needs to provide an absolute path.
One solution could be to search the PATH for addr2line during library
initialization (where we don't need to be async-signal-safe), and then
store it somewhere and use it in show_backtrace().
--
Janne Blomqvist
More information about the Gcc-patches
mailing list