public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: FX <fxcoudert@gmail.com>
To: Janne Blomqvist <blomqvist.janne@gmail.com>
Cc: gfortran List <fortran@gcc.gnu.org>,
	gcc-patches@gcc.gnu.org,
	Steve Kargl <sgk@troutmask.apl.washington.edu>
Subject: Re: [Patch, libfortran] PR 48931 Async-signal-safety of backtrace signal handler
Date: Tue, 24 May 2011 11:42:00 -0000	[thread overview]
Message-ID: <2FD97A4D-2A6B-4DDB-888E-E32F9B93424B@gmail.com> (raw)
In-Reply-To: <BANLkTik9dSK5Bu4G=Fe_wwHFn=uW7jWgmg@mail.gmail.com>

> 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.

Yes, I know. Sorry :)

> 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().

That's one way. Another way is just to store a copy of the PATH during initialization, and only search addr2line when really needed (which can be done with a static buffer and a series of call to execve(), can't it?)

FX

  reply	other threads:[~2011-05-24  9:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-22 21:50 FX
2011-05-24 11:38 ` Janne Blomqvist
2011-05-24 11:42   ` FX [this message]
2011-05-24 13:19     ` N.M. Maclaren
  -- strict thread matches above, loose matches on Subject: below --
2011-05-15 11:13 Janne Blomqvist
2011-05-15 17:43 ` Janne Blomqvist
2011-05-15 20:46   ` Janne Blomqvist
2011-05-20 16:15     ` Janne Blomqvist
2011-05-21 22:01     ` Steve Kargl
2011-05-18  1:11 ` Toon Moene
2011-05-18  6:03   ` Toon Moene

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2FD97A4D-2A6B-4DDB-888E-E32F9B93424B@gmail.com \
    --to=fxcoudert@gmail.com \
    --cc=blomqvist.janne@gmail.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=sgk@troutmask.apl.washington.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).