Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-1046

Inserting to the RBTree should not involve hashing

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.9.0
    • Component/s: Evaluation
    • Labels:
      None
    • Platform:
      Any
    • Steps to reproduce:
      Not provided

      Description

      In @ClassTablePut()@ the class is currently inserted by hash in the RBTree, where hash is a @size_t@ integer:

      <pre>
      return RBTreePut(table->classes, (void *)cls->hash, cls);
      </pre>

      However collisions are not being handled. This will trigger random subtle bugs (like unexpected classes set). Ideally no hash at all should be used when inserting to an RBTree.

      AFAICT RBTree hashes are being used for variables, classes, and cached functions, so all these should be susceptible to collisions.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                a10038 jimis (Dimitrios Apostolou)
                Reporter:
                a10038 jimis (Dimitrios Apostolou)
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel

                    Time Tracking

                    Estimated:
                    Original Estimate - 2 days, 5 hours
                    2d 5h
                    Remaining:
                    Not Specified
                    Logged:
                    Time Not Required
                    Not Specified