https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109889
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- Tulio found out that __gnu_debug::_Safe_iterator_base::_M_reset() is overwriting the stack where r2 (TOC pointer) was saved by __run_exit_handlers() (at address 0x00007fffffffe8e8). This function was called with the wrong address of the object. He was able to track this value back from __gnu_debug::_Safe_sequence_base::_M_detach_all() at debug.cc:325 p *this $1 = { _M_iterators = 0x7fffffffe8e8, _M_const_iterators = 0x0, _M_version = 1 }