[Libwebsockets] assert in client connection

Andy Green andy at warmcat.com
Thu Aug 17 01:53:38 CEST 2017



On 08/17/2017 12:42 AM, Vijay Khurdiya wrote:
> Hi,
> 
> I am getting one assert when my client trying to connect with server. 
> Could you please give me hint what was wrong which cause assert.
> 
> Please find below snapshot of lws log.
> 
> [2017/08/14 17:58:41:0070] NOTICE: wsi 0x5aaae0: TIMEDOUT WAITING on 25 
> (did hdr 0, ah 0x5cb540, wl 0, pfd events 0) 1502713721 vs 1502713720
> 
> [2017/08/14 17:58:41:0075] NOTICE: lws_header_table_detach: wsi 
> 0x5aaae0: ah held 11s, ah.rxpos -1, ah.rxlen -1, mode/state 32 
> 4,wsi->more_rx_waiting 0
> 
> [2017/08/14 17:58:50:5725] ERR: getaddrinfo failed
> 
> [2017/08/14 17:58:50:5729] NOTICE: lws_header_table_detach: wsi 
> 0x5aaae0: ah held 1502713596s, ah.rxpos -1, ah.rxlen -1, mode/state 32 
> 4,wsi->more_rx_waiting 0
> 
> /libwebsockets/2.0.3-r0/git/lib/parsers.c:313: lws_header_table_detach: 
> Assertion `pt->ah_count_in_use > 0' failed.

The assert is saying there's a mismatch in the count of the number of ah 
in use.

However I haven't seen that even on v2.0, and the ah counting is all 
done in internal apis in one place.

  - does this still exist in current master (or v2.3-stable which is 
nearly identical atm)?

  - are you using lws from multiple threads?

  - does this problem exist in the test client?

  - try setting LWS_MAX_SMP=1 in cmake (and if using multiple service 
threads, don't)

I eyeballed the 2.0.3 code but it cleans up after getaddrinfo failure 
normally.

-Andy

> 
> 
> _______________________________________________
> Libwebsockets mailing list
> Libwebsockets at ml.libwebsockets.org
> https://libwebsockets.org/mailman/listinfo/libwebsockets
> 



More information about the Libwebsockets mailing list