public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/1362] New: segfault in __printf_fp
@ 2005-09-21 20:56 fxcoudert at gcc dot gnu dot org
  2005-10-01  1:39 ` [Bug libc/1362] " drepper at redhat dot com
  2005-10-01  8:04 ` fxcoudert at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-09-21 20:56 UTC (permalink / raw)
  To: glibc-bugs

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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libc/1362] segfault in __printf_fp
  2005-09-21 20:56 [Bug libc/1362] New: segfault in __printf_fp fxcoudert at gcc dot gnu dot org
@ 2005-10-01  1:39 ` drepper at redhat dot com
  2005-10-01  8:04 ` fxcoudert at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: drepper at redhat dot com @ 2005-10-01  1:39 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2005-10-01 01:39 -------
Send a C test case.  This is the C library.  If you cannot do that it is by
definition nobug.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING


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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libc/1362] segfault in __printf_fp
  2005-09-21 20:56 [Bug libc/1362] New: segfault in __printf_fp fxcoudert at gcc dot gnu dot org
  2005-10-01  1:39 ` [Bug libc/1362] " drepper at redhat dot com
@ 2005-10-01  8:04 ` fxcoudert at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-10-01  8:04 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From fxcoudert at gcc dot gnu dot org  2005-10-01 08:04 -------
(In reply to comment #1)
> Send a C test case.  This is the C library.  If you cannot do that it is by
> definition nobug.

No, it only means I'm a bad C programmer. I naively thought that, whatever the
isfinite_() function written in the bug report received as argument, it should
not segfault. Looks like I was wrong.

Closing as invalid, I already tried hard to make it only C, but can't do it.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID


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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-10-01  8:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-21 20:56 [Bug libc/1362] New: segfault in __printf_fp fxcoudert at gcc dot gnu dot org
2005-10-01  1:39 ` [Bug libc/1362] " drepper at redhat dot com
2005-10-01  8:04 ` fxcoudert at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).