Skip to content
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

TopicManager is not thread-safe when advertising topics #3348

Open
scpeters opened this issue Sep 19, 2023 · 0 comments
Open

TopicManager is not thread-safe when advertising topics #3348

scpeters opened this issue Sep 19, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@scpeters
Copy link
Member

I'm not able to share a backtrace here, but I've seen a case in which gzserver crashes during initialization, failing the assert at TopicManager.hh:118 with a message of "FindPublication returned nullptr". The backtrace I saw was from the advertisement of ~/request in the Scene constructor, called by the initialization of a WideAngleCameraSensor. Looking at the code for TopicManager::UpdatePublications, TopicManager::FindPublication, and TopicManager::Advertise, I don't see protection for the TopicManager::advertisedTopics variable, so I think it is not thread-safe.

I'm guessing that multiple threads attempted to advertise ~/request at the same time. It should be possible to write a test that advertises new topics from multiple threads to try to reproduce this.

@scpeters scpeters added the bug Something isn't working label Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant