public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/16908] New: Segfault in libgfortran/io/transfer.c
@ 2004-08-06 22:44 sgk at troutmask dot apl dot washington dot edu
  2004-08-14  2:56 ` [Bug fortran/16908] " bdavis at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: sgk at troutmask dot apl dot washington dot edu @ 2004-08-06 22:44 UTC (permalink / raw)
  To: gcc-bugs

Consider the following program:

   program synsig

   implicit none 

   integer n, nt, mt, m
   real dt, tm, w
   real, allocatable :: p(:)

   nt =  2049 ! if nt < 2049, then everything works.
 
   allocate(p(nt))
   p  = 0.e0

   inquire(iolength=mt) (p(m), m=1, nt)

   open(unit=12, file='syn.sax', access='direct', recl=mt)
   n = 1
   write(12, rec=n) mt, nt
   write(12, rec=n+1) (p(m), m=1, nt)
   close(12)

   inquire(iolength=mt) (p(m), m=1, nt)

   open(unit=12, file='syn.sax', access='direct', recl=mt)
   n = 1
   write(12, rec=n) mt, nt
   write(12, rec=n+1) (p(m), m=1, nt)
   close(12)

   end program synsig


If nt >= 2049, then the second time the program tries to create the
data file 'syn.sax', the program will segfault.




Program terminated with signal 11, Segmentation fault.
#0  0x000000000041a633 in memset ()
(gdb) bt
#0  0x000000000041a633 in memset ()
#1  0x0000000000402553 in _gfortran_next_record (done=1)
    at ../../../gcc/libgfortran/io/transfer.c:1235
#2  0x0000000000403474 in finalize_transfer () at
../../../gcc/libgfortran/io/transfer.c:1365
#3  0x0000000000403619 in _gfortran_st_write_done ()
    at ../../../gcc/libgfortran/io/transfer.c:1482
#4  0x00000000004003ed in MAIN__ () at synsig.f90:18
#5  0x000000000040064e in main (argc=Variable "argc" is not available.
) at ../../../gcc/libgfortran/fmain.c:18
(gdb) list
18        MAIN__ ();
19
20        /* Bye-bye!  */
21        return 0;
22      }

-- 
           Summary: Segfault in libgfortran/io/transfer.c
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sgk at troutmask dot apl dot washington dot edu
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet:  3.5.0 20040804
  GCC host triplet: amd64-unknown-freebsd5.2
GCC target triplet: amd64


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


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

end of thread, other threads:[~2004-08-21 15:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-06 22:44 [Bug fortran/16908] New: Segfault in libgfortran/io/transfer.c sgk at troutmask dot apl dot washington dot edu
2004-08-14  2:56 ` [Bug fortran/16908] " bdavis at gcc dot gnu dot org
2004-08-14  2:57 ` [Bug libfortran/16908] " bdavis at gcc dot gnu dot org
2004-08-14  7:06 ` pinskia at gcc dot gnu dot org
2004-08-21  4:58 ` bdavis at gcc dot gnu dot org
2004-08-21 11:20 ` cvs-commit at gcc dot gnu dot org
2004-08-21 15:25 ` pinskia 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).