patch: add reference counter to pjsip_inv_session to avoid race condition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

When a transport error occured on an INVITE session
the pjproject calls on_tsx_state_changed with new
state PJSIP_INV_STATE_DISCONNECTED and immediately
destroys the INVITE session.
At the same time this INVITE session could being
processed on another thread.
This thread could use the session's memory pools which
were already freed, so we get segfault.

This patch adds a reference counter and new functions:
pjsip_inv_session_add_ref and pjsip_inv_session_dec_ref.
The INVITE session is destroyed only when the reference
counter has reached zero.

To avoid race condition an application should call
pjsip_inv_session_add_ref/pjsip_inv_session_dec_ref.


Regards,
Alexei

Attachment: add-pjsip_inv_session-ref_cnt.patch
Description: Binary data

_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux