https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94788
Thomas Koenig <tkoenig at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |NEW --- Comment #33 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- So, the first error in your reduced test case is ==8972== Invalid free() / delete / delete[] / realloc() ==8972== at 0x4C2F3B9: free (vg_replace_malloc.c:540) ==8972== by 0x5B2D05: __simulations_uti_MOD_simulations_10 (main_ut.f90:26224) ==8972== by 0x5B494E: MAIN__ (main_ut.f90:26298) ==8972== by 0x5B49BC: main (main_ut.f90:26288) ==8972== Address 0x7ed0510 is 0 bytes inside a block of size 8 free'd ==8972== at 0x4C2F3B9: free (vg_replace_malloc.c:540) ==8972== by 0x5B06F9: __simulations_uti_MOD_simulations_10 (main_ut.f90:26263) ==8972== by 0x5B494E: MAIN__ (main_ut.f90:26298) ==8972== by 0x5B49BC: main (main_ut.f90:26288) ==8972== Block was alloc'd at ==8972== at 0x4C2E221: malloc (vg_replace_malloc.c:309) ==8972== by 0x57D64E: __rt_data_MOD_rt_data_activate (main_ut.f90:24161) ==8972== by 0x5AFED1: __simulations_uti_MOD_simulations_10 (main_ut.f90:26250) ==8972== by 0x5B494E: MAIN__ (main_ut.f90:26298) ==8972== by 0x5B49BC: main (main_ut.f90:26288) where the invalid free is given in the line type(rt_data_t), dimension(1), target :: alt_env and the first one in call simulation%init ([procname1], .true., .true., global, alt_env=alt_env) type(rt_data_t) has a finalizer, rt_global_data_final. Hm, not tonight, but this is something to go on (I think).