https://bugs.winehq.org/show_bug.cgi?id=49378
--- Comment #2 from Pauli Nieminen suokkos@gmail.com --- (In reply to Rafał Mużyło from comment #1)
...it might be completely unrelated, but (mentioned this awhile ago on irc) I've recently ran into an interesting case: a Unity game, that was crashing due to 'address space exhaustion', that before the crash was printing a stack trace several times.
If output uses stdio then https://source.winehq.org/patches/data/186903 is a potential fix for multiple prints from a buffered stdio output. The patch was a response to a related issue report at mailing list.
But even with that patch I can see some output errors from buffered stdio. I think there is more work to be done for stable multibyte output using msvcrt stdio. But issues are relative minor after patch 186903 and fix for this bug.
It is easy to make a hack fix for this bug. Proper fix would be fairly easy using mbrlen or mbrtowc. But I think those aren't available in kernel32.dll.