[Bug fortran/64230] [4.9/5 Regression] Invalid memory reference in a compiler-generated finalizer for allocatable component

mathewc at nag dot co.uk gcc-bugzilla@gcc.gnu.org
Fri Apr 24 12:39:00 GMT 2015


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

Mat Cross <mathewc at nag dot co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #9 from Mat Cross <mathewc at nag dot co.uk> ---
Thanks for the progress so far.

I built 4.9.3 to try on my larger piece of code. The problem still seems
present:

> uname -a
Linux whakarewarewa.nag.co.uk 3.19.4-200.fc21.x86_64 #1 SMP Mon Apr 13 21:43:26
UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

> gfortran --version
GNU Fortran (GCC) 4.9.3 20150415 (prerelease)

> cat test.f90
Program test
  Implicit None
  Type :: t1
    Integer, Allocatable :: i
  End Type
  Type :: t2
    Integer, Allocatable :: i
  End Type
  Type, Extends (t1) :: t3
    Type (t2) :: j
  End Type
  Type, Extends (t3) :: t4
    Integer, Allocatable :: k
  End Type
  Class (t1), Allocatable :: x
  Allocate (t4 :: x)
  Deallocate (x)
  Print *, 'ok'
End Program

> gfortran test.f90 && ./a.out

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

Backtrace for this error:
#0  0x2B51E7B11417
#1  0x2B51E7B11A2E
#2  0x3265A3495F
#3  0x401392 in __final_test_T3.2353 at test.f90:?
#4  0x400D45 in __final_test_T4.2342 at test.f90:?
#5  0x400E87 in MAIN__ at test.f90:?
Segmentation fault (core dumped)

Do you see this too?

I hope that reopening this PR is acceptable. If not then just let me know and I
will happily file a new one.



More information about the Gcc-bugs mailing list