This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/41478] Corrupted memory using PACK for derived-types with allocated components
- From: "janus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Oct 2009 20:15:20 -0000
- Subject: [Bug fortran/41478] Corrupted memory using PACK for derived-types with allocated components
- References: <bug-41478-15192@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #11 from janus at gcc dot gnu dot org 2009-10-20 20:15 -------
Ok, I have identified the place in libgfortran where the segfault happens:
#0 *_gfortran_pack (ret=0x7fffec3ca650, array=0x7fffec3ca620,
mask=0x7fffec3ca440, vector=0x0) at
/home/jweil/gcc45/trunk/libgfortran/intrinsics/pack_generic.c:364
That line is:
if (GFC_UNALIGNED_4(ret->data) || GFC_UNALIGNED_4(array->data)
|| GFC_UNALIGNED_4(vector->data))
break;
So, the problem is that we ask for the 'data' field in the optional VECTOR
argument, which is not present here (i.e. vector=0x0)!
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41478