From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15974 invoked by alias); 2 Jul 2014 01:17:48 -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 15857 invoked by uid 48); 2 Jul 2014 01:17:36 -0000 From: "jvdelisle at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/61628] A program that reads from a file with stream access and uses pack() suddenly stops Date: Wed, 02 Jul 2014 01:17: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.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jvdelisle at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: 2014-07/txt/msg00064.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61628 --- Comment #13 from Jerry DeLisle --- Well I have been playing around a little. I wanted to see if the problem was in pack, so I did this: read( 10 ) matrix write(*,*) nx, ny, size(matrix) test = pack( matrix, matrix /= 1 ) write (*,*) test(1:5227) The array 'test' is declared and allocated exactly as 'matrix'. What I found is that if I set the range of test as shown, the write will give all the values up to that size. Greater then 5227 and things quit working and the write gives nothing. I still have no idea what's wrong. But it acts like either the allocation is not working correctly or a pointer is getting clobbered. If I was going to bet, it would be memory allocation problem. I will be doing some more tinkering as I have time.