From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E1DA5385781A; Tue, 23 Mar 2021 02:29:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E1DA5385781A From: "jvdelisle at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/99711] Crash when reading an allocated character array in namelist Date: Tue, 23 Mar 2021 02:29:12 +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: 10.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jvdelisle at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: 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: resolution cf_reconfirmed_on bug_status everconfirmed Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 02:29:13 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99711 Jerry DeLisle changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |--- Last reconfirmed| |2021-03-23 Status|RESOLVED |NEW Ever confirmed|0 |1 --- Comment #3 from Jerry DeLisle --- (In reply to kargl from comment #2) > (In reply to Jerry DeLisle from comment #1) > > F2018 standard section 13.10.3 List-directed Input > >=20 > > There is a note NOTE 13.29 at the end of the first sub-section 13.10.3.= 1" > >=20 > > "An allocatable, deferred-length character effective item does not have= its > > allocation status or allocated length changed as a result of list-direc= ted > > input." > >=20 > > This implies that if the strings of the array are not already allocated= to a > > resonable length, for example a string of blanks, then the read will at= tempt > > to transfer the file contents into unallocated strings. >=20 > Doesn't the line >=20 > allocate( character(len=3D10) :: cbulist_ru(5) ) >=20 > that is the first executable statement in the program > allocate an array of 5 strings with length 10? You are right Steve, tired eyes were "seeing" only the declaration. In that case this should be OK and I do see the segfault. It is likely a front end issue.=