[Bug fortran/41328] [4.4/4.5 regression] bad iostat when reading DOS file in a character array (non-advancing)

2009-09-18 Thread rguenth at gcc dot gnu dot org


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|--- |4.4.2


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



[Bug fortran/41328] [4.4/4.5 regression] bad iostat when reading DOS file in a character array (non-advancing)

2009-09-18 Thread rguenth at gcc dot gnu dot org


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

   Priority|P3  |P4


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



[Bug fortran/41328] [4.4, 4.5 regression] bad iostat when reading DOS file in a character array (non-advancing)

2009-09-18 Thread jvdelisle at gcc dot gnu dot org


--- Comment #8 from jvdelisle at gcc dot gnu dot org  2009-09-18 19:20 
---
Here is a new test case, closely related, reported on fortran list:

http://gcc.gnu.org/ml/fortran/2009-09/msg00126.html

The read of the last line in a file without the end-of-line marker should be
treated as seeing and EOR.

program test
 character (len=80) :: u
 character (len=20) :: filename
 integer :: n, k=0
 n = iargc()
 if (n  0) then
call getarg(1,filename)
else
   stop 'argument missing'
endif
 open(unit=1,file=filename,status='old')
 do
read(1,'(a80)',end=100,err=101) u
k = k+1
print*,k,' : ',u(1:len_trim(u))
enddo
100 stop 100
101 stop 101
end program test


-- 

jvdelisle at gcc dot gnu dot org changed:

   What|Removed |Added

  Known to fail||4.5.0
  Known to work|4.5.0   |4.3.0
Summary|[4.4 regression] bad iostat |[4.4, 4.5  regression] bad
   |when reading DOS file in a  |iostat when reading DOS file
   |character array (non-   |in a character array (non-
   |advancing)  |advancing)


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



[Bug fortran/41328] [4.4, 4.5 regression] bad iostat when reading DOS file in a character array (non-advancing)

2009-09-18 Thread jvdelisle at gcc dot gnu dot org


-- 

jvdelisle at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|4.4.2   |4.5.0


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



[Bug fortran/41328] [4.4, 4.5 regression] bad iostat when reading DOS file in a character array (non-advancing)

2009-09-18 Thread jvdelisle at gcc dot gnu dot org


--- Comment #9 from jvdelisle at gcc dot gnu dot org  2009-09-19 04:42 
---
Subject: Bug 41328

Author: jvdelisle
Date: Sat Sep 19 04:41:38 2009
New Revision: 151877

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=151877
Log:
2009-09-18  Jerry DeLisle  jvdeli...@gcc.gnu.org

PR libgfortran/41328
* io/transfer.c (read_sf): Set at_eof flag on short read if any
characters were successfully read so that EOF condition with no EOR
marker succeeds.

Modified:
trunk/libgfortran/ChangeLog
trunk/libgfortran/io/transfer.c


-- 


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



[Bug fortran/41328] [4.4, 4.5 regression] bad iostat when reading DOS file in a character array (non-advancing)

2009-09-18 Thread jvdelisle at gcc dot gnu dot org


--- Comment #10 from jvdelisle at gcc dot gnu dot org  2009-09-19 04:45 
---
Subject: Bug 41328

Author: jvdelisle
Date: Sat Sep 19 04:45:00 2009
New Revision: 151878

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=151878
Log:
2009-09-18  Jerry DeLisle  jvdeli...@gcc.gnu.org

PR libgfortran/41328
* gfortran.dg/cr_lf.f90: Modify test to include check that no EOR with
EOF works.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/cr_lf.f90


-- 


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



[Bug fortran/41328] [4.4/4.5 regression] bad iostat when reading DOS file in a character array (non-advancing)

2009-09-12 Thread jvdelisle at gcc dot gnu dot org


--- Comment #5 from jvdelisle at gcc dot gnu dot org  2009-09-13 03:41 
---
Subject: Bug 41328

Author: jvdelisle
Date: Sun Sep 13 03:41:41 2009
New Revision: 151665

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=151665
Log:
2009-09-12  Jerry DeLisle  jvdeli...@gcc.gnu.org

PR libgfortran/41328
* io/transfer.c (read_sf): Adjust fbuf position and do proper
fbuf reads to traverse CR, CR-LF, and LF style line ends.

Modified:
trunk/libgfortran/ChangeLog
trunk/libgfortran/io/transfer.c


-- 


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



[Bug fortran/41328] [4.4/4.5 regression] bad iostat when reading DOS file in a character array (non-advancing)

2009-09-12 Thread jvdelisle at gcc dot gnu dot org


--- Comment #6 from jvdelisle at gcc dot gnu dot org  2009-09-13 03:44 
---
Subject: Bug 41328

Author: jvdelisle
Date: Sun Sep 13 03:44:34 2009
New Revision: 151666

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=151666
Log:
2009-09-12  Jerry DeLisle  jvdeli...@gcc.gnu.org

PR libgfortran/41328
* gfortran.dg/cr_lf.f90: New test.

Added:
trunk/gcc/testsuite/gfortran.dg/cr_lf.f90
Modified:
trunk/gcc/testsuite/ChangeLog


-- 


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



[Bug fortran/41328] [4.4/4.5 regression] bad iostat when reading DOS file in a character array (non-advancing)

2009-09-12 Thread jvdelisle at gcc dot gnu dot org


--- Comment #7 from jvdelisle at gcc dot gnu dot org  2009-09-13 03:46 
---
Fixed on trunk.  Will commit to 4.4.x in a few days.

(approved by Janne on IRC)


-- 


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



[Bug fortran/41328] [4.4/4.5 regression] bad iostat when reading DOS file in a character array (non-advancing)

2009-09-10 Thread burnus at gcc dot gnu dot org


--- Comment #1 from burnus at gcc dot gnu dot org  2009-09-10 11:46 ---
Jerry, can you have a look? I can reproduce it under Linux with 4.5.0 20090910
with CRLF line breaks.

Valgrind error is:
==658== Conditional jump or move depends on uninitialised value(s)
==658==at 0x4EDDD45: _gfortrani_read_sf (transfer.c:245)

   242/* If we encounter a CR, it might be a CRLF.  */
   243if (q == '\r') /* Probably a CRLF */
   244  {
   245if (n  *length  *(p + 1) == '\n')
   246  dtp-u.p.sf_seen_eor = 2;

The IOSTAT error shown is 5008, which means LIBERROR_ENDFILE.


-- 

burnus at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||jvdelisle at gcc dot gnu dot
   ||org
 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2009-09-10 11:46:48
   date||


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



[Bug fortran/41328] [4.4/4.5 regression] bad iostat when reading DOS file in a character array (non-advancing)

2009-09-10 Thread jvdelisle at gcc dot gnu dot org


--- Comment #2 from jvdelisle at gcc dot gnu dot org  2009-09-11 00:16 
---
yes, this is a duplicate of the other PR I am workinmg on (PR41168).  The code
snippet in comment #1 is the exact spot I am working on. Two problems here.  We
can possiblly accessing memory that has not been allocated because *(p + 1)
points to 1 byte passed what we have read.  Second, is the handling of the
situation where the read reaches exactly between the CR and LF.


-- 

jvdelisle at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jvdelisle at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2009-09-10 11:46:48 |2009-09-11 00:16:03
   date||


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



[Bug fortran/41328] [4.4/4.5 regression] bad iostat when reading DOS file in a character array (non-advancing)

2009-09-10 Thread jvdelisle at gcc dot gnu dot org


--- Comment #3 from jvdelisle at gcc dot gnu dot org  2009-09-11 05:33 
---
Patch submitted.  See:

http://gcc.gnu.org/ml/fortran/2009-09/msg00062.html


-- 


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