https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122380
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- I'm unable to execute the code on ARM, so could you please try the following: Compile your repro.cc using GCC 14.3.0 and all the same options as you used previously (-std=gnu++20 -O2 etc) and add -save-temps to create the .ii file using the GCC 14 library headers Then compile that .ii file using GCC 15.2.0 (and all the same options again). Then try executing that. If you get the double-free with that combination, it suggests it's a change in the compiler code and not the libstdc++ headers (because you tested with "good" headers that work when compiled with GCC 14 but still got the runtime error). If there's no double-free, that suggests the problem is a change in the library headers between GCC 14 and 15.
