Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-18876

New Defects reported by Coverity Scan for HPCC-Platform on 27th of November - thor

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 7.0.0
    • Fix Version/s: 7.0.0
    • Component/s: eclrtl, JLib, Thor
    • Labels:
      None
    • Environment:
      OBT

      Description

      5 new defect(s) introduced to HPCC-Platform found with Coverity Scan.

      *** CID 1462258:  Uninitialized members  (UNINIT_CTOR)
      
      /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/system/jhtree/jhtree.cpp: 496 in CKeyLevelManager::CKeyLevelManager(const RtlRecord &, IKeyIndex *, IContextLogger *)()
      
      490             skips = 0;
      
      491             eof = false;
      
      492             nullSkips = 0;
      
      493             wildseeks = 0;
      
      494             transformSegs = false;
      
      495             activitySegs = &segs;
      
      >>>     CID 1462258:  Uninitialized members  (UNINIT_CTOR)
      
      >>>     Non-static class member "matched" is not initialized in this constructor nor in any functions that it calls.
      
      496         }
      
      497
      
      498         ~CKeyLevelManager()
      
      499         \{
      
      500             free (keyBuffer);
      
      501             ::Release(keyCursor);
      
      ________________________________________________________________________________________________________
      
      *** CID 1462257:  Memory - illegal accesses  (NO_EFFECT)
      
      /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/system/jhtree/jhtree.cpp: 3068 in IKeyManagerTest::buildTestKey(const char *, bool, bool)()
      
      3062             Owned<IFileIOStream> out = createIOStream(io);
      
      3063             unsigned maxRecSize = variable ? 18 : 10;
      
      3064             unsigned keyedSize = 10;
      
      3065             Owned<IKeyBuilder> builder = createKeyBuilder(out, COL_PREFIX | HTREE_FULLSORT_KEY | HTREE_COMPRESSED_KEY |  (variable ? HTREE_VARSIZE : 0), maxRecSize, NODESIZE, keyedSize, 0);
      
      3066
      
      3067             char keybuf[18];
      
      >>>     CID 1462257:  Memory - illegal accesses  (NO_EFFECT)
      
      >>>     "memset" with fill value "'0'" (the zero character) in "memset(keybuf, 48, 18UL)".
      
      3068             memset(keybuf, '0', 18);
      
      3069             for (unsigned count = 0; count < 10000; count++)
      
      3070             \{
      
      3071                 unsigned datasize = 10;
      
      3072                 if (variable && (count % 10)==0)
      
      3073                 \{
      
      ________________________________________________________________________________________________________
      
      *** CID 1462256:  Uninitialized members  (UNINIT_CTOR)
      
      /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/thorlcr/activities/thdiskbaseslave.cpp: 215 in CDiskReadSlaveActivityBase::CDiskReadSlaveActivityBase(CGraphElementBase *, IHThorArg *)()
      
      209         helper = (IHThorDiskReadBaseArg *)queryHelper();
      
      210         reInit = 0 != (helper->getFlags() & (TDXvarfilename|TDXdynamicfilename));
      
      211         crcCheckCompressed = getOptBool(THOROPT_READCOMPRESSED_CRC, false);
      
      212         markStart = gotMeta = false;
      
      213         checkFileCrc = !globals->getPropBool("Debug/@fileCrcDisabled", false);
      
      214         checkFileCrc = getOptBool(THOROPT_READ_CRC, checkFileCrc);
      
      >>>     CID 1462256:  Uninitialized members  (UNINIT_CTOR)
      
      >>>     Non-static class member field "cachedMetaInfo.byteTotal" is not initialized in this constructor nor in any functions that it calls.
      
      215     }
      
      216
      
      217     // IThorSlaveActivity
      
      218     void CDiskReadSlaveActivityBase::init(MemoryBuffer &data, MemoryBuffer &slaveData)
      
      219     \{
      
      220         subfileLogicalFilenames.kill();
      
      ________________________________________________________________________________________________________
      
      *** CID 1462255:  Uninitialized members  (UNINIT_CTOR)
      
      /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/system/jhtree/jhtree.cpp: 94 in SegMonitorList::SegMonitorList(const RtlRecord &, bool)()
      
      88     //#define DUMP_NODES
      
      89
      
      90     SegMonitorList::SegMonitorList(const RtlRecord &_recInfo, bool _needWild) : recInfo(_recInfo), needWild(_needWild)
      
      91     \{
      
      92         keySegCount = recInfo.getNumKeyedFields();
      
      93         reset();
      
      >>>     CID 1462255:  Uninitialized members  (UNINIT_CTOR)
      
      >>>     Non-static class member "cachedLRS" is not initialized in this constructor nor in any functions that it calls.
      
      94     }
      
      95
      
      96     unsigned SegMonitorList::ordinality() const
      
      97     \{
      
      98         return segMonitors.length();
      
      99     }
      
      ________________________________________________________________________________________________________
      
      *** CID 1462254:  Incorrect expression  (ASSERT_SIDE_EFFECT)
      
      /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/rtl/eclrtl/eclhelper_dyn.cpp: 183 in FilterSet::createSegmentMonitorsWithWild(IIndexReadContext *, unsigned int)()
      
      177             \{
      
      178                 IStringSet *filter = filters.item(idx);
      
      179                 unsigned offset =  filterOffsets.item(idx);
      
      180                 unsigned size =  filterSizes.item(idx);
      
      181                 if (filter)
      
      182                 \{
      
      >>>     CID 1462254:  Incorrect expression  (ASSERT_SIDE_EFFECT)
      
      >>>     Assignment "size = filter->getSize()" has a side effect.  This code will work differently in a non-debug build.
      
      183                     assertex(size = filter->getSize());
      
      184                     irc->append(createKeySegmentMonitor(false, LINK(filter), idx, offset, size));
      
      185                 }
      
      186                 else
      
      187                     irc->append(createWildKeySegmentMonitor(idx, offset, size)); // MORE - move this logic to irc::append ?
      
      188             }
      
      ________________________________________________________________________________________________________
      
      

      To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRaNjvQL1JwbRRXECNADpFWbJmd1u5Ft08MVOUAWsoMXj3-2FOk3grCOW6BgQyMmqdP24-3D_V7u2yOhiGAr-2Biu54nFTzz1cdmowKR-2FlEFg5vqux4F9vVAhkyrBXVKKZaG-2BU1lpCEGxOC5oEtKg87kZSQ59f18vK5flar92KrfcOjhCkXtk9E3z7KW3qTOqY4M9VooNN8yub-2FIKU3kv79tmX505momiliYJqo49j8aQFkbR5b-2FACPpkU7DdNV04kMQZPZXkYUR6XJFQXmc76Nmj5WQTLmhGywzSaSlaR-2FbO3TDQdQGDE-3D

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ghalliday Gavin Halliday
                Reporter:
                attilavamos Attila Vamos
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: