{"action":"created","comment":{"url":"https://api.github.com/repos/ros2/rmw_opensplice/pulls/comments/46374035","id":46374035,"diff_hunk":"@@ -47,7 +47,27 @@ rmw_wait(\n   rmw_clients_t * clients,\n   rmw_time_t * wait_timeout)\n {\n-  DDS::WaitSet waitset;\n+  // We're making this object static to avoid a race between its destructor\n+  // being called on exit from this function and an interrupt guard condition\n+  // that holds a pointer to it being called in parallel from somewhere else.\n+  // This structure will be changed when we add to rmw the feature of supporting\n+  // multiple wait sets.\n+  static DDS::WaitSet waitset;","path":"rmw_opensplice_cpp/src/rmw_wait.cpp","position":10,"original_position":10,"commit_id":"cc500df4c66255fa018031f45eaa726dbc2d658c","original_commit_id":"cc500df4c66255fa018031f45eaa726dbc2d658c","user":{"login":"dirk-thomas","id":1335366,"avatar_url":"https://avatars.githubusercontent.com/u/1335366?v=3","gravatar_id":"","url":"https://api.github.com/users/dirk-thomas","html_url":"https://github.com/dirk-thomas","followers_url":"https://api.github.com/users/dirk-thomas/followers","following_url":"https://api.github.com/users/dirk-thomas/following{/other_user}","gists_url":"https://api.github.com/users/dirk-thomas/gists{/gist_id}","starred_url":"https://api.github.com/users/dirk-thomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dirk-thomas/subscriptions","organizations_url":"https://api.github.com/users/dirk-thomas/orgs","repos_url":"https://api.github.com/users/dirk-thomas/repos","events_url":"https://api.github.com/users/dirk-thomas/events{/privacy}","received_events_url":"https://api.github.com/users/dirk-thomas/received_events","type":"User","site_admin":false},"body":"Should we add a `TODO(...) ...` here?","created_at":"2015-12-02T03:34:35Z","updated_at":"2015-12-02T03:34:35Z","html_url":"https://github.com/ros2/rmw_opensplice/pull/97#discussion_r46374035","pull_request_url":"https://api.github.com/repos/ros2/rmw_opensplice/pulls/97","_links":{"self":{"href":"https://api.github.com/repos/ros2/rmw_opensplice/pulls/comments/46374035"},"html":{"href":"https://github.com/ros2/rmw_opensplice/pull/97#discussion_r46374035"},"pull_request":{"href":"https://api.github.com/repos/ros2/rmw_opensplice/pulls/97"}}},"pull_request":{"url":"https://api.github.com/repos/ros2/rmw_opensplice/pulls/97","id":52347444,"html_url":"https://github.com/ros2/rmw_opensplice/pull/97","diff_url":"https://github.com/ros2/rmw_opensplice/pull/97.diff","patch_url":"https://github.com/ros2/rmw_opensplice/pull/97.patch","issue_url":"https://api.github.com/repos/ros2/rmw_opensplice/issues/97","number":97,"state":"open","locked":false,"title":"Make WaitSet static in rmw_wait","user":{"login":"gerkey","id":1188842,"avatar_url":"https://avatars.githubusercontent.com/u/1188842?v=3","gravatar_id":"","url":"https://api.github.com/users/gerkey","html_url":"https://github.com/gerkey","followers_url":"https://api.github.com/users/gerkey/followers","following_url":"https://api.github.com/users/gerkey/following{/other_user}","gists_url":"https://api.github.com/users/gerkey/gists{/gist_id}","starred_url":"https://api.github.com/users/gerkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gerkey/subscriptions","organizations_url":"https://api.github.com/users/gerkey/orgs","repos_url":"https://api.github.com/users/gerkey/repos","events_url":"https://api.github.com/users/gerkey/events{/privacy}","received_events_url":"https://api.github.com/users/gerkey/received_events","type":"User","site_admin":false},"body":"This change is intended to prevent a race that can occur between (the exit of) `rmw_wait()` here and the invocation of `rmw_trigger_guard_condition` at https://github.com/ros2/rclcpp/blob/master/rclcpp/src/rclcpp/executor.cpp#L179.  The theory is that triggering the guard condition causes it to iterate over its internal list (of length 1) of wait sets to which it is attached, and that this can happen at exactly the time that one of that wait set is being destroyed in another thread.\r\n\r\nTo avoid that race, we never allow the wait set to be destroyed, and instead do our own cleanup (detaching conditions) of its contents on exit from `rmw_wait`.\r\n\r\nThis change is not meant to be permanent.  Rather, it is a pragmatic change that doesn't sacrifice any functionality (we're already mutually excluding calls to `rmw_wait`) but improves behavior until we add the new features regarding management of wait sets that is being worked on in #96. \r\n\r\nThis change appears to fix the segfault mentioned in https://github.com/ros2/system_tests/pull/72#issuecomment-157103620.","created_at":"2015-12-02T02:54:39Z","updated_at":"2015-12-02T03:34:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bc6e6e88ea000c336a5bd7a5a40fd915e7272c02","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ros2/rmw_opensplice/pulls/97/commits","review_comments_url":"https://api.github.com/repos/ros2/rmw_opensplice/pulls/97/comments","review_comment_url":"https://api.github.com/repos/ros2/rmw_opensplice/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ros2/rmw_opensplice/issues/97/comments","statuses_url":"https://api.github.com/repos/ros2/rmw_opensplice/statuses/cc500df4c66255fa018031f45eaa726dbc2d658c","head":{"label":"ros2:make-waitset-static","ref":"make-waitset-static","sha":"cc500df4c66255fa018031f45eaa726dbc2d658c","user":{"login":"ros2","id":3979232,"avatar_url":"https://avatars.githubusercontent.com/u/3979232?v=3","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"repo":{"id":22737337,"name":"rmw_opensplice","full_name":"ros2/rmw_opensplice","owner":{"login":"ros2","id":3979232,"avatar_url":"https://avatars.githubusercontent.com/u/3979232?v=3","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ros2/rmw_opensplice","description":"Implementation of the ROS Middleware (rmw) interface using PrismTech's OpenSplice DDS.","fork":false,"url":"https://api.github.com/repos/ros2/rmw_opensplice","forks_url":"https://api.github.com/repos/ros2/rmw_opensplice/forks","keys_url":"https://api.github.com/repos/ros2/rmw_opensplice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ros2/rmw_opensplice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ros2/rmw_opensplice/teams","hooks_url":"https://api.github.com/repos/ros2/rmw_opensplice/hooks","issue_events_url":"https://api.github.com/repos/ros2/rmw_opensplice/issues/events{/number}","events_url":"https://api.github.com/repos/ros2/rmw_opensplice/events","assignees_url":"https://api.github.com/repos/ros2/rmw_opensplice/assignees{/user}","branches_url":"https://api.github.com/repos/ros2/rmw_opensplice/branches{/branch}","tags_url":"https://api.github.com/repos/ros2/rmw_opensplice/tags","blobs_url":"https://api.github.com/repos/ros2/rmw_opensplice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ros2/rmw_opensplice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ros2/rmw_opensplice/git/refs{/sha}","trees_url":"https://api.github.com/repos/ros2/rmw_opensplice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ros2/rmw_opensplice/statuses/{sha}","languages_url":"https://api.github.com/repos/ros2/rmw_opensplice/languages","stargazers_url":"https://api.github.com/repos/ros2/rmw_opensplice/stargazers","contributors_url":"https://api.github.com/repos/ros2/rmw_opensplice/contributors","subscribers_url":"https://api.github.com/repos/ros2/rmw_opensplice/subscribers","subscription_url":"https://api.github.com/repos/ros2/rmw_opensplice/subscription","commits_url":"https://api.github.com/repos/ros2/rmw_opensplice/commits{/sha}","git_commits_url":"https://api.github.com/repos/ros2/rmw_opensplice/git/commits{/sha}","comments_url":"https://api.github.com/repos/ros2/rmw_opensplice/comments{/number}","issue_comment_url":"https://api.github.com/repos/ros2/rmw_opensplice/issues/comments{/number}","contents_url":"https://api.github.com/repos/ros2/rmw_opensplice/contents/{+path}","compare_url":"https://api.github.com/repos/ros2/rmw_opensplice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ros2/rmw_opensplice/merges","archive_url":"https://api.github.com/repos/ros2/rmw_opensplice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ros2/rmw_opensplice/downloads","issues_url":"https://api.github.com/repos/ros2/rmw_opensplice/issues{/number}","pulls_url":"https://api.github.com/repos/ros2/rmw_opensplice/pulls{/number}","milestones_url":"https://api.github.com/repos/ros2/rmw_opensplice/milestones{/number}","notifications_url":"https://api.github.com/repos/ros2/rmw_opensplice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ros2/rmw_opensplice/labels{/name}","releases_url":"https://api.github.com/repos/ros2/rmw_opensplice/releases{/id}","created_at":"2014-08-07T21:36:52Z","updated_at":"2015-04-30T00:26:57Z","pushed_at":"2015-12-02T02:54:39Z","git_url":"git://github.com/ros2/rmw_opensplice.git","ssh_url":"git@github.com:ros2/rmw_opensplice.git","clone_url":"https://github.com/ros2/rmw_opensplice.git","svn_url":"https://github.com/ros2/rmw_opensplice","homepage":"","size":523,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":1,"default_branch":"master"}},"base":{"label":"ros2:master","ref":"master","sha":"f2b3d3bb82900893b3022112a6c63f2d04bf896d","user":{"login":"ros2","id":3979232,"avatar_url":"https://avatars.githubusercontent.com/u/3979232?v=3","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"repo":{"id":22737337,"name":"rmw_opensplice","full_name":"ros2/rmw_opensplice","owner":{"login":"ros2","id":3979232,"avatar_url":"https://avatars.githubusercontent.com/u/3979232?v=3","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ros2/rmw_opensplice","description":"Implementation of the ROS Middleware (rmw) interface using PrismTech's OpenSplice DDS.","fork":false,"url":"https://api.github.com/repos/ros2/rmw_opensplice","forks_url":"https://api.github.com/repos/ros2/rmw_opensplice/forks","keys_url":"https://api.github.com/repos/ros2/rmw_opensplice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ros2/rmw_opensplice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ros2/rmw_opensplice/teams","hooks_url":"https://api.github.com/repos/ros2/rmw_opensplice/hooks","issue_events_url":"https://api.github.com/repos/ros2/rmw_opensplice/issues/events{/number}","events_url":"https://api.github.com/repos/ros2/rmw_opensplice/events","assignees_url":"https://api.github.com/repos/ros2/rmw_opensplice/assignees{/user}","branches_url":"https://api.github.com/repos/ros2/rmw_opensplice/branches{/branch}","tags_url":"https://api.github.com/repos/ros2/rmw_opensplice/tags","blobs_url":"https://api.github.com/repos/ros2/rmw_opensplice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ros2/rmw_opensplice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ros2/rmw_opensplice/git/refs{/sha}","trees_url":"https://api.github.com/repos/ros2/rmw_opensplice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ros2/rmw_opensplice/statuses/{sha}","languages_url":"https://api.github.com/repos/ros2/rmw_opensplice/languages","stargazers_url":"https://api.github.com/repos/ros2/rmw_opensplice/stargazers","contributors_url":"https://api.github.com/repos/ros2/rmw_opensplice/contributors","subscribers_url":"https://api.github.com/repos/ros2/rmw_opensplice/subscribers","subscription_url":"https://api.github.com/repos/ros2/rmw_opensplice/subscription","commits_url":"https://api.github.com/repos/ros2/rmw_opensplice/commits{/sha}","git_commits_url":"https://api.github.com/repos/ros2/rmw_opensplice/git/commits{/sha}","comments_url":"https://api.github.com/repos/ros2/rmw_opensplice/comments{/number}","issue_comment_url":"https://api.github.com/repos/ros2/rmw_opensplice/issues/comments{/number}","contents_url":"https://api.github.com/repos/ros2/rmw_opensplice/contents/{+path}","compare_url":"https://api.github.com/repos/ros2/rmw_opensplice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ros2/rmw_opensplice/merges","archive_url":"https://api.github.com/repos/ros2/rmw_opensplice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ros2/rmw_opensplice/downloads","issues_url":"https://api.github.com/repos/ros2/rmw_opensplice/issues{/number}","pulls_url":"https://api.github.com/repos/ros2/rmw_opensplice/pulls{/number}","milestones_url":"https://api.github.com/repos/ros2/rmw_opensplice/milestones{/number}","notifications_url":"https://api.github.com/repos/ros2/rmw_opensplice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ros2/rmw_opensplice/labels{/name}","releases_url":"https://api.github.com/repos/ros2/rmw_opensplice/releases{/id}","created_at":"2014-08-07T21:36:52Z","updated_at":"2015-04-30T00:26:57Z","pushed_at":"2015-12-02T02:54:39Z","git_url":"git://github.com/ros2/rmw_opensplice.git","ssh_url":"git@github.com:ros2/rmw_opensplice.git","clone_url":"https://github.com/ros2/rmw_opensplice.git","svn_url":"https://github.com/ros2/rmw_opensplice","homepage":"","size":523,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ros2/rmw_opensplice/pulls/97"},"html":{"href":"https://github.com/ros2/rmw_opensplice/pull/97"},"issue":{"href":"https://api.github.com/repos/ros2/rmw_opensplice/issues/97"},"comments":{"href":"https://api.github.com/repos/ros2/rmw_opensplice/issues/97/comments"},"review_comments":{"href":"https://api.github.com/repos/ros2/rmw_opensplice/pulls/97/comments"},"review_comment":{"href":"https://api.github.com/repos/ros2/rmw_opensplice/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ros2/rmw_opensplice/pulls/97/commits"},"statuses":{"href":"https://api.github.com/repos/ros2/rmw_opensplice/statuses/cc500df4c66255fa018031f45eaa726dbc2d658c"}}}}