https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63614
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to dyle from comment #0) > Is this a gcc bug? Is it possible that std::this_thread::get_id() SIGSEVs? Yes it's possible if you don't use -pthread to link to libpthread. > (Yes, there's a race condition on std::cout. But this is not the point.) Is > there a drawback by creating a threads that way and could there be any > correlation to my sigsev? No, it's unlikely. You can rule that out by using std::thread(&A::foo, this) (In reply to dyle from comment #1) > Huh. It ain't std::this_thread::get_id(), it is the assignment! > Because this > > auto nThread = 1; > > as first statement in the thread crashes also. o.O Then that's unlikely to be a GCC bug, are you running out of stack, or scribbling on the stack from another function? Have you tried using valgrind, or asan, or -fstack-protector ?