bryancall opened a new pull request, #14083: URL: https://github.com/apache/trafficserver/pull/14083
`STEKShareServer::reset()` runs on config reload and at shutdown. It clears the state machine and the raft instance while the STEK updater thread can still be in its loop, and the updater dereferenced both without checking: the state machine after taking `sm_mutex`, and the raft instance after dropping and retaking `raft_mutex`. Either one crashes `traffic_server` if a reload or shutdown lands in that window. The updater now checks both under the lock it uses them with, and goes back to its wait loop when either is gone. Found from a Coverity Scan report on the unchecked `dynamic_cast` of the state machine. The windows are a few instructions wide, so I reproduced both with a local build (not part of this change) that sleeps for 10 seconds inside each one, then sent `traffic_ctl plugin msg stek_share reload` to a node of a five-node cluster while it slept. Without the fix, both reloads crashed `traffic_server` with SIGSEGV: one in `raft_server::is_leader()` called on the cleared raft instance, the other in `STEKShareSM::received_stek()` called on the cleared state machine. With the fix, both nodes stayed up, rejoined the cluster and received the next key. The existing stek_share Uranium test passes under ASAN. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
