https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94788
--- Comment #4 from Jürgen Reuter <juergen.reuter at desy dot de> --- It is definitely this routine in our code that triggers this double free error: call simulation%init ([procname1], .true., .true., global, alt_env=alt_env) It really looks like that the garbage collector is mistreating the Fortran routines, and chokes in finalizing the subroutine.