https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89740
--- Comment #1 from bert hubert <ahu at ds9a dot nl> --- Comment on attachment 45981 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45981 a small reproduction for this bug. >#include <iostream> >#include <thread> >#include <string> >#include <unistd.h> > >using namespace std; > >void theThread() >{ > for(int counter = 0 ;; ++counter) { > usleep(250000); > cout << "Hi "<< counter << endl; > } >} > >int main() >{ > std::ios_base::sync_with_stdio(false); > // cin.tie(nullptr); > > string line; > thread t(theThread); > while(getline(cin, line)) > ; >}