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

Memory leaks in SQS plugin

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Not specified
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.4.0
    • Component/s: Plugins
    • Labels:
      None

      Description

      As reported by Coverity:

          • CID 1437872: (RESOURCE_LEAK)
            /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/plugins/sqs/sqs.cpp: 325 in SQSHPCCPlugin::SQSHPCC::RegionExists(const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&)()
            319 { 320 return false; 321 }
            322
            323 char *reg = convertStringToChar(region);
            324
            >>> CID 1437872: (RESOURCE_LEAK)
            >>> Variable "reg" going out of scope leaks the storage it points to.
            325 return (
            326 strieq(reg,"US_EAST_1") ||
            327 strieq(reg,"US_WEST_1") ||
            328 strieq(reg,"EU_WEST_1") ||
            329 strieq(reg,"EU_CENTRAL_1") ||
            330 strieq(reg,"AP_SOUTHEAST_1") ||
            /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/plugins/sqs/sqs.cpp: 325 in SQSHPCCPlugin::SQSHPCC::RegionExists(const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&)()
            319 { 320 return false; 321 }

            322
            323 char *reg = convertStringToChar(region);
            324
            >>> CID 1437872: (RESOURCE_LEAK)
            >>> Variable "reg" going out of scope leaks the storage it points to.
            325 return (
            326 strieq(reg,"US_EAST_1") ||
            327 strieq(reg,"US_WEST_1") ||
            328 strieq(reg,"EU_WEST_1") ||
            329 strieq(reg,"EU_CENTRAL_1") ||
            330 strieq(reg,"AP_SOUTHEAST_1") ||
            /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/plugins/sqs/sqs.cpp: 325 in SQSHPCCPlugin::SQSHPCC::RegionExists(const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&)()
            319

            { 320 return false; 321 }
            322
            323 char *reg = convertStringToChar(region);
            324
            >>> CID 1437872: (RESOURCE_LEAK)
            >>> Variable "reg" going out of scope leaks the storage it points to.
            325 return (
            326 strieq(reg,"US_EAST_1") ||
            327 strieq(reg,"US_WEST_1") ||
            328 strieq(reg,"EU_WEST_1") ||
            329 strieq(reg,"EU_CENTRAL_1") ||
            330 strieq(reg,"AP_SOUTHEAST_1") ||
            /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/plugins/sqs/sqs.cpp: 325 in SQSHPCCPlugin::SQSHPCC::RegionExists(const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&)()
            319 { 320 return false; 321 }

            322
            323 char *reg = convertStringToChar(region);
            324
            >>> CID 1437872: (RESOURCE_LEAK)
            >>> Variable "reg" going out of scope leaks the storage it points to.
            325 return (
            326 strieq(reg,"US_EAST_1") ||
            327 strieq(reg,"US_WEST_1") ||
            328 strieq(reg,"EU_WEST_1") ||
            329 strieq(reg,"EU_CENTRAL_1") ||
            330 strieq(reg,"AP_SOUTHEAST_1") ||
            /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/plugins/sqs/sqs.cpp: 325 in SQSHPCCPlugin::SQSHPCC::RegionExists(const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&)()
            319

            { 320 return false; 321 }
            322
            323 char *reg = convertStringToChar(region);
            324
            >>> CID 1437872: (RESOURCE_LEAK)
            >>> Variable "reg" going out of scope leaks the storage it points to.
            325 return (
            326 strieq(reg,"US_EAST_1") ||
            327 strieq(reg,"US_WEST_1") ||
            328 strieq(reg,"EU_WEST_1") ||
            329 strieq(reg,"EU_CENTRAL_1") ||
            330 strieq(reg,"AP_SOUTHEAST_1") ||
            /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/plugins/sqs/sqs.cpp: 325 in SQSHPCCPlugin::SQSHPCC::RegionExists(const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&)()
            319 { 320 return false; 321 }

            322
            323 char *reg = convertStringToChar(region);
            324
            >>> CID 1437872: (RESOURCE_LEAK)
            >>> Variable "reg" going out of scope leaks the storage it points to.
            325 return (
            326 strieq(reg,"US_EAST_1") ||
            327 strieq(reg,"US_WEST_1") ||
            328 strieq(reg,"EU_WEST_1") ||
            329 strieq(reg,"EU_CENTRAL_1") ||
            330 strieq(reg,"AP_SOUTHEAST_1") ||

        • CID 1437873: (RESOURCE_LEAK)
          /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/plugins/sqs/sqs.cpp: 341 in SQSHPCCPlugin::SQSHPCC::getRegion(const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&)()
          /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/plugins/sqs/sqs.cpp: 342 in SQSHPCCPlugin::SQSHPCC::getRegion(const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&)()
          /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/plugins/sqs/sqs.cpp: 343 in SQSHPCCPlugin::SQSHPCC::getRegion(const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&)()
          /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/plugins/sqs/sqs.cpp: 344 in SQSHPCCPlugin::SQSHPCC::getRegion(const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&)()
          /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/plugins/sqs/sqs.cpp: 345 in SQSHPCCPlugin::SQSHPCC::getRegion(const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&)()
          /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/plugins/sqs/sqs.cpp: 346 in SQSHPCCPlugin::SQSHPCC::getRegion(const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&)()

      ________________________________________________________________________________________________________

          • CID 1437873: (RESOURCE_LEAK)
            /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/plugins/sqs/sqs.cpp: 341 in SQSHPCCPlugin::SQSHPCC::getRegion(const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&)()
            335
            336 const char *const SQSHPCCPlugin::SQSHPCC::getRegion(const string& region)
            337 {
            338
            339 char *reg = convertStringToChar(region);
            340
            >>> CID 1437873: (RESOURCE_LEAK)
            >>> Variable "reg" going out of scope leaks the storage it points to.
            341 if(strieq(reg,"US_EAST_1")) return Aws::Region::US_EAST_1;
            342 if(strieq(reg,"US_WEST_1")) return Aws::Region::US_WEST_1;
            343 if(strieq(reg,"EU_WEST_1")) return Aws::Region::EU_WEST_1;
            344 if(strieq(reg,"EU_CENTRAL_1")) return Aws::Region::EU_CENTRAL_1;
            345 if(strieq(reg,"AP_SOUTHEAST_1")) return Aws::Region::AP_SOUTHEAST_1;
            346 if(strieq(reg,"AP_SOUTHEAST_2")) return Aws::Region::AP_SOUTHEAST_2;
            /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/plugins/sqs/sqs.cpp: 342 in SQSHPCCPlugin::SQSHPCC::getRegion(const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&)()
            336 const char *const SQSHPCCPlugin::SQSHPCC::getRegion(const string& region)
            337
            Unknown macro: {338339 char *reg = convertStringToChar(region);340341 if(strieq(reg,"US_EAST_1")) return Aws}

            350
            /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/plugins/sqs/sqs.cpp: 346 in SQSHPCCPlugin::SQSHPCC::getRegion(const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&)()
            340
            341 if(strieq(reg,"US_EAST_1")) return Aws::Region::US_EAST_1;
            342 if(strieq(reg,"US_WEST_1")) return Aws::Region::US_WEST_1;
            343 if(strieq(reg,"EU_WEST_1")) return Aws::Region::EU_WEST_1;
            344 if(strieq(reg,"EU_CENTRAL_1")) return Aws::Region::EU_CENTRAL_1;
            345 if(strieq(reg,"AP_SOUTHEAST_1")) return Aws::Region::AP_SOUTHEAST_1;
            >>> CID 1437873: (RESOURCE_LEAK)
            >>> Variable "reg" going out of scope leaks the storage it points to.
            346 if(strieq(reg,"AP_SOUTHEAST_2")) return Aws::Region::AP_SOUTHEAST_2;
            347
            348 throw string("Your region must be among these regions [ US_EAST_1, US_WEST_1, EU_WEST_1, EU_CENTRAL_1, AP_SOUTHEAST_1, AP_SOUTHEAST_2 ], please check your region");
            349 }
            350
            351

        • CID 1437874: Uninitialized members (UNINIT_CTOR)
          /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/testing/unittests/unittests.cpp: 315 in PtreeThreadingTest::_testContention(unsigned char)::casyncfor::casyncfor(const char *, unsigned char, PtreeThreadingTest::_testContention(unsigned char)::ContentionMode, int)()

      ________________________________________________________________________________________________________

        • CID 1437875: Uninitialized members (UNINIT_CTOR)
          /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/plugins/sqs/sqs.cpp: 91 in SQSHPCCPlugin::SQSHPCC::SQSHPCC(const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&)()

      ________________________________________________________________________________________________________

          • CID 1437875: Uninitialized members (UNINIT_CTOR)
            /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/plugins/sqs/sqs.cpp: 91 in SQSHPCCPlugin::SQSHPCC::SQSHPCC(const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&)()
            85 { 86 throw runtime_error("QueueName is required"); 87 }

            88 this->queueName=_queuename;
            89 cout << "The queue is " << this->queueName << endl;
            90
            >>> CID 1437875: Uninitialized members (UNINIT_CTOR)
            >>> Non-static class member "credentials" is not initialized in this constructor nor in any functions that it calls.
            91 }
            92
            93
            94 /**
            95 * Destructor
            96 * Release the SQS connection

        Attachments

          Activity

            People

            • Assignee:
              richardkchapman Richard Chapman
              Reporter:
              richardkchapman Richard Chapman
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: