* [Bug fortran/67367] Program crashes on READ(IOSTAT=IOS, ...) on directory OPEN()ed without error
2015-08-27 2:54 [Bug fortran/67367] New: Program crashes on READ(IOSTAT=IOS, ...) on directory OPEN()ed without error urbanjost at comcast dot net
@ 2015-08-27 4:18 ` jvdelisle at gcc dot gnu.org
2015-08-28 18:58 ` jvdelisle at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2015-08-27 4:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67367
Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-08-27
CC| |jvdelisle at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7ba152e in buf_read (s=0x6063b0, buf=<optimized out>,
nbyte=<optimized out>) at ../../../trunk/libgfortran/io/unix.c:535
535 memcpy (p, s->buffer, did_read);
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/67367] Program crashes on READ(IOSTAT=IOS, ...) on directory OPEN()ed without error
2015-08-27 2:54 [Bug fortran/67367] New: Program crashes on READ(IOSTAT=IOS, ...) on directory OPEN()ed without error urbanjost at comcast dot net
2015-08-27 4:18 ` [Bug fortran/67367] " jvdelisle at gcc dot gnu.org
@ 2015-08-28 18:58 ` jvdelisle at gcc dot gnu.org
2015-08-28 22:05 ` sgk at troutmask dot apl.washington.edu
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2015-08-28 18:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67367
Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |jvdelisle at gcc dot gnu.org
--- Comment #3 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
I wonder if these have been lurking since day 1.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/67367] Program crashes on READ(IOSTAT=IOS, ...) on directory OPEN()ed without error
2015-08-27 2:54 [Bug fortran/67367] New: Program crashes on READ(IOSTAT=IOS, ...) on directory OPEN()ed without error urbanjost at comcast dot net
2015-08-27 4:18 ` [Bug fortran/67367] " jvdelisle at gcc dot gnu.org
2015-08-28 18:58 ` jvdelisle at gcc dot gnu.org
@ 2015-08-28 22:05 ` sgk at troutmask dot apl.washington.edu
2015-08-29 0:16 ` jvdelisle at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: sgk at troutmask dot apl.washington.edu @ 2015-08-28 22:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67367
--- Comment #4 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Fri, Aug 28, 2015 at 06:58:25PM +0000, jvdelisle at gcc dot gnu.org wrote:
>
> --- Comment #3 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
> I wonder if these have been lurking since day 1.
>
I haven't gone looking for the origin, but from
my last excursion through io.c I think it was written
to accept what is standard conforming with very little
consideration from wrong code.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/67367] Program crashes on READ(IOSTAT=IOS, ...) on directory OPEN()ed without error
2015-08-27 2:54 [Bug fortran/67367] New: Program crashes on READ(IOSTAT=IOS, ...) on directory OPEN()ed without error urbanjost at comcast dot net
` (2 preceding siblings ...)
2015-08-28 22:05 ` sgk at troutmask dot apl.washington.edu
@ 2015-08-29 0:16 ` jvdelisle at gcc dot gnu.org
2015-08-29 15:39 ` jvdelisle at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2015-08-29 0:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67367
--- Comment #5 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
Created attachment 36265
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36265&action=edit
A preliminary patch - not final
This patch catches the segfault and we end up with an EOF error. It bothers me
that we get into this with both source and destination of the raw_read with bad
pointers, so I am going to explore further.
If one uses a regular open command, READ/WRITE is specified and one can not
write to a directory, so it throws the expected OS error. In the case of read
only, one cany open a directory, but it is only intended to be read with
readdir and not read (see man read and man readdir)
Stay tuned.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/67367] Program crashes on READ(IOSTAT=IOS, ...) on directory OPEN()ed without error
2015-08-27 2:54 [Bug fortran/67367] New: Program crashes on READ(IOSTAT=IOS, ...) on directory OPEN()ed without error urbanjost at comcast dot net
` (3 preceding siblings ...)
2015-08-29 0:16 ` jvdelisle at gcc dot gnu.org
@ 2015-08-29 15:39 ` jvdelisle at gcc dot gnu.org
2015-08-29 15:53 ` jvdelisle at gcc dot gnu.org
2015-08-31 0:14 ` jvdelisle at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2015-08-29 15:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67367
--- Comment #7 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
Author: jvdelisle
Date: Sat Aug 29 15:38:39 2015
New Revision: 227320
URL: https://gcc.gnu.org/viewcvs?rev=227320&root=gcc&view=rev
Log:
2015-08-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/67367
* io/unix.c (buf_read): Check for error condition and if found
return the error code.
Modified:
trunk/libgfortran/ChangeLog
trunk/libgfortran/io/unix.c
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/67367] Program crashes on READ(IOSTAT=IOS, ...) on directory OPEN()ed without error
2015-08-27 2:54 [Bug fortran/67367] New: Program crashes on READ(IOSTAT=IOS, ...) on directory OPEN()ed without error urbanjost at comcast dot net
` (4 preceding siblings ...)
2015-08-29 15:39 ` jvdelisle at gcc dot gnu.org
@ 2015-08-29 15:53 ` jvdelisle at gcc dot gnu.org
2015-08-31 0:14 ` jvdelisle at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2015-08-29 15:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67367
--- Comment #8 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
Author: jvdelisle
Date: Sat Aug 29 15:52:43 2015
New Revision: 227321
URL: https://gcc.gnu.org/viewcvs?rev=227321&root=gcc&view=rev
Log:
2015-08-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/67367
* gfortran.dg/read_dir.f90: New test. May fail on some platforms.
Added:
trunk/gcc/testsuite/gfortran.dg/read_dir.f90
Modified:
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/67367] Program crashes on READ(IOSTAT=IOS, ...) on directory OPEN()ed without error
2015-08-27 2:54 [Bug fortran/67367] New: Program crashes on READ(IOSTAT=IOS, ...) on directory OPEN()ed without error urbanjost at comcast dot net
` (5 preceding siblings ...)
2015-08-29 15:53 ` jvdelisle at gcc dot gnu.org
@ 2015-08-31 0:14 ` jvdelisle at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2015-08-31 0:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67367
Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #9 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
Fixed on trunk.
^ permalink raw reply [flat|nested] 8+ messages in thread