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
Admin port: No synchronisation in NetworkAdminConsole which may be called from any thread #9388
Comments
I think the issue is bigger than what you have fixed in your patch. Under the assumption that Similarly I am wondering what the effect would be of just queueing those debug messages after |
Version of OpenTTD
master
Expected result
No thread safety issues.
Actual result
NetworkAdminConsole may be called at any time from any thread via the Debug macro.
This iterates ServerNetworkAdminSocketHandler instances and calls ServerNetworkAdminSocketHandler::SendConsole as required without performing any synchronisation.
Iterating ServerNetworkAdminSocketHandler whilst it is being modified could theoretically result in unwanted behaviour.
Concurrent calls to Packet::AddToQueue, or concurrent calls to Packet::AddToQueue and Packet::PopFromQueue, could theoretically result in a malformed packet queue.
I noticed this issue because I received a crash report where the above issue was triggered by debug messages logged from the UDP advertisement thread.
The text was updated successfully, but these errors were encountered: