The attached and rather innocuous looking code generates the subject error. It is a simplified version of a much more complex test case (in which the select type is entered within a loop and the error shows up at the second iteration) =========================================================================== [sfili...@localhost bug20]$ gfortran -v Using built-in specs. COLLECT_GCC=gfortran COLLECT_LTO_WRAPPER=/usr/local/gnu46/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc/configure --prefix=/usr/local/gnu46 --enable-languages=c,c++,fortran Thread model: posix gcc version 4.6.0 20100823 (experimental) (GCC) [sfili...@localhost bug20]$ gfortran -o bug20 bug20.f90 [sfili...@localhost bug20]$ ./bug20 NV = 10 *** glibc detected *** ./bug20: double free or corruption (fasttop): 0x00000000018d8ae0 *** ======= Backtrace: ========= /lib64/libc.so.6[0x3381475676] ./bug20[0x400b53] ./bug20[0x400b91] /lib64/libc.so.6(__libc_start_main+0xfd)[0x338141ec5d] ./bug20[0x4007a9] ======= Memory map: ======== 00400000-00401000 r-xp 00000000 08:09 983344 /home/sfilippo/NUMERICAL/NewPSBLAS/GNUbugs/bug20/bug20 00601000-00602000 rw-p 00001000 08:09 983344 /home/sfilippo/NUMERICAL/NewPSBLAS/GNUbugs/bug20/bug20 018d8000-018f9000 rw-p 00000000 00:00 0 [heap] 3381000000-338101e000 r-xp 00000000 08:06 4964354 /lib64/ld-2.12.so 338121e000-338121f000 r--p 0001e000 08:06 4964354 /lib64/ld-2.12.so 338121f000-3381220000 rw-p 0001f000 08:06 4964354 /lib64/ld-2.12.so 3381220000-3381221000 rw-p 00000000 00:00 0 3381400000-3381575000 r-xp 00000000 08:06 4964358 /lib64/libc-2.12.so 3381575000-3381775000 ---p 00175000 08:06 4964358 /lib64/libc-2.12.so 3381775000-3381779000 r--p 00175000 08:06 4964358 /lib64/libc-2.12.so 3381779000-338177a000 rw-p 00179000 08:06 4964358 /lib64/libc-2.12.so 338177a000-338177f000 rw-p 00000000 00:00 0 3381800000-3381883000 r-xp 00000000 08:06 4964404 /lib64/libm-2.12.so 3381883000-3381a82000 ---p 00083000 08:06 4964404 /lib64/libm-2.12.so 3381a82000-3381a83000 r--p 00082000 08:06 4964404 /lib64/libm-2.12.so 3381a83000-3381a84000 rw-p 00083000 08:06 4964404 /lib64/libm-2.12.so 3382c00000-3382cf1000 r-xp 00000000 08:06 5092887 /usr/lib64/libgfortran.so.3.0.0 3382cf1000-3382ef1000 ---p 000f1000 08:06 5092887 /usr/lib64/libgfortran.so.3.0.0 3382ef1000-3382ef3000 rw-p 000f1000 08:06 5092887 /usr/lib64/libgfortran.so.3.0.0 3382ef3000-3382ef4000 rw-p 00000000 00:00 0 3385000000-3385016000 r-xp 00000000 08:06 4964412 /lib64/libgcc_s-4.4.4-20100630.so.1 3385016000-3385215000 ---p 00016000 08:06 4964412 /lib64/libgcc_s-4.4.4-20100630.so.1 3385215000-3385216000 rw-p 00015000 08:06 4964412 /lib64/libgcc_s-4.4.4-20100630.so.1 7f7a0b89c000-7f7a0b8a0000 rw-p 00000000 00:00 0 7f7a0b8d0000-7f7a0b8d1000 rw-p 00000000 00:00 0 7fffc443b000-7fffc4450000 rw-p 00000000 00:00 0 [stack] 7fffc4563000-7fffc4564000 r-xp 00000000 00:00 0 [vdso] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] Abortito (core dumped)
-- Summary: [OOP] double free with SELECT TYPE Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: sfilippone at uniroma2 dot it GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45384