This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/1362] New: segfault in __printf_fp


The Fortran main program is used to set the long double variable x; the segfault
happens in the call to printf:

$ cat segfault.f90 
  real(kind=10) :: x
  integer(kind=8) j(2)
  equivalence (x,j(1))
  j = (/30522239848135016_8,4294967297_8/)
  call isfinite(x)
  end
$ cat isfinite.c 
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
void isfinite_ (long double * x)
{
  if (isfinite(*x))
    puts ("x is finite");
  fflush (stdout);
  printf ("x = %Lg\n", *x);
}
$ gcc -c -std=c99 isfinite.c -g
$ ./bin/gfortran -static segfault.f90 isfinite.o -g
$ ./a.out 
x is finite
zsh: segmentation fault  ./a.out

Top of the gdb backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x08085ace in __printf_fp ()
(gdb) where
#0  0x08085ace in __printf_fp ()
#1  0x08081417 in vfprintf ()
#2  0x08065365 in printf ()
#3  0x080482e6 in isfinite_ (x=0xbf931900) at isfinite.c:9

System is a FC3 (package glibc-2.3.5-0.fc3.1), on a Pentium III (Coppermine)
with kernel 2.62.6.12-1.1376_FC3.

-- 
           Summary: segfault in __printf_fp
           Product: glibc
           Version: 2.3.5
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: gotom at debian dot or dot jp
        ReportedBy: fxcoudert at gcc dot gnu dot org
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=1362

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]