[OpenSIPS-Devel] [OpenSIPS/opensips] d9b010: struct hist API: Fix possible crashes; Improve API

Liviu Chircu noreply at github.com
Thu Oct 17 05:43:47 EDT 2019

  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: d9b0102e5f91e95365aa6282c948e82130e48649
  Author: Liviu Chircu <liviu at opensips.org>
  Date:   2019-10-17 (Thu, 17 Oct 2019)

  Changed paths:
    M lib/dbg/struct_hist.c
    M lib/dbg/struct_hist.h
    M net/net_tcp.c

  Log Message:
  struct hist API:  Fix possible crashes; Improve API

Commit a74fff149a introduced a race condition on this logic:


, where "sh" must no longer be read following the unref operation.
This commit fixes this issue, along with:

    * fix crash with -DSTRUCT_HIST but no -DDBG_TCPCON
    * speed optimizations: eliminate memset() operations (not needed)
    * make sh_push() more flexible (extra ref counts from outside)
    * code: hide structs, so importing struct_hist.h doesn't conflict
       with mysql.h's own "struct list_head"

(cherry picked from commit 0db946724e9eaa364f54425f8664d96529e848a1)

More information about the Devel mailing list