public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/97799] New: Passing CHARACTER*(*) var(*) through ENTRY causes segfaults
@ 2020-11-11 16:33 hockney at jpl dot nasa.gov
  2020-11-11 16:36 ` [Bug fortran/97799] " hockney at jpl dot nasa.gov
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: hockney at jpl dot nasa.gov @ 2020-11-11 16:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97799
           Summary: Passing CHARACTER*(*) var(*) through ENTRY causes
                    segfaults
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hockney at jpl dot nasa.gov
  Target Milestone: ---

Created attachment 49548
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49548&action=edit
bugtest.f -- program evincing bug

When a character(*)* var(*) is passed to a subroutine
through an entry point in another subroutine, gfortran 10.2.0
generates an exectuable which segfaults in a probablistic way.  This
is probably related to a warning about an internally
generated variable being used uninitialized.  The warning and error
do not occur in gfortran 9.2.0

   The attached file bugtest.f evinces this behavior.  The
attached file details.txt shows the exact compilition
flags to reproduce the failure, and also the resulting
backtrace.

  The exact combination of compilation flags matters.  All of
them produce the warning about carray.0 but some of them
both work and pass our valgrind test:

gfortran -Wall -g -S bugtest.f; gfortran bugtest.s -o bugtest  #  fail
gfortran -g bugtest.f -o bugtest  #  fail
gfortran -O1 bugtest.f -o bugtest  #  fail
gfortran -O2 bugtest.f -o bugtest  #  ok
gfortran -O3 bugtest.f -o bugtest  #  ok
gfortran -O2 -fPIC bugtest.f -o bugtest  #  fail
gfortran -O3 -fPIC bugtest.f -o bugtest  #  fail


The valgrind error trace for the errors is:
==32181== Conditional jump or move depends on uninitialised value(s)
==32181==    at 0x401438: master.0.top_entry_ (bugtest.f:53)
==32181==    by 0x40141B: char_entry_ (bugtest.f:49)
==32181==    by 0x40148F: MAIN__ (bugtest.f:6)
==32181==    by 0x401698: main (bugtest.f:12)


  gfortran 9.2.0 does not evince this bug.

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

end of thread, other threads:[~2020-11-13 11:11 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-11 16:33 [Bug fortran/97799] New: Passing CHARACTER*(*) var(*) through ENTRY causes segfaults hockney at jpl dot nasa.gov
2020-11-11 16:36 ` [Bug fortran/97799] " hockney at jpl dot nasa.gov
2020-11-11 16:37 ` hockney at jpl dot nasa.gov
2020-11-11 16:59 ` dominiq at lps dot ens.fr
2020-11-11 17:51 ` ted.drain at jpl dot nasa.gov
2020-11-11 18:57 ` dominiq at lps dot ens.fr
2020-11-11 20:23 ` anlauf at gcc dot gnu.org
2020-11-11 21:11 ` hockney at jpl dot nasa.gov
2020-11-12  6:26 ` tkoenig at gcc dot gnu.org
2020-11-12  7:53 ` tkoenig at gcc dot gnu.org
2020-11-12 13:27 ` tkoenig at gcc dot gnu.org
2020-11-12 15:29 ` hockney at jpl dot nasa.gov
2020-11-13 10:32 ` [Bug fortran/97799] [10/11 Regression] " tkoenig at gcc dot gnu.org
2020-11-13 11:09 ` jakub at gcc dot gnu.org
2020-11-13 11:11 ` jakub 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).