From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32471 invoked by alias); 5 Aug 2007 09:54:06 -0000 Received: (qmail 32354 invoked by uid 22791); 5 Aug 2007 09:54:06 -0000 X-Spam-Check-By: sourceware.org Received: from zs01.physik.fu-berlin.de (HELO zs01.physik.fu-berlin.de) (160.45.35.150) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 05 Aug 2007 09:54:03 +0000 Received: from ith.physik.fu-berlin.de ([160.45.32.115] helo=[127.0.0.1]) by zs01.physik.fu-berlin.de with esmtp (Exim 4.63) (envelope-from ) id 1IHco9-0005iC-AY; Sun, 05 Aug 2007 11:53:59 +0200 Message-ID: <46B59E35.3000407@net-b.de> Date: Sun, 05 Aug 2007 09:54:00 -0000 From: Tobias Burnus User-Agent: Thunderbird 2.0.0.4 (X11/20070613) MIME-Version: 1.0 To: Thomas Koenig CC: FX Coudert , Fortran List , gcc-patches list Subject: Re: [gfortran,patch] Allow backtracing non-library errors References: <23DD0646-EB5E-4621-9F64-71222F45CA01@gmail.com> <1186305632.3449.5.camel@meiner.onlinehome.de> In-Reply-To: <1186305632.3449.5.camel@meiner.onlinehome.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-ZEDV-Virus-Scanned: No viruses found. [Could not determine clamav version] X-ZEDV-Spam-Level: ---- X-ZEDV-Spam-Checker-Version: SpamAssassin 3.1.7-deb (2006-10-05) on zs01.physik.fu-berlin.de X-ZEDV-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.7-deb X-ZEDV-Spam-Report: * -1.8 ALL_TRUSTED Passed through trusted hosts only via SMTP * -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] 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: 2007-08/txt/msg00263.txt.bz2 Hi Thomas, Thomas Koenig wrote: > I can't get it to produce meaningful backtraces, though: > x = sqrt(x) > $ gfortran -g -fbacktrace -ffpe-trap=invalid u3.f90 && ./a.out > > Program received signal 8 (SIGFPE): Floating-point exception. > Backtrace for this error: > + /lib/i686/cmov/libc.so.6 [0xb7ce1208] > + /lib/i686/cmov/libc.so.6(__libc_start_main+0xe0) [0xb7ccd030] > For your test case I get: Program received signal 8 (SIGFPE): Floating-point exception. Backtrace for this error: + /lib64/libc.so.6 [0x2aefddcf1b20] + in the main program at line 3 of file a.f90 + /lib64/libc.so.6(__libc_start_main+0xf4) [0x2aefddcdeb54] However, using integer, pointer :: x x = 5 end I also don't get a useful backtrace: Program received signal 11 (SIGSEGV): Segmentation fault. Backtrace for this error: + /lib64/libc.so.6 [0x2ab873638b20] + function _fini (0x400850) but gdb has also no better backtrace: Program received signal SIGILL, Illegal instruction. #0 0x00000000004007ed in _fini () #1 0x00002b154ef6eb96 in ?? () from /lib64/ld-linux-x86-64.so.2 #2 0x00002b154f9042ce in exit () from /lib64/libc.so.6 #3 0x00002b154f8eeb5b in __libc_start_main () from /lib64/libc.so.6 #4 0x00000000004005e9 in _start () Ifort has for whatever reason a better backtrace in this case (with -traceback and also in gdb): Program received signal SIGSEGV, Segmentation fault. 0x000000000040279b in main$aa_$BLK () at aa.f90:2 2 x = 5 Current language: auto; currently fortran #0 0x000000000040279b in main$aa_$BLK () at aa.f90:2 #1 0x000000000040276a in main () Tobias