From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17319 invoked by alias); 6 Feb 2015 11:07:33 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 17166 invoked by uid 48); 6 Feb 2015 11:07:29 -0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/60956] [4.8/4.9/5 Regression] error reading (and writing) large text files in gfortran Date: Fri, 06 Feb 2015 11:07:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.7.3 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-02/txt/msg00557.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60956 Tobias Burnus changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |burnus at gcc dot gnu.org --- Comment #5 from Tobias Burnus --- (In reply to Jerry DeLisle from comment #3) > I took a closer look at this one. The error I am getting is running out of > allocatable space in realloc used in fbuf.c (fbuf_alloc). We are allocating > one byte at a time, and just keep trying to douple the buffer when its not > big enough. > > I think we need to check for some max buffer size and when we approach it, > flush the fbuf and continue. I think we cannot completely get rid of buffering a complete record - if we do formatted I/O (contrary to list-directed I/O and unformatted). The problem is that the format can contain T, TL and TR. However, the test case only contains list-directed I/O, which doesn't require to cache the whole record. [For formatted, one could check the format statement - but there could be some performance trade off.]