Hi,
this is still unchanged and unresolved. printf’s source is at …MSVStudio.NET\Vc7\crt\src\fprintf.c. Here’s the relevant backtrace of a warning:
> msvcr70.dll!write_char(char ch='W', _iobuf * f=0x7c0495a8, int * pnumwritten=0x01c02104) Line 1139 C
msvcr70.dll!write_string(char * string=0x7c0495a8, int len=162, _iobuf * f=0x7c0495a8, int * pnumwritten=0x00000057) Line 1258 + 0xd C
msvcr70.dll!_output(_iobuf * stream=0x7c0495a8, const char * format=0x1033fefe, char * argptr=0x01c02178) Line 1031 + 0xe C
msvcr70.dll!fprintf(_iobuf * str=0x1033ff4c, const char * format=0x1033ff08, ...) Line 48 C
libCore.dll!DefaultErrorHandler(int level=1000, bool abort=false, const char * location=0x103cb237, const char * msg=0x066a0de8) Line 124 + 0x16 C++
libCore.dll!DefaultErrorHandler(int level=1000, bool abort=false, const char * location=0x103cb237, const char * msg=0x066a0de8) Line 124 + 0x16 C++
libCore.dll!ErrorHandler(int level=1000, const char * location=0x103cb237, const char * fmt=0x01a88768, char * ap=0x01c0222c) Line 167 + 0x21 C++
libCore.dll!TObject::DoError(int level=1000, const char * location=0x01a89148, const char * fmt=0x01a88768, char * va=0x01c0222c) Line 948 + 0x38 C++
libCore.dll!TObject::Warning(const char * location=0x01a89148, const char * fmt=0x01a88768, ...) Line 971 + 0x1d C++
From the debug output I can see that the stream is ==stderr. write_char calls _putc_lk(char, FILE*) (see output.c:1135), but for that there are no sources anymore. This part just fills the buffer, directly afterwards the buffer (file handle==2) is flushed:
> msvcr70.dll!_write_lk(int fh=2, const void * buf=0x06563d88, unsigned int cnt=163) Line 182 C
msvcr70.dll!_write(int fh=2, const void * buf=0x06563d88, unsigned int cnt=163) Line 79 + 0xc C
msvcr70.dll!_flush(_iobuf * str=0x7c0495a8) Line 163 + 0xa C
msvcr70.dll!_ftbuf(int flag=1, _iobuf * str=0x7c0495a8) Line 154 C
msvcr70.dll!fprintf(_iobuf * str=0x7c0495a8, const char * format=0x1033fefc, ...) Line 69 + 0x9 C
libCore.dll!debugPrint(const char * fmt=0x1033ff4c, ...) Line 69 + 0x1d C++
libCore.dll!DefaultErrorHandler(int level=1000, bool abort=false, const char * location=0x103cb237, const char * msg=0x066a0de8) Line 124 + 0x16 C++
libCore.dll!ErrorHandler(int level=1000, const char * location=0x103cb237, const char * fmt=0x01a88768, char * ap=0x01c0222c) Line 167 + 0x21 C++
libCore.dll!TObject::DoError(int level=1000, const char * location=0x01a89148, const char * fmt=0x01a88768, char * va=0x01c0222c) Line 948 + 0x38 C++
libCore.dll!TObject::Warning(const char * location=0x01a89148, const char * fmt=0x01a88768, ...) Line 971 + 0x1d C++
where _write_lk calls WriteFile((HANDLE)_osfhnd(2), char* buffer, len, &written, NULL) (again, no source). Looks all good to me, I can’t see any corruption in the buffers - but it still doesn’t work.
What can we do about that? Philippe, do you have any idea? I still suspect threading (well, more precisely locking) to be the issue, but I wouldn’t know how to test that.
Axel.