https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112828
--- Comment #3 from Rich Townsend <townsend at astro dot wisc.edu> --- I can get the MWE to barf on MacOS/Arm (Sonoma 14.1.1), gfortran 13.1.0, by changing the length of the character vars in the main program from 64 to 16. The error is now: In file 'test.f90', around line 49: Error allocating 211106259502048 bytes: Cannot allocate memory Error termination. Backtrace: #0 0x102d77617 #1 0x102d781b7 #2 0x102d78457 #3 0x10275f5bb #4 0x10275fc37 #5 0x10275f84f #6 0x10275fc87 Once again, commenting out the allocate w/ STAT line makes the problem go away. It seems as though having two allocate invocations (one with stat, one without) is causing some kind of memory corruption.