Segmentation fault on exit from a custom constructor of an inherited type that has no new data members
John Haiducek
jhaiduce@gmail.com
Sat Feb 3 12:50:43 GMT 2024
I've discovered an apparent bug in gfortran 13.2.1, which to me looks like
it could be a duplicate of an existing bug. I'm wondering if I should add a
comment to the existing bug with my MWE code, file a new bug and reference
the existing one as possibly related, or not file a bug since it's probably
a duplicate.
Here's the details of the bug. The attached program produces a segmentation
fault in gfortran 13.2 and later but not in gfortran 11 or 12. From my own
experimentation and that of some community members on the fortran-lang
discourse, we determined that the following is required to trigger the
segmentation fault:
- A child type inherits from a parent type, but adds no new data members
- The child type has a finalization procedure
- A variable of the child type is instantiated by calling a custom
constructor
You can see the Discourse discussion on this at
https://fortran-lang.discourse.group/t/segmentation-fault-when-finalizing-an-inherited-type-with-custom-constructor/7319.
In the discussion it was pointed out that this might be related to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110987. In light of that, I'm
wondering if it would be best to file a bug on this, or to *not* file a bug
since it's a likely duplicate of an existing bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20240203/6fb05a53/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: segfault_finalizing_type.f90
Type: application/octet-stream
Size: 685 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20240203/6fb05a53/attachment.obj>
More information about the Fortran
mailing list