public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/109080] New: A write of a NAMELIST group containing an allocatable array is incorrect
@ 2023-03-09 11:57 urbanjost at comcast dot net
  2023-03-09 18:11 ` [Bug fortran/109080] " anlauf at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: urbanjost at comcast dot net @ 2023-03-09 11:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109080

            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=2) :: lines(3)
character(len=2),allocatable :: blines(:) 
character(len=:),allocatable :: alines(:) 
namelist/args/lines, alines, blines
   lines  = ['Xx','Yy','Zz']
   alines = ['Xx','Yy','Zz']
   blines = ['Xx','Yy','Zz']
   write(*,nml=args,delim='quote')
end program gnubug

gfortran xx.f90
$ ./a.out
&ARGS
 LINES="Xx","Yy","Zz",
 ALINES= 3*"Xx",
 BLINES="Xx","Yy","Zz",
 /

./a.out
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

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/sigaction.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 ???

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-10  4:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-09 11:57 [Bug fortran/109080] New: A write of a NAMELIST group containing an allocatable array is incorrect urbanjost at comcast dot net
2023-03-09 18:11 ` [Bug fortran/109080] " anlauf at gcc dot gnu.org
2023-03-10  1:59 ` urbanjost at comcast dot net
2023-03-10  4:16 ` jvdelisle at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).