New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thread safety issues with _fio #8870
Labels
bug
Something isn't working
Comments
#8814 ? |
Yes. that's the one. Sorry, I had a bit of trouble remembering. |
JGRennison
added a commit
to JGRennison/Upstream-OpenTTD
that referenced
this issue
Apr 10, 2021
…:DrawMouseCursor See also: OpenTTD#8977
JGRennison
added a commit
to JGRennison/Upstream-OpenTTD
that referenced
this issue
Apr 10, 2021
LordAro
pushed a commit
to LordAro/OpenTTD
that referenced
this issue
Apr 17, 2021
_fio is dead as of #9039, so all issues involved presumed fixed :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version of OpenTTD
Current master 9bfa719
Context
If I remember correctly, there was some discussion/issue/etc recently about crashes in fseek on Windows, which I'm now unable to find.
Running TheadSanitizer on the current master on Linux/SDL2 brought up quite a few new warnings about thread unsafe use of _fio and fseek calls in particular.
This seems potentially related, so may be of some interest.
On the surface, it appears that multiple threads are using _fio without suitable locking, so there is the potential for threads to scribble over each other whilst doing file IO.
It looks like _fio contains static read buffers, a file descriptor, etc, which looks a bit dubious from a threaded perspective.
Probably _fio should be removed entirely or made non-static, along with related free-standing functions like FioReadByte(), etc.
Might be worth considering for 1.11?
Data
The text was updated successfully, but these errors were encountered: