From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27046 invoked by alias); 24 Apr 2009 17:59:26 -0000 Received: (qmail 26969 invoked by uid 48); 24 Apr 2009 17:59:09 -0000 Date: Fri, 24 Apr 2009 17:59:00 -0000 Message-ID: <20090424175909.26968.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/39879] double free or corruption abort with gfortran In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "kargl 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-04/txt/msg02261.txt.bz2 ------- Comment #6 from kargl at gcc dot gnu dot org 2009-04-24 17:59 ------- The problem is due to the null() in character(200), pointer :: descrip => null() If you comment out this statement or remove '=> null()', then the code compiles and runs. A slighly reduced testcase is module test_struct interface assignment (=) module procedure tao_lat_equal_tao_lat end interface type bunch_params_struct integer n_live_particle end type type tao_lattice_struct type (bunch_params_struct), allocatable :: bunch_params(:) type (bunch_params_struct), allocatable :: bunch_params2(:) end type type tao_universe_struct type (tao_lattice_struct), pointer :: model, design character(200), pointer :: descrip => null() end type type tao_super_universe_struct type (tao_universe_struct), allocatable :: u(:) end type type (tao_super_universe_struct), save, target :: s contains subroutine tao_lat_equal_tao_lat (lat1, lat2) implicit none type (tao_lattice_struct), intent(inout) :: lat1 type (tao_lattice_struct), intent(in) :: lat2 end subroutine end module program tao_program use test_struct implicit none type (tao_universe_struct), pointer :: u integer n allocate (s%u(1)) u => s%u(1) allocate (u%design, u%model) n = 112 allocate (u%model%bunch_params(0:n), u%design%bunch_params(0:n)) u%model = u%design u%model = u%design end program -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39879