Skip to contentSkip to conversation

New Defects reported by Coverity Scan for ceph

DISCUSSION [email protected] 2 participants 2 messages Jan 10, 2015

lore
Share & tools
lore
#0 lore raw

Hi,

Please find the latest report on new defect(s) introduced to ceph found with Coverity Scan.

2 new defect(s) introduced to ceph found with Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 2 of 2 defect(s)

** CID 1260210: Resource leak (RESOURCE_LEAK) /test/msgr/test_msgr.cc: 537 in MessengerTest_ClientStandbyTest_Test::TestBody()()

** CID 1260212: Uncaught exception (UNCAUGHT_EXCEPT) /test/msgr/test_msgr.cc: 579 in main() /test/msgr/test_msgr.cc: 579 in main() /test/msgr/test_msgr.cc: 579 in main() /test/msgr/test_msgr.cc: 579 in main() /test/msgr/test_msgr.cc: 579 in main() /test/msgr/test_msgr.cc: 579 in main()

________________________________________________________________________________________________________
*** CID 1260210: Resource leak (RESOURCE_LEAK) /test/msgr/test_msgr.cc: 537 in MessengerTest_ClientStandbyTest_Test::TestBody()()

531       usleep(300*1000);
532       // client should be standby, so we use original connection
533       {
534         m = new MPing();
535         conn->send_keepalive();
536         CHECK_AND_WAIT_TRUE(conn->is_connected());
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

CID 1260210: Resource leak (RESOURCE_LEAK) Variable "m" going out of scope leaks the storage it points to.

537         ASSERT_TRUE(conn->is_connected());
538         ASSERT_EQ(conn->send_message(m), 0);
539         Mutex::Locker l(cli_dispatcher.lock);
540         while (!cli_dispatcher.got_new)

541 cli_dispatcher.cond.Wait(cli_dispatcher.lock);
542 cli_dispatcher.got_new = false;

________________________________________________________________________________________________________
*** CID 1260212: Uncaught exception (UNCAUGHT_EXCEPT) /test/msgr/test_msgr.cc: 579 in main()
573 // must be defined). This dummy test keeps gtest_main linked in.
574 TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {}
575
576 #endif
577
578

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

CID 1260212: Uncaught exception (UNCAUGHT_EXCEPT)
In function "main(int, char **)" an exception of type "ceph::FailedAssertion" is thrown and never caught.

579 int main(int argc, char **argv) {
580 vector<const char*> args;
581 argv_to_vec(argc, (const char **)argv, args);
582
583 global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
584 g_ceph_context->_conf->set_val("auth_cluster_required", "none");
/test/msgr/test_msgr.cc: 579 in main()
573 // must be defined). This dummy test keeps gtest_main linked in.
574 TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {}
575
576 #endif
577
578

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

CID 1260212: Uncaught exception (UNCAUGHT_EXCEPT)
In function "main(int, char **)" an exception of type "ceph::FailedAssertion" is thrown and never caught.

579 int main(int argc, char **argv) {
580 vector<const char*> args;
581 argv_to_vec(argc, (const char **)argv, args);
582
583 global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
584 g_ceph_context->_conf->set_val("auth_cluster_required", "none");
/test/msgr/test_msgr.cc: 579 in main()
573 // must be defined). This dummy test keeps gtest_main linked in.
574 TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {}
575
576 #endif
577
578

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

CID 1260212: Uncaught exception (UNCAUGHT_EXCEPT)
In function "main(int, char **)" an exception of type "ceph::FailedAssertion" is thrown and never caught.

579 int main(int argc, char **argv) {
580 vector<const char*> args;
581 argv_to_vec(argc, (const char **)argv, args);
582
583 global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
584 g_ceph_context->_conf->set_val("auth_cluster_required", "none");
/test/msgr/test_msgr.cc: 579 in main()
573 // must be defined). This dummy test keeps gtest_main linked in.
574 TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {}
575
576 #endif
577
578

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

CID 1260212: Uncaught exception (UNCAUGHT_EXCEPT)
In function "main(int, char **)" an exception of type "ceph::FailedAssertion" is thrown and never caught.

579 int main(int argc, char **argv) {
580 vector<const char*> args;
581 argv_to_vec(argc, (const char **)argv, args);
582
583 global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
584 g_ceph_context->_conf->set_val("auth_cluster_required", "none");
/test/msgr/test_msgr.cc: 579 in main()
573 // must be defined). This dummy test keeps gtest_main linked in.
574 TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {}
575
576 #endif
577
578

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

CID 1260212: Uncaught exception (UNCAUGHT_EXCEPT)
In function "main(int, char **)" an exception of type "ceph::FailedAssertion" is thrown and never caught.

579 int main(int argc, char **argv) {
580 vector<const char*> args;
581 argv_to_vec(argc, (const char **)argv, args);
582
583 global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
584 g_ceph_context->_conf->set_val("auth_cluster_required", "none");
/test/msgr/test_msgr.cc: 579 in main()
573 // must be defined). This dummy test keeps gtest_main linked in.
574 TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {}
575
576 #endif
577
578

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

CID 1260212: Uncaught exception (UNCAUGHT_EXCEPT)
In function "main(int, char **)" an exception of type "ceph::FailedAssertion" is thrown and never caught.

579 int main(int argc, char **argv) {
580 vector<const char*> args;
581 argv_to_vec(argc, (const char **)argv, args);
582
583 global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
584 g_ceph_context->_conf->set_val("auth_cluster_required", "none");

________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, http://scan.coverity.com/projects/25?tab=overview

To manage Coverity Scan email notifications for "[email protected]", click http://scan.coverity.com/subscriptions/edit?email=ceph-devel%40vger.kernel.org&token=018084d671e3cc89d00dd2ccb7eb849c .

#1 lore raw

The first exception should be shadowed?

And the second exception seemed strange, because other tests are follow this way

Quoted 145 lines · On Sat, Jan 10, 2015 at 10:36 PM, <[email protected]> wrote:

Hi,

Please find the latest report on new defect(s) introduced to ceph found with Coverity Scan.

2 new defect(s) introduced to ceph found with Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 2 of 2 defect(s)

** CID 1260210: Resource leak (RESOURCE_LEAK) /test/msgr/test_msgr.cc: 537 in MessengerTest_ClientStandbyTest_Test::TestBody()()

** CID 1260212: Uncaught exception (UNCAUGHT_EXCEPT) /test/msgr/test_msgr.cc: 579 in main() /test/msgr/test_msgr.cc: 579 in main() /test/msgr/test_msgr.cc: 579 in main() /test/msgr/test_msgr.cc: 579 in main() /test/msgr/test_msgr.cc: 579 in main() /test/msgr/test_msgr.cc: 579 in main()

________________________________________________________________________________________________________
*** CID 1260210: Resource leak (RESOURCE_LEAK) /test/msgr/test_msgr.cc: 537 in MessengerTest_ClientStandbyTest_Test::TestBody()()

531       usleep(300*1000);
532       // client should be standby, so we use original connection
533       {
534         m = new MPing();
535         conn->send_keepalive();
536         CHECK_AND_WAIT_TRUE(conn->is_connected());
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

CID 1260210: Resource leak (RESOURCE_LEAK) Variable "m" going out of scope leaks the storage it points to.

537         ASSERT_TRUE(conn->is_connected());
538         ASSERT_EQ(conn->send_message(m), 0);
539         Mutex::Locker l(cli_dispatcher.lock);
540         while (!cli_dispatcher.got_new)

541 cli_dispatcher.cond.Wait(cli_dispatcher.lock);
542 cli_dispatcher.got_new = false;

________________________________________________________________________________________________________
*** CID 1260212: Uncaught exception (UNCAUGHT_EXCEPT) /test/msgr/test_msgr.cc: 579 in main()
573 // must be defined). This dummy test keeps gtest_main linked in.
574 TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {}
575
576 #endif
577
578

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

CID 1260212: Uncaught exception (UNCAUGHT_EXCEPT)
In function "main(int, char **)" an exception of type "ceph::FailedAssertion" is thrown and never caught.

579 int main(int argc, char **argv) {
580 vector<const char*> args;
581 argv_to_vec(argc, (const char **)argv, args);
582
583 global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
584 g_ceph_context->_conf->set_val("auth_cluster_required", "none");
/test/msgr/test_msgr.cc: 579 in main()
573 // must be defined). This dummy test keeps gtest_main linked in.
574 TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {}
575
576 #endif
577
578

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

CID 1260212: Uncaught exception (UNCAUGHT_EXCEPT)
In function "main(int, char **)" an exception of type "ceph::FailedAssertion" is thrown and never caught.

579 int main(int argc, char **argv) {
580 vector<const char*> args;
581 argv_to_vec(argc, (const char **)argv, args);
582
583 global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
584 g_ceph_context->_conf->set_val("auth_cluster_required", "none");
/test/msgr/test_msgr.cc: 579 in main()
573 // must be defined). This dummy test keeps gtest_main linked in.
574 TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {}
575
576 #endif
577
578

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

CID 1260212: Uncaught exception (UNCAUGHT_EXCEPT)
In function "main(int, char **)" an exception of type "ceph::FailedAssertion" is thrown and never caught.

579 int main(int argc, char **argv) {
580 vector<const char*> args;
581 argv_to_vec(argc, (const char **)argv, args);
582
583 global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
584 g_ceph_context->_conf->set_val("auth_cluster_required", "none");
/test/msgr/test_msgr.cc: 579 in main()
573 // must be defined). This dummy test keeps gtest_main linked in.
574 TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {}
575
576 #endif
577
578

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

CID 1260212: Uncaught exception (UNCAUGHT_EXCEPT)
In function "main(int, char **)" an exception of type "ceph::FailedAssertion" is thrown and never caught.

579 int main(int argc, char **argv) {
580 vector<const char*> args;
581 argv_to_vec(argc, (const char **)argv, args);
582
583 global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
584 g_ceph_context->_conf->set_val("auth_cluster_required", "none");
/test/msgr/test_msgr.cc: 579 in main()
573 // must be defined). This dummy test keeps gtest_main linked in.
574 TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {}
575
576 #endif
577
578

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

CID 1260212: Uncaught exception (UNCAUGHT_EXCEPT)
In function "main(int, char **)" an exception of type "ceph::FailedAssertion" is thrown and never caught.

579 int main(int argc, char **argv) {
580 vector<const char*> args;
581 argv_to_vec(argc, (const char **)argv, args);
582
583 global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
584 g_ceph_context->_conf->set_val("auth_cluster_required", "none");
/test/msgr/test_msgr.cc: 579 in main()
573 // must be defined). This dummy test keeps gtest_main linked in.
574 TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {}
575
576 #endif
577
578

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

CID 1260212: Uncaught exception (UNCAUGHT_EXCEPT)
In function "main(int, char **)" an exception of type "ceph::FailedAssertion" is thrown and never caught.

579 int main(int argc, char **argv) {
580 vector<const char*> args;
581 argv_to_vec(argc, (const char **)argv, args);
582
583 global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
584 g_ceph_context->_conf->set_val("auth_cluster_required", "none");

________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, http://scan.coverity.com/projects/25?tab=overview

To manage Coverity Scan email notifications for "[email protected]", click http://scan.coverity.com/subscriptions/edit?email=ceph-devel%40vger.kernel.org&token=018084d671e3cc89d00dd2ccb7eb849c .

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 3 lines
Best Regards,

Wheat