https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102077
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- std::thread::detach doesn't dereference any pointers except 'this' and if that is null or invalid, the problem is not in libstdc++. This looks like a GDB bug.