https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94268
fdlbxtqi <euloanty at live dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Host| |Windows 10. MinGW-W64 Target| |gcc 10.0 --- Comment #1 from fdlbxtqi <euloanty at live dot com> --- https://bitbucket.org/ejsvifq_mabmip/mingw-gcc/src/master/ You can try with this MinGW-GCC 10. I have found this issue for a very long time. It looks like std::filebuf does not set buffer size correctly or other weird issues with underlining msvcrt.