[Libwebsockets] [libwebsockets] #28: Crash due to file descriptor being accessed from union storing header data

Trac trac at libwebsockets.org
Fri May 3 15:26:50 CEST 2013


#28: Crash due to file descriptor being accessed from union storing header data
------------------------------------+--------------------------------
  Reporter:  simonwulf              |      Owner:  agreen
      Type:  defect                 |     Status:  new
  Priority:  critical               |  Milestone:
 Component:  libwebsockets library  |    Version:
Resolution:                         |   Keywords:  server union crash
------------------------------------+--------------------------------

Comment (by agreen):

 I can't test Windows build, and it doesn't look like the problem occurs on
 Linux, if I understood it.

 I opened two Chrome tabs to the test server, closed one, then Ctrl-C the
 test server.

 In both the chrome tab close and the server close, I see callbacks coming
 for both dumb_increment and mirror protocol connections.  There's nothing
 like this "saved up the close" behaviour, which would lead to three closes
 when I Ctrl-C the test server if I understood your issue.

 ..
 lwsts[30734]: written 7 bytes to client
 lwsts[30734]: written 7 bytes to client
 lwsts[30734]: written 7 bytes to client
 lwsts[30734]: written 7 bytes to client
 lwsts[30734]: written 6 bytes to client
 lwsts[30734]: written 6 bytes to client
 lwsts[30734]: written 6 bytes to client
 lwsts[30734]: written 6 bytes to client
 lwsts[30734]: written 7 bytes to client
 lwsts[30734]: service_fd: closing due to 0 length read
 lwsts[30734]: close: just_kill_connection
 lwsts[30734]: remove_wsi_socket_from_fds: wsi=0x12bc9c0, sock=7, fds pos=3
 lwsts[30734]: calling back CLOSED
 lwsts[30734]: zlibs destructed
 lwsts[30734]: service_fd: closing due to 0 length read
 lwsts[30734]: close: just_kill_connection
 lwsts[30734]: remove_wsi_socket_from_fds: wsi=0x12bcc40, sock=9, fds pos=3
 lwsts[30734]: calling back CLOSED
 lwsts[30734]: zlibs destructed
 lwsts[30734]: written 7 bytes to client
 lwsts[30734]: written 7 bytes to client
 ...
 lwsts[30734]: written 7 bytes to client
 lwsts[30734]: written 7 bytes to client
 lwsts[30734]: written 6 bytes to client

 (Ctrl-C here)

 lwsts[30734]: close: just_kill_connection
 lwsts[30734]: remove_wsi_socket_from_fds: wsi=0x12bc740, sock=5, fds pos=0
 lwsts[30734]: not calling back closed
 lwsts[30734]: close: just_kill_connection
 lwsts[30734]: remove_wsi_socket_from_fds: wsi=0x13006c0, sock=8, fds pos=0
 lwsts[30734]: calling back CLOSED
 lwsts[30734]: zlibs destructed
 lwsts[30734]: close: just_kill_connection
 lwsts[30734]: calling back CLOSED
 lwsts[30734]: zlibs destructed
 lwsts[30734]: mirror protocol cleaning up
 lwsts[30734]: libwebsockets-test-server exited cleanly

-- 
Ticket URL: <http://libwebsockets.org/trac/ticket/28#comment:9>
libwebsockets <http://libwebsockets.org>
libwebsockets C library



More information about the Libwebsockets mailing list