[patch,libgfortran] Fix PR25835 Segfault or Bad Address error on unformatted sequential READ

Janne Blomqvist jblomqvi@cc.hut.fi
Tue Jan 24 06:32:00 GMT 2006


On Mon, Jan 23, 2006 at 10:08:33PM -0800, Steve Kargl wrote:
> On Mon, Jan 23, 2006 at 09:30:49PM -0800, Jerry DeLisle wrote:
> > 
> > I think we really ought to get this into 4.1.  I will commit to 4.2 with 
> > all the test cases from the PR in the next day or so.  I would like to 
> > accelerate this to 4.1 if someone can give an OK.  I have asked Dale to run 
> > his tests also.
> > 
> > I am curious though if we will get a performance hit on this.
> > 
> 
> I won't be able to look at this until Saturday.  As to the
> performance hit, I 2 comments. 1. It probably depends on
> the underlying filesystem.  There are situations with FreeBSD's
> softupdates where a write/rewind/write results in the first
> write actually never hitting the disk.

I suspect the issue is not how the OS schedules the writes (since
write() can return as soon as the data is in the OS buffers, unless
you use O_SYNC, right?), but rather the syscall overhead due to
frequent flushing.

I wonder, could this overhead be avoided if flushing is done only when
switching from writing to reading, and vice versa?

Another point afaik is that C stdio always flushes during a file
positioning operation. We don't do that, and it makes our buffering
code somewhat more complicated.

>  2. More importantly,
> a performance isn't important if the results without the 
> flush() are wrong.

Of course.

-- 
Janne Blomqvist
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 185 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060124/dc4d9d54/attachment.sig>


More information about the Fortran mailing list