Open uniflare opened 2 years ago
I should add, this only started happening recently. My cause is a guess using my limited knowledge of how windows stderr pipes work - it seems to be the logical conclusion. Perhaps the Arma3 executable was piping stderr before on windows, but not anymore for some reason? (or another mod I was using was doing so, and stopped in a recent update).
Eitherway, it appears stderr piping on Windows cannot be relied upon in this manner. On Windows, I would reccomend maybe OutputDebugString to output directly to MSVC output window.
Hi, thanks. That's super weird. I have never touched any of stderr, and as for my knowledge I shouldn't if I am just making a simple dll. Is there any solid repro for this? When does it happen? During saving of vindicta game state?
Oh I see, @xoorath you have redirected logs to stderr, I failed to notice it. So this might be interesting for you :) I will check the PR later. Tbh I never used stderr and I am not entirely sure how this stream is supposed to work at all in C++ :D . I will need to do a bit of study first.
Hey, thanks for the reply.
I could be wrong ofcourse, I have not tried reading stderr to see if it allows the process to continue, however generally, a pipe has a buffer in the CRT, and then the kernel has another buffer. If you fill a pipe buffer - kernel and CRT - then the next write will wait until someone reads from the pipe (effectively clearing space for more data).
On Linux, this may not be an issue, since you are always using the terminal, which consumes the std pipes automatically. However on windows, this doesn't seem to be the case right now on Arma (a Window doesn't consume these pipes automatically, something has to be written to consume these pipes).
I can repro this 100% everytime on our server, if I use default FileXT binaries (which appears to log to stderr pipe). With the PR change, it no longer hangs.
This will hang after a few saves in our KO Liberation server, on extension call to save. Though it can hang technically on any stderr fprintf that ends up filling the buffer.
--
If you would like to repro, you could probably repro easily by continually calling an extension function, that simply write a lot of data to the stderr pipe.
Oh, so you are using it for non-vindicta? I guess it's first usage outside of our mod then :)
Yes - our group played quite a bit of Vindicta and just trying new things :). This is a useful mod, I made a similar mod myself years ago but having one cleaner and maintained by someone else is obviously much easier for me :D.
So I appreciate you sharing your hard work.
I setup a HyperV Debian server and I didn't noticed any issues. Although on both windows and linux the messages aren't logged properly (PR pending #12 ).
Hey, I haven't been around to check this out - thanks a lot for looking into this. I didn't expect that to be a problem, I learned something new.
Looks like FileXT is filling the
stderr
buffer which, at least on windows, when it is full causes the main thread to stall on Arma3 (nothing is emptying/reading the buffer).Server Details:
Call Stack:
Pull Request to fix and refactor logging mechanism: #9