Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-16045

mem_bucket_by_size() has a big bug

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Won't fix
    • Icon: Blocker Blocker
    • None
    • 3.0.27, 4.0.7, 4.2.1
    • Proxy (P), Server (S)
    • None

      src/libs/zbxmemory/memalloc.c : mem_bucket_by_size() code is following

      static int mem_bucket_by_size(zbx_uint64_t size)

      { if (size < MEM_MIN_BUCKET_SIZE) return 0; if (size < MEM_MAX_BUCKET_SIZE) return (size - MEM_MIN_BUCKET_SIZE) >> 3; return MEM_BUCKET_COUNT - 1; }

      It must be following, especially size over MEM_MAX_BUCKET_SIZE is critical bug.

      static int mem_bucket_by_size(zbx_uint64_t size)

      { if (MEM_MIN_BUCKET_SIZE > size) return 0; if (MEM_MAX_BUCKET_SIZE < size) return (size - MEM_MIN_BUCKET_SIZE) >> 3; return MEM_BUCKET_COUNT - 1; }

            zabbix.dev Zabbix Development Team
            daiki.matsuda@miraclelinux.com MATSUDA Daiki
            Team C
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: