[ros-users] [Discourse.ros.org] [Next Generation ROS] Adding clang thread safety analysis for ROS2 core packages

Emerson Knapp via Discourse.ros.org ros.discourse at gmail.com
Thu Feb 21 00:16:06 UTC 2019



[quote="gbiggs, post:2, topic:7930"]
How does the analysis handle threads that are not annotated? For example, threads inside the DDS implementation.
[/quote]



Anything not annotated doesn't get analyzed. The llvm libcxx implementation has the Capability annotations on its `std::mutex` implementation, but if you don't mark any data as `GUARDED_BY` the mutex, the analysis has nothing to operate on

[quote="gbiggs, post:2, topic:7930"]
I noticed in your proof of concept that there are places where locks have been added and places where they have been removed. Is this for the analysis or because the analysis found errors?
[/quote]
I kept all existing locking logic intact but shifted ownership of the locking around - The main difference is that in favor of a private mutex ownership patterm, I removed the "lock-wrapper" LockedObject pattern, because it spread out locking and safety in such a way that it would be easy to make more mistakes, spreads ownership of safety to any user of the data, instead of centralizing in the thread-accessed data. That may not be the way we want to go, it's just what seems to make the most sense to me





---
[Visit Topic](https://discourse.ros.org/t/adding-clang-thread-safety-analysis-for-ros2-core-packages/7930/3) or reply to this email to respond.




More information about the ros-users mailing list