[Bug fortran/65795] New: Segfault (invalid write) for ALLOCATE statement involving COARRAYS
burnus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Apr 17 15:24:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65795
Bug ID: 65795
Summary: Segfault (invalid write) for ALLOCATE statement
involving COARRAYS
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: burnus at gcc dot gnu.org
Created attachment 35345
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35345&action=edit
Long test case
The program below fails with a segfault at run time. The segfault is in the
ALLOCATE line. Valgrind talks about:
Invalid write of size 8
at 0x40075F: MAIN__ (test.f90:16)
It fails here with both -fcoarray=single and -fcoarray=lib and with GCC 4.8,
4.9 and 5. At a glance, the original dump looks okay, but I likely missed
something.
Attachment: Some longer version; the idea was to use it for testing that
reallocation is properly done for coarrays. It still needs some refinement -
after the main bug has been fixed.
------------<cut>----------------
! Compile with -fcoarray=single or -fcoarray=lib
use iso_c_binding, only: c_intptr_t, c_loc
implicit none
type t2
integer, allocatable :: x
end type t2
type t3
type(t2), allocatable :: caf[:]
end type t3
type(t3), save, target :: c, d
integer :: stat
allocate(c%caf[*], stat=stat)
end
More information about the Gcc-bugs
mailing list