[Libwebsockets] [libwebsockets] #81: Test server running on windows 7 x64 crashes when connecting from firefox v26 on centos 6.5/x86_64

Trac trac at libwebsockets.org
Wed Jul 30 22:02:55 CEST 2014


#81: Test server running on windows 7 x64 crashes when connecting from firefox
v26 on centos 6.5/x86_64
-----------------------------------+-----------------
 Reporter:  banal                  |      Owner:
     Type:  defect                 |     Status:  new
 Priority:  major                  |  Milestone:
Component:  libwebsockets library  |    Version:
 Keywords:                         |
-----------------------------------+-----------------
 I am running 32-bit build of websockets 1.3 sources on Windows 7 x64,
 built by Visual Studio 2008 toolchain (solution was generated through
 CMake 3.0.0).

 My command line for invocation of testserver is the following -

 libwebsockets-test-server.exe --ssl --resource_path <...snip...>\share
 \libwebsockets-test-server

 When I connect to this with Chrome 36.0.1985.125 m on Windows 7, I see the
 intended behavior (numbers incrementing etc).

 However if I connect from Firefox 26 on CentOS, the test server (debug
 build) immediately crashes with the following stack -

         libwebsockets-test-
 server.exe!lws_server_socket_service_ssl(libwebsocket_context *
 context=0x00b15a80, libwebsocket * * pwsi=0x002bf404, libwebsocket *
 new_wsi=0x00000000, int accept_fd=0, libwebsocket_pollfd *
 pollfd=0x009d0068)  Line 419 + 0x15 bytes    C
         libwebsockets-test-
 server.exe!lws_server_socket_service(libwebsocket_context *
 context=0x00b15a80, libwebsocket * wsi=0x00b11e58, libwebsocket_pollfd *
 pollfd=0x009d0068)  Line 673 + 0x19 bytes       C
         libwebsockets-test-
 server.exe!libwebsocket_service_fd(libwebsocket_context *
 context=0x00b15a80, libwebsocket_pollfd * pollfd=0x009d0068)  Line 349 +
 0x11 bytes        C
         libwebsockets-test-
 server.exe!lws_plat_service(libwebsocket_context * context=0x00b15a80, int
 timeout_ms=50)  Line 148 + 0xd bytes      C
         libwebsockets-test-
 server.exe!libwebsocket_service(libwebsocket_context * context=0x00b15a80,
 int timeout_ms=50)  Line 515 + 0xd bytes  C
         libwebsockets-test-server.exe!main(int argc=4, char * *
 argv=0x00b11b40)  Line 951 + 0xe bytes  C
         libwebsockets-test-server.exe!__tmainCRTStartup()  Line 586 + 0x19
 bytes        C
         libwebsockets-test-server.exe!mainCRTStartup()  Line 403        C
         kernel32.dll!@BaseThreadInitThunk at 12()  + 0x12 bytes
         ntdll.dll!___RtlUserThreadStart at 8()  + 0x27 bytes
         ntdll.dll!__RtlUserThreadStart at 8()  + 0x1b bytes

 The crash happens every time and is very consistent.

 The crash happens also in release build of test server. However since
 symbols are not getting saved, stack is not as useful as the above.

 The crash happens because on line 419 of ssl.c new_wsi->ssl expression
 leads to bad memory since new_wsi is null.

--
Ticket URL: <http://libwebsockets.org/trac/libwebsockets/ticket/81>
libwebsockets <http://libwebsockets.org>
libwebsockets C library



More information about the Libwebsockets mailing list