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

* [Bug fortran/16908] Segfault in libgfortran/io/transfer.c
  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 ` bdavis at gcc dot gnu dot org
  2004-08-14  2:57 ` [Bug libfortran/16908] " bdavis at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: bdavis at gcc dot gnu dot org @ 2004-08-14  2:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bdavis at gcc dot gnu dot org  2004-08-14 02:56 -------
Here is the testcase reduced a bit more:

cat a.f90
     program synsig
     implicit none
     integer n
     open(unit=12, file='syn.sax', access='direct', recl=8196)
     n = 1
     write(12, rec=n) 100
     end program synsig
   
   
   
 $ gfc a.f90
 $ ./a.out
 $ ./a.out
Segmentation fault (core dumped)



Something very basic has broken.  This problem is in libfortran.

--bud davis



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  GCC build triplet| 3.5.0 20040804             |3.5.0 20040804


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


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

* [Bug libfortran/16908] Segfault in libgfortran/io/transfer.c
  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 ` bdavis at gcc dot gnu dot org
  2004-08-14  7:06 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: bdavis at gcc dot gnu dot org @ 2004-08-14  2:57 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|fortran                     |libfortran


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


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

* [Bug libfortran/16908] Segfault in libgfortran/io/transfer.c
  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
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-14  7:06 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-08-14 07:06:35
               date|                            |


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


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

* [Bug libfortran/16908] Segfault in libgfortran/io/transfer.c
  2004-08-06 22:44 [Bug fortran/16908] New: Segfault in libgfortran/io/transfer.c sgk at troutmask dot apl dot washington dot edu
                   ` (2 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: bdavis at gcc dot gnu dot org @ 2004-08-21  4:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bdavis at gcc dot gnu dot org  2004-08-21 04:58 -------
proposed patch:

http://gcc.gnu.org/ml/fortran/2004-08/msg00142.html

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


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

* [Bug libfortran/16908] Segfault in libgfortran/io/transfer.c
  2004-08-06 22:44 [Bug fortran/16908] New: Segfault in libgfortran/io/transfer.c sgk at troutmask dot apl dot washington dot edu
                   ` (3 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-08-21 11:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-08-21 11:20 -------
Subject: Bug 16908

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pbrook@gcc.gnu.org	2004-08-21 11:20:30

Modified files:
	gcc/testsuite  : ChangeLog 
	libgfortran    : ChangeLog 
	libgfortran/io : transfer.c 
Added files:
	gcc/testsuite/gfortran.dg: direct_io_1.f90 

Log message:
	2004-08-21  Bud Davis  <bdavis9659@comcast.net>
	
	PR 16908
	* io/transfer.c (next_record_w): Do not blank pad.
	* io/transfer.c (next_record): Take into account partial records.
	testsuite/
	* gfortran.dg/direct_io.f90: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4170&r2=1.4171
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/direct_io_1.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&r1=1.62&r2=1.63
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/io/transfer.c.diff?cvsroot=gcc&r1=1.9&r2=1.10



-- 


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


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

* [Bug libfortran/16908] Segfault in libgfortran/io/transfer.c
  2004-08-06 22:44 [Bug fortran/16908] New: Segfault in libgfortran/io/transfer.c sgk at troutmask dot apl dot washington dot edu
                   ` (4 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-21 15:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-21 15:25 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.5.0


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).