-
Notifications
You must be signed in to change notification settings - Fork 743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pjnath/turn_sock: Bad session state on destruction of TURN socket #3154
Comments
@oldiob Would you be able to create a pull request for this, then pjproject team can review it. |
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_destroy2' and calling `pj_turn_session_destroy' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_destroy' remains for ABI compatibility and call the new version `pj_turn_sock_destroy2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip/pjproject#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
@sauwming Could you please take a look? |
I tested the provided scenario here with pjsua sample app using the latest version, with Checking the code, when the TURN socket creation failed, it shouldn't be added as a candidate, so I'm puzzled as to how it could then trigger the assertion Perhaps you can test with the latest version, or provide us with the PJSIP log (level 5 or 6) so we can better understand the flow. Thanks. |
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_destroy2' and calling `pj_turn_session_destroy' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_destroy' remains for ABI compatibility and call the new version `pj_turn_sock_destroy2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
I guess it only applied to us finally |
I noticed you pushed a commit to your forked repo and if I could suggest a change in the patch is that I would add
I have created a patch last time when looking into this issue but didn't manage to test and verify if it works since I couldn't reproduce the problem, so didn't create a PR for it. Attached is the patch: |
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_destroy2' and calling `pj_turn_session_destroy' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_destroy' remains for ABI compatibility and call the new version `pj_turn_sock_destroy2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_destroy2' and calling `pj_turn_session_destroy' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_destroy' remains for ABI compatibility and call the new version `pj_turn_sock_destroy2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_destroy2' and calling `pj_turn_session_destroy' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_destroy' remains for ABI compatibility and call the new version `pj_turn_sock_destroy2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_destroy2' and calling `pj_turn_session_destroy' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_destroy' remains for ABI compatibility and call the new version `pj_turn_sock_destroy2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_shutdown2' and calling `pj_turn_session_shutdown2' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_shutdown' remains for ABI compatibility and call the new version `pj_turn_sock_shutdown2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_destroy2' and calling `pj_turn_session_destroy' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_destroy' remains for ABI compatibility and call the new version `pj_turn_sock_destroy2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_destroy2' and calling `pj_turn_session_destroy' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_destroy' remains for ABI compatibility and call the new version `pj_turn_sock_destroy2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_destroy2' and calling `pj_turn_session_destroy' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_destroy' remains for ABI compatibility and call the new version `pj_turn_sock_destroy2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_destroy2' and calling `pj_turn_session_destroy' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_destroy' remains for ABI compatibility and call the new version `pj_turn_sock_destroy2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_destroy2' and calling `pj_turn_session_destroy' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_destroy' remains for ABI compatibility and call the new version `pj_turn_sock_destroy2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_destroy2' and calling `pj_turn_session_destroy' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_destroy' remains for ABI compatibility and call the new version `pj_turn_sock_destroy2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_destroy2' and calling `pj_turn_session_destroy' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_destroy' remains for ABI compatibility and call the new version `pj_turn_sock_destroy2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_destroy2' and calling `pj_turn_session_destroy' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_destroy' remains for ABI compatibility and call the new version `pj_turn_sock_destroy2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_destroy2' and calling `pj_turn_session_destroy' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_destroy' remains for ABI compatibility and call the new version `pj_turn_sock_destroy2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_destroy2' and calling `pj_turn_session_destroy' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_destroy' remains for ABI compatibility and call the new version `pj_turn_sock_destroy2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_destroy2' and calling `pj_turn_session_destroy' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_destroy' remains for ABI compatibility and call the new version `pj_turn_sock_destroy2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_destroy2' and calling `pj_turn_session_destroy' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_destroy' remains for ABI compatibility and call the new version `pj_turn_sock_destroy2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_shutdown2' and calling `pj_turn_session_shutdown2' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_shutdown' remains for ABI compatibility and call the new version `pj_turn_sock_shutdown2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_shutdown2' and calling `pj_turn_session_shutdown2' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_shutdown' remains for ABI compatibility and call the new version `pj_turn_sock_shutdown2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_shutdown2' and calling `pj_turn_session_shutdown2' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_shutdown' remains for ABI compatibility and call the new version `pj_turn_sock_shutdown2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_shutdown2' and calling `pj_turn_session_shutdown2' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_shutdown' remains for ABI compatibility and call the new version `pj_turn_sock_shutdown2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_shutdown2' and calling `pj_turn_session_shutdown2' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_shutdown' remains for ABI compatibility and call the new version `pj_turn_sock_shutdown2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_shutdown2' and calling `pj_turn_session_shutdown2' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_shutdown' remains for ABI compatibility and call the new version `pj_turn_sock_shutdown2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_shutdown2' and calling `pj_turn_session_shutdown2' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_shutdown' remains for ABI compatibility and call the new version `pj_turn_sock_shutdown2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
When destroying a TURN socket on failure -- e.g. failed allocation of socket -- the underlying session does not change its last status. Change this by passing a `pj_status_t' value to `pj_turn_sock_shutdown2' and calling `pj_turn_session_shutdown2' instead of `pj_turn_session_shutdown'. The old `pj_turn_sock_shutdown' remains for ABI compatibility and call the new version `pj_turn_sock_shutdown2' with status `PJ_SUCCESS'. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/682 Upstream ticket: pjsip#3154 Change-Id: I7f902b0a5bb44fd403bd147676d655dc775f2156
Describe the bug
When a TURN socket gets destroyed because of an error -- e.g. `pj_sock_socket' returns EMFILE -- the underlying session's status is not updated.
This results in a bad state of a relayed candidate of a ICE transport session.
Steps to reproduce
pj_sock_socket
fails inturn_on_state
.pj_assert(pj_sockaddr_has_addr(&cand->addr))
in pjnath/ice_strans.c.For 2., the easiest way is to do fuzzing -- i.e. random failure -- on the
socket
system call with LD_PRELOAD.PJSIP version
2.11
Context
Possible fix:
Log, call stack, etc
The text was updated successfully, but these errors were encountered: