From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27536 invoked by alias); 24 May 2011 09:38:00 -0000 Received: (qmail 27518 invoked by uid 22791); 24 May 2011 09:37:59 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-wy0-f175.google.com (HELO mail-wy0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 24 May 2011 09:37:45 +0000 Received: by wye20 with SMTP id 20so5825934wye.20 for ; Tue, 24 May 2011 02:37:44 -0700 (PDT) Received: by 10.227.7.18 with SMTP id b18mr3250068wbb.103.1306229864235; Tue, 24 May 2011 02:37:44 -0700 (PDT) Received: from [192.168.0.2] (chp150.enscp.fr [193.51.253.150]) by mx.google.com with ESMTPS id bs4sm4645223wbb.1.2011.05.24.02.37.42 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 May 2011 02:37:43 -0700 (PDT) Subject: Re: [Patch, libfortran] PR 48931 Async-signal-safety of backtrace signal handler Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: FX In-Reply-To: Date: Tue, 24 May 2011 11:42:00 -0000 Cc: gfortran List , gcc-patches@gcc.gnu.org, Steve Kargl Content-Transfer-Encoding: quoted-printable Message-Id: <2FD97A4D-2A6B-4DDB-888E-E32F9B93424B@gmail.com> References: To: Janne Blomqvist Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg01707.txt.bz2 > 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 init= ialization, 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