[OpenSIPS-Devel] [OpenSIPS/opensips] 531a91: tcp: don't add conn in TCP main reactor after asyn...

Razvan Crainea razvan at opensips.org
Thu Feb 9 04:01:08 EST 2017


  Branch: refs/heads/2.1
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 531a91684c84df84d5864ee3594c99913a595afd
      https://github.com/OpenSIPS/opensips/commit/531a91684c84df84d5864ee3594c99913a595afd
  Author: Razvan Crainea <razvan at opensips.org>
  Date:   2017-02-09 (Thu, 09 Feb 2017)

  Changed paths:
    M net/net_tcp.c
    M net/net_tcp_proc.c
    M net/tcp_conn.h

  Log Message:
  -----------
  tcp: don't add conn in TCP main reactor after async write

When getting back a TCP connection from a TCP worker after it wrote some
async chunks, we should not add the connection in the reactor for read.
The reason is that the connection might already be polled by a different
process. If the poll triggers for read in the main reactor, the
connection will be assigned to a new process - and we end up having a
connection for read in two different processes reactor - this breaks
connections list and results in double frees and invalid memory access.

Many thanks to Federico Edorna for all the help given to track down this
issue!

(cherry picked from commit 33fe3395570c40b6733b0579f94072b68e7bd646)


  Commit: 2b02d3614db401018702ac84531c42c81d85c201
      https://github.com/OpenSIPS/opensips/commit/2b02d3614db401018702ac84531c42c81d85c201
  Author: Razvan Crainea <razvan at opensips.org>
  Date:   2017-02-09 (Thu, 09 Feb 2017)

  Changed paths:
    M mem/q_malloc.c
    M mem/q_malloc.h

  Log Message:
  -----------
  mem: qm_mem_check should be defined only if DBG_QM_MALLOC is used


Compare: https://github.com/OpenSIPS/opensips/compare/8d6e1dd3621d...2b02d3614db4


More information about the Devel mailing list