From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2687 invoked by alias); 17 May 2011 17:51:12 -0000 Received: (qmail 2679 invoked by uid 22791); 17 May 2011 17:51:11 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from moene.org (HELO moene.org) (82.95.66.103) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 May 2011 17:50:57 +0000 Received: from localhost ([::1]) by moene.org with esmtp (Exim 4.76) (envelope-from ) id 1QMOQ3-0005i1-Ld for gcc-patches@gcc.gnu.org; Tue, 17 May 2011 19:50:55 +0200 Message-ID: <4DD2B57F.2050404@moene.org> Date: Wed, 18 May 2011 01:11:00 -0000 From: Toon Moene User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110402 Icedove/3.1.9 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org Subject: Re: [Patch, libfortran] PR 48931 Async-signal-safety of backtrace signal handler References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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/msg01239.txt.bz2 On 05/14/2011 09:40 PM, Janne Blomqvist wrote: > Hi, > > the current version of showing the backtrace is not async-signal-safe > as it uses backtrace_symbols() which, in turn, uses malloc(). The > attached patch changes the backtrace printing functionality to instead > use backtrace_symbols_fd() and pipes. Great - this would solve a problem I filed a bugzilla report for years ago (unfortunately, I do not know the number of it). I closed it WONTFIX, because neither FX nor I could come up with an alternative way *not* using malloc. [ The problem was getting a traceback after corruption of the malloc arena, which just hangs under the current implementation. ] -- Toon Moene - e-mail: toon@moene.org - phone: +31 346 214290 Saturnushof 14, 3738 XG Maartensdijk, The Netherlands At home: http://moene.org/~toon/; weather: http://moene.org/~hirlam/ Progress of GNU Fortran: http://gcc.gnu.org/wiki/GFortran#news