Skip to content

Remove erroneous assert in checklist state update

I got hit by an assertion (resulting in a crash) in priv_prune_pending_checks() due to a TCP connection timeout. It happened in code based on 0.1.18 but with a few patches from the master branch on top of it. However, I believe the error condition may still occur using latest code on master. I've tried to explain what I think happens in the commit comment replicated below.

====================================

The assumption that priv_prune_pending_checks() is only called when we have at least one selected pair is not true.

For example, when a TCP disconnection happens we prune all candidates related to that socket in nice_component_remove_socket(). If one of these candidates is part of the selected pair we will clear the selected pair. As part of the pruning process we will also step through the conncheck_list in conn_check_prune_socket() to see if any candidate pairs in the list should be removed and if so we call conn_check_update_check_list_state_for_ready(). If we're using aggressive nomination we might find several pairs that have been nominated which means we end up calling priv_prune_pending_checks() where we stumble on the assertion "priority > 0". But priority is 0 because we just cleared the selected pair.

I see another potential for priority == 0 if nice_component_clean_turn_servers() has been called.

Merge request reports