This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/56471] Program crashes when allocating a derived type with an allocatable component
- From: "w6ws at earthlink dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 20 Sep 2017 22:04:49 +0000
- Subject: [Bug fortran/56471] Program crashes when allocating a derived type with an allocatable component
- Auto-submitted: auto-generated
- References: <bug-56471-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56471
Walter Spector <w6ws at earthlink dot net> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |w6ws at earthlink dot net
--- Comment #3 from Walter Spector <w6ws at earthlink dot net> ---
Adding myself to the ticket. Here is another simple example using the trunk as
of today:
wws@w6ws-4:/tmp$ cat allscal.f90
program allscal
implicit none
type mytype_t
character(32), allocatable :: typescalar
end type
type (mytype_t), allocatable :: myobj
allocate (myobj)
allocate (myobj%typescalar)
myobj%typescalar = 'hello world'
print *, myobj%typescalar
deallocate (myobj%typescalar)
deallocate (myobj)
end program
wws@w6ws-4:/tmp$ /usr/local/gcc-trunk/bin/gfortran -g allscal.f90
wws@w6ws-4:/tmp$ echo $LD_LIBRARY_PATH
/usr/local/gcc-trunk/lib64
wws@w6ws-4:/tmp$ a.out
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
Backtrace for this error:
#0 0x7f3e526c44af in ???
#1 0x4008c5 in allscal
at /tmp/allscal.f90:10
#2 0x400b19 in main
at /tmp/allscal.f90:17
Segmentation fault (core dumped)
wws@w6ws-4:/tmp$ /usr/local/gcc-trunk/bin/gfortran --version
GNU Fortran (GCC) 8.0.0 20170920 (experimental)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
wws@w6ws-4: