bug report: race condition in pjsip_udp_transport_restart

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

 



pjsip_udp_transport_restart seems to have a race condition in 1.10.


When called as:

??????????????? status = pjsip_udp_transport_restart(
?????????????????????????? tp,
??????????????????????????? PJSIP_UDP_TRANSPORT_DESTROY_SOCKET,
??????????????????????????? PJ_INVALID_SOCKET,
??????????????????????????? &saddr,
??????????????????????????? &a_name) ;


I get intermittent failures of the socket bind in create_socket, failing with EADDRINUSE.
If I add a sleep and loop retry around the bind, it will succeed eventually.

I theorize that this implicit close code in? pjsip_udp_transport_restart:

??????? if (tp->key) {
??????????? /* This implicitly closes the socket */
??????????? pj_ioqueue_unregister(tp->key);
??????????? tp->key = NULL;
??????? } else {...

.. does the close asynchronously, at least on linux.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20111014/56fa34f6/attachment.html>


[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