[Libwebsockets] a bug?

"Andy Green (林安廸)" andy at warmcat.com
Sat Mar 9 04:59:32 CET 2013


On 07/03/13 12:41, the mail apparently from klervi - Alex Rhatushnyak 
included:
> Andy, thank you for the response!
>
> I tried the latest version.
> On the client side, with -u:
> [1362630790:6815] INFO: closing connection due to 0 length read
> [1362630790:6815] DEBUG: close: just_kill_connection
>
> At the same time on the server side:
> [1362630790:4034] PARSER: written 8194 bytes to client
> [1362630790:4035] PARSER: written 8194 bytes to client
> [1362630790:4035] PARSER: written 8194 bytes to client
> [1]    73334 segmentation fault  ./libwebsockets-test-server
>
> As before, no problems without '-u'.
> The modified test-client.c & test-server.c are attached.

I studied this and reproduced it.  However with the current library tree 
38c570c6d2e, I can't reproduce it.  Not sure if it was changes in

http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/commit/?id=38c570c6d2e586aeb331beeadd7983e503adca95

or just

http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/commit/?id=2bdbe7a969faafa01d0735683f50cc556677924c

Please try to get the same problem with the current library HEAD.

-Andy

> On Wed, Mar 6, 2013 at 7:37 PM, "Andy Green (林安廸)" <andy at warmcat.com
> <mailto:andy at warmcat.com>> wrote:
>
>     On 07/03/13 04:07, the mail apparently from klervi - Alex
>     Rhatushnyak included:
>
>         Hi Andy!
>         Please find attached slightly modified test-server.c and
>         test-client.c
>         from libwebsockets 1.22.
>         When you run them like this:
>
>         *> ./libwebsockets-test-server*
>         *> ./libwebsockets-test-client* localhost
>
>
>         there is no problem, but if deflate is disabled, an error will be
>         reported almost immediately:
>
>         *> ./libwebsockets-test-client* localhost -u
>
>           > ...
>           > ERROR!!! Only the first 7686 of 8190 bytes are 'a'.  The
>         remainder:
>           > ...
>
>         The following appears on the server side:
>           > [1362599624:3931] DEBUG: ERROR writing len 8194 to skt 7682
>
>         (log level defaults to (1<<LLL_COUNT)-1  in the attached code).
>         At least, that's what I observe on Mac OSX 10.8.2.
>         Please advise whether you can reproduce the issue, and whether
>         you think
>         it's really caused by a bug.
>         Thank you!
>
>         Doesn't it look a bit odd that if send() was unable to send all
>         bytes,
>         function lws_issue_raw() doesn't care how many were actually sent:
>
>                   n = send(wsi->sock, buf, len, MSG_NOSIGNAL);
>                   lws_latency(context, wsi, "send lws_issue_raw", n, n
>         == len);
>                   if (n != len) {
>                       lwsl_debug("ERROR writing len %d to skt %d\n",
>         len, n);
>                       return -1;
>                   }
>
>
>     Please make sure you're running the latest version from
>
>     http://git.libwebsockets.org/__cgi-bin/cgit/libwebsockets/
>     <http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/>
>
>     looking at the diff with the files you sent, it seems you started
>     from an older version.  We did work on this recently, eg
>
>     http://git.libwebsockets.org/__cgi-bin/cgit/libwebsockets/__commit/?id=__fc7c5e453920ad8ce163f618cd8d65__abc78c9901
>     <http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/commit/?id=fc7c5e453920ad8ce163f618cd8d65abc78c9901>
>
>     We have more to do, eg, force the send buffer size by socket
>     options, but the current version should hopefully remove the symptom.
>
>     -Andy
>
>




More information about the Libwebsockets mailing list