Uploaded image for project: 'FreeSWITCH'
  1. FreeSWITCH
  2. FS-10989

Crash in switch_hashtable.c under heavy load when subscribing to specific custom events

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6.20
    • Fix Version/s: 1.8.1
    • Component/s: core
    • Labels:
      None
    • Environment:
      FreeSWITCH 1.6.20
      HP server hardware running: centos-release-6-9.el6.12.3.x86_64
    • CPU Architecture:
      x86-64
    • Kernel:
      Linux
    • uname:
      Linux spkivr01.terev.telecomexpress.co.uk 2.6.32-696.20.1.el6.x86_64 #1 SMP Fri Jan 26 17:51:45 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
    • Userland:
      GNU/Linux
    • Distribution:
      CentOS
    • Distribution Version:
      CentOS 6
    • lsb_release:
      centos-release-6-9.el6.12.3.x86_64
    • Compiler:
      gcc
    • FreeSWITCH GIT Revision:
      FreeSWITCH Version 1.6.20+git~20180123T214909Z~987c9b9a2a~64bit (git 987c9b9 2018-01-23 21:49:09Z 64bit)
    • GIT Master Revision hash::
      987c9b9a2a2e389becf4f390feb9eb14c77e2371
    • Target Version:

      Description

      Under reasonably heavy load (250+ concurrent calls) running Lua scripts for all inbound calls both FreeSWITCH IVRs crashed with similar errors.

      See attached for the gdb results for both IVRs based on their core dump files.

      I noticed inside the code a comment from the author that may point to the issue (see line 109 inside switch_hashtable.c):

      memset(newtable, 0, newsize * sizeof(struct entry *));
      /* This algorithm is not 'stable'. ie. it reverses the list

      • when it transfers entries between the tables */
        for (i = 0; i < h->tablelength; i++)
        Unknown macro: { while (NULL != (e = h->table[i])) { h->table[i] = e->next; index = indexFor(newsize,e->h); e->next = newtable[index]; newtable[index] = e; } }

        switch_safe_free(h->table);
        h->table = newtable;

      I have not attempted to replicate the issue under the latest head release since I noticed that the source file switch_hashtable.c has not changed.

      I understand that you do not support CentOS 6, however based on the comment inside the code segment above I assume this could cause an issue for any Linux distro (including debian).

      Let me know if you require more information since I still have the core dump files.

        Attachments

          Activity

            People

            • Assignee:
              mikej Mike Jerris
              Reporter:
              visytel Andrew Keil
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: