public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/105800] New: Segfault deallocating a class, dimension(:) array
@ 2022-06-01  9:44 mscfd at gmx dot net
  2023-04-14  5:07 ` [Bug fortran/105800] " mscfd at gmx dot net
  2023-04-14 19:20 ` anlauf at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: mscfd at gmx dot net @ 2022-06-01  9:44 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105800
           Summary: Segfault deallocating a class, dimension(:) array
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mscfd at gmx dot net
  Target Milestone: ---

Created attachment 53062
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53062&action=edit
test class_dealloc.f90

Creating an array in a function with return value "type(t), dimension(:)", and
assigning it to a "class(t), dimension(:)" variable eventually leads to a
segfault when deallocating the array. See attached test.

valgrind shows invalid read due to uninitialised value (presumably the
type-descriptor of the "class(t), dimension(:)" variable is not completely
initialised). If the "type(t)" is changed to "class(t)" in the create function,
then it works fine, without any complains from valgrind.

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

end of thread, other threads:[~2023-04-14 19:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-01  9:44 [Bug fortran/105800] New: Segfault deallocating a class, dimension(:) array mscfd at gmx dot net
2023-04-14  5:07 ` [Bug fortran/105800] " mscfd at gmx dot net
2023-04-14 19:20 ` anlauf 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).