http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51197

--- Comment #2 from Harald Anlauf <anlauf at gmx dot de> 2011-11-17 20:17:32 
UTC ---
(In reply to comment #1)

> > A fatal error occurred! Backtrace for this error:
> > #0  0x80588BF in _gfortrani_show_backtrace at backtrace.c:261
> > #1  0x80494B7 in _gfortrani_backtrace_handler at compile_options.c:46
> > #2  0xFFFFE3FF
> > #3  0x80493B3 in foo at gfcbug113.f90:8
> > #4  0x804940B in backtrace at gfcbug113.f90:3
> > Floating point exception (core dumped)
> > 
> > 
> > With gfortran 4.6:
> > 
> > Program received signal 8 (SIGFPE): Floating-point exception.
> > 
> > Backtrace for this error:
> >   + [0xffffe400]
> >   + function foo (0x80494B3)
> >     at line 8 of file gfcbug113.f90
> >   + function backtrace (0x804950C)
> >     at line 3 of file gfcbug113.f90
> >   + /lib/libc.so.6(__libc_start_main+0xe5) [0xb7641705]
> 
> What exactly do you want?
> 
> In 4.7, the last line of the backtrace is
> 
>    "Floating point exception (core dumped)".
> 
> That matches the first line from 4.6
> 
>    "Program received signal 8 (SIGFPE): Floating-point exception."
> 
> 
> In 4.7, the line 
> 
> #3  0x80493B3 in foo at gfcbug113.f90:8
> 
> 
> contains all of the information from 4.6
> 
>   + function foo (0x80494B3)
>     at line 8 of file gfcbug113.f90


Well, thanks for pointing out I was not precise enough.
While "reducing" the problem, I forgot that the difference
lies in where the line

> > Floating point exception (core dumped)

ends up.  Try redirecting stderr, you'll see that in the first
case (bash on linux) this line does *not* go to stderr,
while in the second case (4.6) it does.  When running programs
in a shell with output redirected, the information will end up
in different places.

So it would be nice to actually write the SIG* information also
to stderr.

Harald

Reply via email to