[Libwebsockets] Segmentation fault after updating libwebsockets

Thomas Spitz thomas.spitz at hestia-france.com
Wed May 7 16:22:45 CEST 2014


Hello everyone,

I haven't updated libwebsockets since december 2013 (at that time I used
master a638d5a External signal for breaking out and reloading the poll() ).
I have updated libwebsockets lib in my project but I now get a segmentation
fault trying to load a simple helloworld html file.

Here is the trace (first helloworld.html file loads but when I try to
refresh the page, it crashes):

lwsts[11184]: insert_wsi_socket_into_fds: wsi=0x1604340, sock=11, fds pos=2
>
> lwsts[11184]: inserted SSL accept into fds, trying SSL_accept
> lwsts[11184]: SSL_accept failed 2 / error:00000002:lib(0):func(0):system
> lib
> lwsts[11184]: SSL_ERROR_WANT_READ
> lwsts[11184]: accepted new SSL conn
> lwsts[11184]: insert_wsi_socket_into_fds: wsi=0x1616a98, sock=12, fds pos=3
> lwsts[11184]: inserted SSL accept into fds, trying SSL_accept
> lwsts[11184]: SSL_accept failed 2 / error:00000002:lib(0):func(0):system
> lib
> lwsts[11184]: SSL_ERROR_WANT_READ
> lwsts[11184]: lws_server_skt_srv: read 0 len
> lwsts[11184]: close: just_kill_connection
> lwsts[11184]: remove_wsi_socket_from_fds: wsi=0x1604340, sock=11, fds pos=2
> lwsts[11184]: not calling back closed
> lwsts[11184]: accepted new SSL conn
> lwsts[11184]: HTTP GET request for '/helloworld.html'
>     GET URI = /helloworld.html
>     Host = 192.168.1.5
>     Connection = keep-alive
>     Accept: =
> text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
>     Accept-Encoding: = gzip,deflate,sdch
>     Accept-Language: = fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4
>     Cache-Control: = max-age=0
>     Cookie: = test=LWS_9589048_958103_COOKIE
> lwsts[11184]: LWS_CALLBACK_HTTP closing
> lwsts[11184]: closing connection at libwebsocket_read bail:
> lwsts[11184]: closing http file
> lwsts[11184]: close: just_kill_connection
> lwsts[11184]: remove_wsi_socket_from_fds: wsi=0x1616a98, sock=12, fds pos=2
> lwsts[11184]: calling back CLOSED_HTTP
> lwsts[11184]: insert_wsi_socket_into_fds: wsi=0x1617248, sock=11, fds pos=2
> lwsts[11184]: inserted SSL accept into fds, trying SSL_accept
> lwsts[11184]: SSL_accept failed 2 / error:00000002:lib(0):func(0):system
> lib
> lwsts[11184]: SSL_ERROR_WANT_READ
> lwsts[11184]: insert_wsi_socket_into_fds: wsi=0x16164c0, sock=12, fds pos=3
> lwsts[11184]: inserted SSL accept into fds, trying SSL_accept
> lwsts[11184]: SSL_accept failed 2 / error:00000002:lib(0):func(0):system
> lib
> lwsts[11184]: SSL_ERROR_WANT_READ
> lwsts[11184]: accepted new SSL conn
> lwsts[11184]: lws_server_skt_srv: read 0 len
> lwsts[11184]: close: just_kill_connection
> lwsts[11184]: remove_wsi_socket_from_fds: wsi=0x1617248, sock=11, fds pos=2
> lwsts[11184]: not calling back closed
> lwsts[11184]: accepted new SSL conn
> lwsts[11184]: HTTP GET request for '/favicon.ico'
>     GET URI = /favicon.ico
>     Host = 192.168.1.5
>     Connection = keep-alive
>     Accept: = */*
>     Accept-Encoding: = gzip,deflate,sdch
>     Accept-Language: = fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4
>     Cookie: = test=LWS_9589048_958103_COOKIE
> lwsts[11184]: LWS_CALLBACK_HTTP closing
> lwsts[11184]: closing connection at libwebsocket_read bail:
> lwsts[11184]: closing http file
> lwsts[11184]: close: just_kill_connection
> lwsts[11184]: remove_wsi_socket_from_fds: wsi=0x16164c0, sock=12, fds pos=2
> lwsts[11184]: calling back CLOSED_HTTP
> lwsts[11184]: insert_wsi_socket_into_fds: wsi=0x16164c0, sock=11, fds pos=2
> lwsts[11184]: inserted SSL accept into fds, trying SSL_accept
> lwsts[11184]: SSL_accept failed 2 / error:00000002:lib(0):func(0):system
> lib
> lwsts[11184]: SSL_ERROR_WANT_READ
> lwsts[11184]: accepted new SSL conn
> lwsts[11184]: lws_server_skt_srv: read 0 len
> lwsts[11184]: close: just_kill_connection
> lwsts[11184]: remove_wsi_socket_from_fds: wsi=0x16164c0, sock=11, fds pos=2
> lwsts[11184]: not calling back closed
> lwsts[11184]: insert_wsi_socket_into_fds: wsi=0x16164c0, sock=11, fds pos=2
> lwsts[11184]: inserted SSL accept into fds, trying SSL_accept
> lwsts[11184]: SSL_accept failed 2 / error:00000002:lib(0):func(0):system
> lib
> lwsts[11184]: SSL_ERROR_WANT_READ
> lwsts[11184]: accepted new SSL conn
> lwsts[11184]: HTTP GET request for '/helloworld.html'
>     GET URI = /helloworld.html
>     Host = 192.168.1.5
>     Connection = keep-alive
>     Accept: =
> text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
>     Accept-Encoding: = gzip,deflate,sdch
>     Accept-Language: = fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4
>     Cache-Control: = max-age=0
>     Cookie: = test=LWS_9589048_958103_COOKIE
> lwsts[11184]: LWS_CALLBACK_HTTP closing
> lwsts[11184]: closing connection at libwebsocket_read bail:
> lwsts[11184]: closing http file
> lwsts[11184]: close: just_kill_connection
> lwsts[11184]: remove_wsi_socket_from_fds: wsi=0x16164c0, sock=11, fds pos=2
> lwsts[11184]: calling back CLOSED_HTTP
> lwsts[11184]: insert_wsi_socket_into_fds: wsi=0x16164c0, sock=11, fds pos=2
> lwsts[11184]: inserted SSL accept into fds, trying SSL_accept
> lwsts[11184]: SSL_accept failed 2 / error:00000002:lib(0):func(0):system
> lib
> lwsts[11184]: SSL_ERROR_WANT_READ
> lwsts[11184]: insert_wsi_socket_into_fds: wsi=0x1604810, sock=12, fds pos=3
> lwsts[11184]: inserted SSL accept into fds, trying SSL_accept
> lwsts[11184]: SSL_accept failed 2 / error:00000002:lib(0):func(0):system
> lib
> lwsts[11184]: SSL_ERROR_WANT_READ
> lwsts[11184]: accept asks to try again
> Segmentation fault
>
> I use #define EXTERNAL_POLL and a arm-crosscompilationwith ssl 1.0.1e

Using standard libwebsocket examples:

   - libwebsockets-test-server --ssl, libwebsockets-test-server
   and libwebsockets-test-server-extpoll work well
   - libwebsockets-test-server-extpoll --ssl doesn't work well if we reload
   the page several time


Hope anyone have an idea.

BR,
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libwebsockets.org/pipermail/libwebsockets/attachments/20140507/42b5e818/attachment.html>


More information about the Libwebsockets mailing list