-
Notifications
You must be signed in to change notification settings - Fork 593
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
C++ race condition with Communicator::stringToProxy and Communicator::destroy #2585
Comments
It is not clear to me that this is a race condition issue. Doesn't |
That was just a snippet of the test that was failing. It was not exiting main for a while after. It's reproducible in just C++ .
|
After running this a bunch there seems to be a variety of failures you can get.
|
One issue is that endpoint factories set the instance member to nullptr during destroy, but access it without chekcing. For example: ice/cpp/src/Ice/TcpEndpointI.cpp Lines 373 to 377 in 1ae9e22
and: ice/cpp/src/Ice/TcpEndpointI.cpp Lines 353 to 357 in 1ae9e22
A second issue is the endpoint factory manager clears the factories vector, while it is in use: For example: ice/cpp/src/Ice/EndpointFactoryManager.cpp Lines 190 to 197 in 1ae9e22
and: ice/cpp/src/Ice/EndpointFactoryManager.cpp Lines 92 to 103 in 1ae9e22
We can fix this one by holding the mutex in destroy. For "invalid endpoint" it is probably because, the factory was destroyed and removed, before it has a chance to parse the endpoint. We can fix ReferenceFactory to throw CommunicatorDestroyedException in this case. I also got this crash with the same test:
|
While porting Swift to use async/await I got this crash
The code in question was running stringToProxy and destroy at the same time.
The text was updated successfully, but these errors were encountered: