pjnath/ice_strans: Relay candidate has invalid socket.
How to reproduce
Call someone until there's too many open file descriptor (failed allocation of turn socket). Must have TURN.enable
set to true
.
Result
Failed assertion in pjnath/ice_strans.c:
pj_assert(pj_sockaddr_has_addr(&cand->addr));
where cand
has type PJ_ICE_CAND_TYPE_RELAYED
and status of PJ_SUCCESS
, but does not have a foundation nor a valid socket (sa_family == 0).
I suspect
/* If the error happens during pj_turn_sock_create() or
* pj_turn_sock_alloc(), the candidate hasn't been added
* to the list.
*/
if (cand) {
pj_turn_session_info info;
pj_turn_sock_get_info(turn_sock, &info);
cand->status = (old_state == PJ_TURN_STATE_RESOLVING)? PJ_ERESOLVE : info.last_status;
}
to be the cause, because the candidate is added to the list between pj_turn_sock_create()
and pj_turn_sock_alloc()
.