Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-12705

Coverity analysis defect 138767 (and others): Rule of three in cppsuite

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Storage Engines
    • StorEng - Defined Pipeline

      Coverity has detected violations of the "Rule of three" at various points in cppsuite.

      Compiler generated special functions may behave incorrectly if the class requires a user-definition for any of its special functions. This class has user-definitions for at least one but not all of its special functions (copy constructor, copy assignment operator, destructor). If one of these functions requires a user-definition then it is likely all of them should have a definition.

      Here are all the coverity occurrences:

      Coverity CID:      code location:
      138767             test/cppsuite/src/common/random_generator.h:47
      138867             test/cppsuite/src/common/thread_manager.h:36
      138901             test/cppsuite/src/component/metrics_monitor.h:47
      138974             test/cppsuite/src/component/metrics_writer.h::38
      138926             test/cppsuite/src/main/collection.h:37
      138892             test/cppsuite/src/main/configuration.h:58
      138803             test/cppsuite/src/util/barrier.h:43
      138955             test/cppsuite/src/util/execution_timer.h:39

      /test/cppsuite/src/common/random_generator.h:47: RULE_OF_ZERO_THREE_FIVE 138767 Class "test_harness::random_generator" has a user definition for at least one special function (copy constructor, copy assignment, destructor) but not all. If one of these functions requires a user definition then the others likely do as well.
      /test/cppsuite/src/common/random_generator.h:52: RULE_OF_ZERO_THREE_FIVE 138767 User-defined copy constructor.
      /test/cppsuite/src/common/random_generator.h:53: RULE_OF_ZERO_THREE_FIVE 138767 User-defined copy assignment operator.

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: