[Libwebsockets] [libwebsockets] #18: Crash on SSL_connect

Trac trac at libwebsockets.org
Tue Feb 19 11:57:07 CET 2013

#18: Crash on SSL_connect
 Reporter:  Joakim                  |      Owner:  agreen
     Type:  defect                  |     Status:  new
 Priority:  major                   |  Milestone:
Component:  libwebsocket test apps  |    Version:
 Keywords:                          |
 On connecting after the network being down:

 - I time out the connection, call for a writeable callback, return -1 from
 that to tell libwebsocket to kill the connection.
 - On the '''LWS_CALLBACK_CLOSED''' I NULL all references to the
 libwebsocket instance.
 - Network comes back, I attempt to connect.

 In the '''SSL_connect''' call I get a crash. This happened after I've done
 the '''libwebsocket_client_connect_extended()''' call and started
 servicing the context again.

 Only tested/experienced on OSX.

 First I get a long spam of POLL callbacks:
 2013-02-19 09:15:22 DEBUG2: Websocket LWS_CALLBACK_CLEAR_MODE_POLL_FD
 2013-02-19 09:15:22 DEBUG2: Websocket LWS_CALLBACK_SET_MODE_POLL_FD
 2013-02-19 09:15:22 DEBUG2: Websocket LWS_CALLBACK_CLEAR_MODE_POLL_FD
 2013-02-19 09:15:23 DEBUG2: Websocket LWS_CALLBACK_SET_MODE_POLL_FD
 2013-02-19 09:15:23 DEBUG2: Websocket LWS_CALLBACK_DEL_POLL_FD
 2013-02-19 09:15:23 DEBUG2: Websocket LWS_CALLBACK_CLEAR_MODE_POLL_FD

 Program received signal EXC_BAD_ACCESS, Could not access memory.
 Reason: 13 at address: 0x0000000000000000
 0x0000000100346f64 in SSL_connect ()
 (gdb) backtrace
 #0  0x0000000100346f64 in SSL_connect ()
 #1  0x0000000100303bad in libwebsocket_service_fd (context=0x101800000,
 pollfd=0x101801600) at build/osx/libwebsockets-git/src/libwebsockets-
 #2  0x0000000100303e3b in libwebsocket_service (context=0x101800000,
 timeout_ms=1000) at build/osx/libwebsockets-git/src/libwebsockets-

 I'm not sure this is due to libwebsocket, or something that I'm doing

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

More information about the Libwebsockets mailing list