memory management - gfortran Deallocation segmentation fault -
compiling gfortran, produces 4 'ok':
type typethree integer real*8 real*8, allocatable :: aa(:) end type typethree type typetwo type(typethree), allocatable :: b end type typetwo type typeone type (typetwo), allocatable :: c(:) end type typeone type(typeone), allocatable :: d(:) allocate(d(2)) print *, 'ok' deallocate(d) print *, 'ok' allocate(d(2)) print *, 'ok' allocate(d(1)%c(2)) print *, 'ok' deallocate(d(1)%c) print *, 'ok' end
and produces segmentation fault when trying deallocate d(1)%c
. using ifort
, resolves issue. removing integer i
under typethree
resolves issue. letting compiler deallocation (commenting out deallocate(d(1)%c)
) resolve issue. idea appreciated. using
ulimit -s unlimited
doesn't help.
also:
$ gfortran -v using built-in specs. collect_gcc=gfortran collect_lto_wrapper=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper target: x86_64-linux-gnu configured with: ../src/configure -v --with-pkgversion='ubuntu/linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/readme.bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu thread model: posix gcc version 4.6.3 (ubuntu/linaro 4.6.3-1ubuntu5)
it bug gfortran (until gfortran 4.6 included), upgrade compiler 4.7 or higher version , problem should disapear.
Comments
Post a Comment