[OpenSIPS-Devel] [opensips] error in infinite loop "io_watch_del: BUG - trying to del fd 34 with flags 2 1" (#591)
rgupta0110
notifications at github.com
Mon Aug 10 16:38:00 CEST 2015
Hi Bogdan, I will generate the core file and upload the logs and core soon.
Meanwhile, I have put the following fix which seems working and I haven't experienced any issues so far. Could you please review it and let me know if there is any potential problem
Added the following condition in tcp_main.c where its calling io_watch_del in the particular failure scenario inside the method handle_tcpconn_ev()
if(tcpconn->flags & F_CONN_NOT_CONNECTED)
{
if (io_watch_del(&io_h, tcpconn->s, fd_i, 0,IO_WATCH_WRITE)==-1)
return -1;
}
This F_CONN_NOT_CONNECTED flag is only added in case of ASYNC_CONNECT where the connection is being added with IO_WATCH_WRITE mode.
The difference between file code is:
[root at rg-rhel-65 opensips-1.11.5-tls]# diff tcp_main.c.orig tcp_main.c
1565,1566c1565,1575
< if (io_watch_del(&io_h, tcpconn->s, fd_i, 0,IO_WATCH_READ)==-1)
< return -1;
---
> if(tcpconn->flags & F_CONN_NOT_CONNECTED)
> {
> if (io_watch_del(&io_h, tcpconn->s, fd_i, 0,IO_WATCH_WRITE)==-1)
> return -1;
> }
> else
> {
> if (io_watch_del(&io_h, tcpconn->s, fd_i, 0,IO_WATCH_READ)==-1)
> return -1;
> }
Thanks
Rahul
---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/591#issuecomment-129476952
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20150810/20ad222f/attachment-0001.htm>
More information about the Devel
mailing list