[Libwebsockets] assert in lib/pollfd.c

Andy Green andy at warmcat.com
Fri Mar 4 04:01:09 CET 2016



On 03/04/2016 10:33 AM, fx IWATA NOBUO wrote:
> Hello,
>
> I tested with v1.7.3 and it works fine!

Great.

> BTW: snprintf()s in libwebsockets.c:lwsl_timestamp() got unresolved link error in my VC express 2012.
> I temporally modified them to _snprintf().

I pushed a patch on v1.7-stable and master that tries to solve this by 
checking at cmake-time if _snprintf() exists, if so the private header 
uses it instead of snprintf().

https://github.com/warmcat/libwebsockets/commit/7d22c297224306ebda9021ad352fdc80fd7080eb

-Andy


> Thank you for your help,
>
> nobuo.iwata
> //
>> -----Original Message-----
>> From: Andy Green [mailto:andy.green at linaro.org] On Behalf Of Andy Green
>> Sent: Wednesday, March 02, 2016 11:13 AM
>> To: fx IWATA NOBUO; libwebsockets at ml.libwebsockets.org
>> Subject: Re: [Libwebsockets] assert in lib/pollfd.c
>>
>>
>>
>> On 03/02/2016 10:10 AM, fx IWATA NOBUO wrote:
>>> Hello,
>>>
>>> I'm testing a client program on Windows 7.
>>>
>>> int
>>> _lws_change_pollfd(struct lws *wsi, int _and, int _or, struct
>>> lws_pollargs *pa) {
>>> 	--- snip ---
>>>
>>> 	context = wsi->context;
>>> 	pt = &context->pt[(int)wsi->tsi];
>>> 	assert(wsi->position_in_fds_table >= 0 &&
>>> 	       wsi->position_in_fds_table < pt->fds_count);
>>>
>>> Assert statement above fails.
>>>
>>> Skipping the statement, the program works well.
>>>
>>> The call path is: lws_client_connect_via_info() >
>>> lws_allocate_header_table() > _lws_change_pollfd()
>>>
>>> It seems those fields checked by the assert may not setup at the point
>> FIRST TIME.
>>
>> Is this on current master or v1.7-stable (or tag "v1.7.3")?  It sounds
>> similar to something fixed a few days ago.
>>
>> -Andy
>>
>>> Thanks,
>>>
>>> nobuo iwata
>>> //
>>> _______________________________________________
>>> Libwebsockets mailing list
>>> Libwebsockets at libwebsockets.org
>>> http://libwebsockets.org/mailman/listinfo/libwebsockets
>>>



More information about the Libwebsockets mailing list