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

Details

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

    Description

      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; }

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: