Repository navigation
DAOS-19995 cart: hold a group reference for the RPC lifetime - #19584
frostedcmos wants to merge 5 commits into
Conversation
An RPC stores its group in rpc_priv->crp_grp_priv without taking a reference, at every site that assigns the field. crt_rpc_priv_free() releases no group reference either, so the reference the RPC relies on is the caller's attach reference. Once crt_group_detach() drops that reference and the count reaches zero, an RPC that is still alive - for example a request aborted during context teardown whose completion is processed after the caller has returned - dereferences the freed group in crt_rpc_priv_free() and in the timeout and completion paths that read group state. Take a group reference wherever crp_grp_priv is assigned: crt_req_create(), crt_req_create_internal() and the collective root path in crt_corpc_req_create(). Release it in crt_rpc_priv_free(). crt_req_set_endpoint() replaces the group, so release the previous reference there before taking the new one. Fixes: DAOS-19995 Signed-off-by: Jihyeon Gim <potatogim@gluesys.com>
Cover the fix that has an RPC hold a reference on its group: rank 0 creates a secondary group, sends an RPC on it, and destroys the secondary group while the RPC is still in flight, so the completion and crt_rpc_priv_free() run after the last external reference on the group is gone. Without the fix this is a use-after-free on crp_grp_priv. The test runs two crt_launch instances on one node through the grp_lifetime avocado test, following the corpc_errors pattern. Fixes: DAOS-19995 Signed-off-by: Jihyeon Gim <potatogim@gluesys.com>
Format no_pmix_grp_lifetime.c with the repository clang-format settings, and use the "(C) Copyright <year> <organization>" form in the two new test files. Add Gluesys to the spelling dictionary so pylint accepts it in the docstring. Signed-off-by: Jihyeon Gim <potatogim@gluesys.com>
|
Test stage Functional Cluster Box Medium Provider MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-19584/1/execution/node/1691/log |
Drop the copied host-name comment, use plain keys for the single hosts and tests variants, and run the test in daily regression instead of on every PR. Signed-off-by: Jihyeon Gim <potatogim@gluesys.com>
|
Thanks for the review. I applied these in #19526 (5dc4e67): the copied host-name comment is gone, hosts and tests are plain keys now, and the test runs in daily_regression instead of on every PR. The env_D_PROVIDER mux stays because it has two variants, and I kept the hosts_1 and grp_lifetime nesting to match the other cart configs such as rpc/multisend_one_node.yaml. |
|
Ticket title is 'RPCs can outlive group detach without holding a group reference' |
|
Test stage Functional Hardware Medium Provider MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-19584/2/execution/node/1818/log |
|
Test stage Functional Hardware Large MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-19584/3/execution/node/670/log |
|
2 unrelated failures due to ""NVMe SSD [0000:87:00.0] not found" on hdr-117 |
daltonbohning
left a comment
There was a problem hiding this comment.
ftest changes LGTM. Will defer to code owners for the C changes
crt_corpc_req_create() and the other sites assigning crp_grp_priv take a group reference when the field is set, so it pairs with the decref in crt_rpc_priv_free(). Without that, an RPC can outlive the group it points at: the uri and address lookups on send and the completion path dereference the group after its last external reference is gone.
Steps for the author:
After all prior steps are complete: