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

* [Bug fortran/109080] A write of a NAMELIST group containing an allocatable array is incorrect
  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 ` 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
  2 siblings, 0 replies; 4+ messages in thread
From: anlauf at gcc dot gnu.org @ 2023-03-09 18:11 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-03-09
             Status|UNCONFIRMED                 |WAITING
      Known to fail|                            |10.4.0, 11.3.0
      Known to work|                            |12.2.0, 13.0
     Ever confirmed|0                           |1

--- Comment #1 from anlauf at gcc dot gnu.org ---
This seems to have been fixed in gcc-12.
I see valgrind errors with versions <= 11, but not with >= 12.

Can you please update?

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

* [Bug fortran/109080] A write of a NAMELIST group containing an allocatable array is incorrect
  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
  2 siblings, 0 replies; 4+ messages in thread
From: urbanjost at comcast dot net @ 2023-03-10  1:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from urbanjost at comcast dot net ---
A cannot update, but on https://godbolt.org I found 12.2 was available, and
it worked there, so I suppose this can be closed.


Program returned: 0
Program stdout

&ARGS
 LINES="Xx","Yy","Zz",
 ALINES="Xx","Yy","Zz",
 BLINES="Xx","Yy","Zz",
 /

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

* [Bug fortran/109080] A write of a NAMELIST group containing an allocatable array is incorrect
  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
  2 siblings, 0 replies; 4+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2023-03-10  4:16 UTC (permalink / raw)
  To: gcc-bugs

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

Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jvdelisle at gcc dot gnu.org
         Resolution|---                         |INVALID
             Status|WAITING                     |RESOLVED

--- Comment #3 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
Closing, invalid in the sense that it has been fixed in a later version of
gfortran.

Report is appreciated regardless.

^ 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).