https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64535
--- Comment #20 from rguenther at suse dot de <rguenther at suse dot de> --- On Tue, 27 Jan 2015, jakub at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64535 > > Jakub Jelinek <jakub at gcc dot gnu.org> changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > CC| |mark at gcc dot gnu.org > > --- Comment #19 from Jakub Jelinek <jakub at gcc dot gnu.org> --- > I think a destructor is too risky here. > Can't you just register with valgrind a pointer known not to be freed at exit? > Would be nice to have something like __libc_freeres for libstdc++ too, that > valgrind/mtrace/LeakSanitizer could invoke. > I'm afraid tons of programs just do busy work in various threads until some > thread exits the whole app, and your change could break it. It indeed would free memory of in-flight exceptions. Which means that process termination in OOM situations might become interesting? OTOH we now leak with dlopen/dlclose of libstdc++.so (just consider doing that multiple times).