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

Check for nullptr in TopicManager::ConnectPubToSub #2978

Conversation

emersonknapp
Copy link
Contributor

@emersonknapp emersonknapp commented Apr 20, 2021

Fixes #2875

This was causing a very occasional crash problem in real runs, and is reliably reproducible by the method shown in #2875 (comment) - which case is explicitly forced by the added regression test. Though it's a pathological case, there is nothing illegal about the test's usage of a global, public API, and therefore it needs the protection.

The crash case of #2875 is particularly bad in that it allows the server process to be crashed by an external process' actions - all it takes is a mis-timed "sub" message to the server.

This issue also exists in Gazebo9 and will need to be backported.

Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
@emersonknapp
Copy link
Contributor Author

I'm not sure I'll be able to make the regression test reliably fail without the fix - it seems that the Boost assertion isn't doing anything in this test when playing around with it, though it does always crash my example program as mentioned in #2875.

I'm not sure exactly how to handle the testing for this - I could use input from someone more familiar with gazebo/boost test/build setup.

@j-rivero j-rivero self-assigned this May 2, 2021
@j-rivero
Copy link
Contributor

j-rivero commented May 2, 2021

I have ported the test directly to gazebo11 branch, without the fixes in this PR, to check if the test is failing there:

  • Mac Build Status
  • Linux Build Status

@j-rivero
Copy link
Contributor

j-rivero commented May 3, 2021

I have ported the test directly to gazebo11 branch, without the fixes in this PR, to check if the test is failing there:

* Mac

* Linux

I see it crashing in both platforms and on my local machine so I think the test case is valid. After the patch the CI does not display this crashing anymore.

Co-authored-by: Jose Luis Rivero <jrivero@osrfoundation.org>
Copy link
Contributor

@j-rivero j-rivero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR and iterations @emersonknapp

@j-rivero j-rivero merged commit 9f2d2f4 into gazebosim:gazebo11 May 5, 2021
j-rivero added a commit that referenced this pull request May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gazebo9 - transport failure during ConnectPubToSub call
3 participants