From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4886 invoked by alias); 20 Oct 2009 20:15:32 -0000 Received: (qmail 4770 invoked by uid 48); 20 Oct 2009 20:15:20 -0000 Date: Tue, 20 Oct 2009 20:15:00 -0000 Message-ID: <20091020201520.4769.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/41478] Corrupted memory using PACK for derived-types with allocated components In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "janus at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-10/txt/msg01765.txt.bz2 ------- 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