[Libwebsockets] Infinite loop at lws_service

Alfred Sawaya alfred at huji.fr
Tue Aug 21 17:01:46 CEST 2018


I use the last libwebsockets version (git+master)

Le mar. 21 août 2018 à 17:01, Alfred Sawaya <alfred at huji.fr> a écrit :

> Hello,
>
> I have an issue with libwebsockets. I have done a huge refactored of a
> piece of software which uses libwebsockets, I used to work but now, I have
> a strange behaviour, 100% cpu and an infinite loop on the while loop at
> lib/roles/ws/ops-ws.c : 1407 :
>
> (gdb) n
> 1407 if (lwsi_role_ws(wsi) &&
> (gdb)
> 1423 wsi = wsi->same_vh_protocol_next;
> (gdb)
> 1407 if (lwsi_role_ws(wsi) &&
> (gdb)
> 1423 wsi = wsi->same_vh_protocol_next;
> (gdb)
> 1407 if (lwsi_role_ws(wsi) &&
> (gdb)
> 1423 wsi = wsi->same_vh_protocol_next;
> (gdb)
> 1407 if (lwsi_role_ws(wsi) &&
> (gdb)
> 1423 wsi = wsi->same_vh_protocol_next;
> (gdb)
> 1407 if (lwsi_role_ws(wsi) &&
> (gdb)
> 1423 wsi = wsi->same_vh_protocol_next;
>
> if I do : set  wsi->same_vh_protocol_next = NULL;
> Then it works as attended.
>
> In the code that set wsi->same_vh_protocol_next (lib/roles/ws/client-ws.c
> : 382), the wsi->same_vh_protocol_next is set to wsi, but I think it should
> be NULL otherwise while(wsi) loop cannot break, isn't it ?
>
> Or I have missed something?
>
> Thank you,
> Alfred
> --
> Cordialement,
> Alfred Sawaya
>
-- 
Cordialement,
Alfred Sawaya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20180821/3b704eab/attachment-0002.html>


More information about the Libwebsockets mailing list