[OpenSIPS-Users] infinite loop in rtpengine rtpe_function_call()

Bogdan-Andrei Iancu bogdan at opensips.org
Fri Feb 23 11:56:27 UTC 2024


Hi Alexander,

Thank for your report - it will be better to push this via the github 
tracker, the right place for coding issues:
https://github.com/OpenSIPS/opensips/issues

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
   https://www.siphub.com

On 22.02.2024 21:43, Alexander Kogan wrote:
>
> Hi,
>
> The OpenSIPS process gets stack in infinite loop when the rtpengine 
> module runs out of memory in send_rtpe_command()
>
> Please review the following piece of code in rtpengine.c:
>
>     RTPE_START_READ();
>     do {
>         if (snode && snode->s) {
>             if ((node = get_rtpe_node(snode, set)) == NULL && op == 
> OP_OFFER)
>                 node = select_rtpe_node(ng_flags.call_id, 1, set);
>             snode = NULL;
>         } else {
>             node = select_rtpe_node(ng_flags.call_id, 1, set);
>         }
>         if (!node) {
>             LM_ERR("no available proxies\n");
>             RTPE_STOP_READ();
>             goto error;
>         }
>
>         cp = send_rtpe_command(node, ng_flags.dict, &ret);
>     } *while (cp == NULL);*
>     RTPE_STOP_READ();
>     LM_DBG("proxy reply: %.*s\n", ret, cp);
>
> When send_rtpe_command() returns NULL due to memory absence here:
>
>     v = bencode_iovec(dict, &vcnt, 1, 0);
>     if (!v) {
>         LM_ERR("error converting bencode to iovec\n");
>         return NULL;
>     }
>
> the mentioned loop ( *do {....} while(cp == NULL)* ) won't stop 
> indefinitely causing the opensips process to become stuck.
>
> Best regards,
> Alexander Kogan,
> Director of R&D
> 5g Future
> http://5gfuture.com
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20240223/f8a6e17e/attachment.html>


More information about the Users mailing list