http://bugs.winehq.org/show_bug.cgi?id=17123
--- Comment #1 from Bernhard Übelacker bernhardu@vr-web.de 2009-01-24 18:09:29 --- The crash is actually in MSVCRT_fwrite
if(file->_cnt) { int pcnt=(file->_cnt>wrcnt)? wrcnt: file->_cnt; memcpy(file->_ptr, ptr, pcnt);
It is happening because file->_cnt contains 0xffffffff. This is because make calls in misc.c after the first (not crashing) vfprintf a
putchar ('\n');
This got probably inlined so not the msvcr version is used but the mingw implementation in it's stdio.h
__CRT_INLINE int __cdecl __MINGW_NOTHROW putchar(int __c) { return (--stdout->_cnt >= 0) ? (int) (unsigned char) (*stdout->_ptr++ = (char)__c) : _flsbuf (__c, stdout);}
At least in a Windows XP the call to _flsbuf corrects this 0xffffffff to 0 in this case.