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

wtperf coverity fixes

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.0.5, 4.1.6, WT3.2.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Engines 2018-11-19

      The recent merge of WT-4402 introduced a couple Coverity issues.

      New defect(s) Reported-by: Coverity Scan
      Showing 2 of 2 defect(s)
      
      ** CID 1396611:  Resource leaks  (RESOURCE_LEAK)
      /bench/wtperf/wtperf.c: 1480 in monitor()
      
      ________________________________________________________________________________________________________
      *** CID 1396611:  Resource leaks  (RESOURCE_LEAK)
      /bench/wtperf/wtperf.c: 1480 in monitor()
      1474            }
      1475     
      1476            if (fp != NULL)
      1477                    (void)fclose(fp);
      1478            free(path);
      1479     
      >>>     CID 1396611:  Resource leaks  (RESOURCE_LEAK)
      >>>     Variable "jfp" going out of scope leaks the storage it points to.
      1480            return (WT_THREAD_RET_VALUE);
      1481     }
      1482     
      1483     static WT_THREAD_RET
      1484     checkpoint_worker(void *arg)
      1485     {
      
      ** CID 1396610:  Incorrect expression  (ASSERT_SIDE_EFFECT)
      /bench/wtperf/wtperf.c: 1393 in monitor()
      
      
      ________________________________________________________________________________________________________
      *** CID 1396610:  Incorrect expression  (ASSERT_SIDE_EFFECT)
      /bench/wtperf/wtperf.c: 1393 in monitor()
      1387                        cur_reads, cur_inserts, cur_updates,
      1388                        wtperf->ckpt ? 'Y' : 'N',
      1389                        read_avg, read_min, read_max,
      1390                        insert_avg, insert_min, insert_max,
      1391                        update_avg, update_min, update_max);
      1392                    if (jfp != NULL) {
      >>>     CID 1396610:  Incorrect expression  (ASSERT_SIDE_EFFECT)
      >>>     Assignment "buf_size = strftime(buf, 64UL, "%Y-%m-%dT%H:%M:%S", &localt)" has a side effect.  This code will work differently in a non-debug build.
      1393                            testutil_assert((buf_size = strftime(buf,
      1394                                sizeof(buf), "%Y-%m-%dT%H:%M:%S", &localt)) != 0);
      1395                            testutil_check(__wt_snprintf(&buf[buf_size],
      1396                                sizeof(buf) - buf_size,
      1397                                ".%3.3" PRIu64 "Z",
      1398                                ns_to_ms((uint64_t)t.tv_nsec)));
      

            Assignee:
            sue.loverso@mongodb.com Susan LoVerso
            Reporter:
            sue.loverso@mongodb.com Susan LoVerso
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: