From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9F56F3858CDB; Thu, 9 Mar 2023 11:57:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F56F3858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678363068; bh=ddiNYQmAFbVQU2VpCgJffd0qPwfHKQBrgvDn14noXjA=; h=From:To:Subject:Date:From; b=RA98M0K6PSGL04G8wRtm6xuSiP3nAtjaOvE+P86agGBEeS93vkkQZbIat1d+H27i8 6eXK413JHe4S31mtr+n55n3vexIb+oFQZYEKO0xqKeGEhm5Ezwdkpt1eaXOhfB2xWJ 1C3W5B8y3dKEXyv/SicktIlw60GvNMN4xfnRq/rI= From: "urbanjost at comcast dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/109080] New: A write of a NAMELIST group containing an allocatable array is incorrect Date: Thu, 09 Mar 2023 11:57:48 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 11.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: urbanjost at comcast dot net X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109080 Bug ID: 109080 Summary: A write of a NAMELIST group containing an allocatable array is incorrect Product: gcc Version: 11.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: urbanjost at comcast dot net Target Milestone: --- Sometimes it runs and writes out ALINES incorrectly, and sometimes the same executable segfaults. program gnubug implicit none character(len=3D2) :: lines(3) character(len=3D2),allocatable :: blines(:)=20 character(len=3D:),allocatable :: alines(:)=20 namelist/args/lines, alines, blines lines =3D ['Xx','Yy','Zz'] alines =3D ['Xx','Yy','Zz'] blines =3D ['Xx','Yy','Zz'] write(*,nml=3Dargs,delim=3D'quote') end program gnubug gfortran xx.f90 $ ./a.out &ARGS LINES=3D"Xx","Yy","Zz", ALINES=3D 3*"Xx", BLINES=3D"Xx","Yy","Zz", / ./a.out Program received signal SIGSEGV: Segmentation fault - invalid memory refere= nce. Backtrace for this error: #0 0x1516241f9700 in ??? #1 0x1516241f88a5 in ??? #2 0x15162402908f in ??? at /build/glibc-SzIz7B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/x86_64/sig= action.c:0 #3 0x151624173590 in ??? at ../sysdeps/x86_64/multiarch/memcmp-sse4.S:72 #4 0x15162443c187 in ??? #5 0x15162443cece in ??? #6 0x151624432974 in ??? #7 0x151624432d01 in ??? #8 0x55c8983f77d8 in ??? #9 0x55c8983f7821 in ??? #10 0x15162400a082 in __libc_start_main at ../csu/libc-start.c:308 #11 0x55c8983f710d in ??? #12 0xffffffffffffffff in ???=