You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both QOSEventHandler and its associated pubs/subs share
the same underlying rmw event listener.
When a pub/sub is destroyed, the listener is destroyed.
There is a data race when the ~QOSEventHandlerBase wants
to access the listener after it has been destroyed.
The QOSEventHandler stores a shared_ptr of its associated pub/sub.
But since we were clearing the listener event callbacks on the
base class destructor ~QOSEventHandlerBase, the pub/sub was
already destroyed, which means the rmw event listener was also
destroyed, thus causing a segfault when trying to obtain it
to clear the callbacks.
Clearing the callbacks on ~QOSEventHandler instead of
~QOSEventHandlerBase fixes the race, since the pub/sub are still valid.
Signed-off-by: Mauro Passerino <[email protected]>
0 commit comments