From: scan-admin@coverity.com
To: ceph-devel@vger.kernel.org
Subject: New Defects reported by Coverity Scan for ceph
Date: Tue, 11 Nov 2014 12:40:33 -0800 [thread overview]
Message-ID: <546274419c35a_3916a97338434b1@scan.coverity.com.mail> (raw)
Hi,
Please find the latest report on new defect(s) introduced to ceph found with Coverity Scan.
19 new defect(s) introduced to ceph found with Coverity Scan.
5 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 19 of 19 defect(s)
** CID 1251445: Unchecked return value (CHECKED_RETURN)
/mon/MDSMonitor.cc: 1511 in MDSMonitor::filesystem_command(MMonCommand *, const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char>>, boost::variant<std::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, double, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detai
l::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_>, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char>>, boost::variant<std::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, double, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::
detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_>>>> &, std::basic_stringstream<char, std::char_traits<char>, std::allocator<char>> &)()
** CID 1251446: Unchecked return value (CHECKED_RETURN)
/osd/PGBackend.cc: 292 in PGBackend::build_pg_backend(const pg_pool_t &, std::tr1::shared_ptr<const OSDMap>, PGBackend::Listener *, coll_t, coll_t, ObjectStore *, CephContext *)()
** CID 1251447: Data race condition (MISSING_LOCK)
/os/FileJournal.cc: 614 in FileJournal::start_writer()()
** CID 1251448: Resource leak (RESOURCE_LEAK)
/test/librados/TestCase.cc: 282 in RadosTest::cleanup_namespace(void *, std::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
/test/librados/TestCase.cc: 275 in RadosTest::cleanup_namespace(void *, std::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
** CID 1251449: Resource leak (RESOURCE_LEAK)
/test/librados/TestCase.cc: 52 in RadosTestNS::cleanup_all_objects(void *)()
/test/librados/TestCase.cc: 43 in RadosTestNS::cleanup_all_objects(void *)()
** CID 1251450: Resource leak (RESOURCE_LEAK)
/test/librbd/test_librbd.cc: 177 in TestLibRBD_CreateAndStat_Test::TestBody()()
** CID 1251451: Resource leak (RESOURCE_LEAK)
/test/librbd/test_librbd.cc: 1288 in TestLibRBD_ListChildren_Test::TestBody()()
** CID 1251452: Resource leak (RESOURCE_LEAK)
/test/librbd/test_librbd.cc: 1388 in TestLibRBD_ListChildrenTiered_Test::TestBody()()
** CID 1251453: Resource leak (RESOURCE_LEAK)
/test/system/st_rados_list_objects.cc: 72 in StRadosListObjects::run()()
/test/system/st_rados_list_objects.cc: 82 in StRadosListObjects::run()()
** CID 1251454: Resource leak (RESOURCE_LEAK)
/test/system/st_rados_list_objects.cc: 82 in StRadosListObjects::run()()
** CID 1251455: Uncaught exception (UNCAUGHT_EXCEPT)
/test/erasure-code/ceph_erasure_code_non_regression.cc: 300 in main()
/test/erasure-code/ceph_erasure_code_non_regression.cc: 300 in main()
** CID 1251456: Uncaught exception (UNCAUGHT_EXCEPT)
/test/erasure-code/ceph_erasure_code_non_regression.cc: 300 in main()
** CID 1251457: Uncaught exception (UNCAUGHT_EXCEPT)
/test/erasure-code/ceph_erasure_code_non_regression.cc: 300 in main()
** CID 1251458: Uncaught exception (UNCAUGHT_EXCEPT)
/test/erasure-code/ceph_erasure_code_non_regression.cc: 300 in main()
** CID 1251459: Uninitialized pointer field (UNINIT_CTOR)
/test/librados/TestCase.h: 24 in RadosTestNS::RadosTestNS()()
** CID 1251460: Uninitialized pointer field (UNINIT_CTOR)
/test/librados/TestCase.h: 76 in RadosTestECNS::RadosTestECNS()()
** CID 1251461: Uninitialized scalar field (UNINIT_CTOR)
/test/librados/TestCase.h: 93 in RadosTestECPPNS::RadosTestECPPNS()()
** CID 1251462: Use after free (USE_AFTER_FREE)
/test/librbd/test_librbd.cc: 299 in test_ls(void *, unsigned long, ...)()
** CID 1251463: Missing varargs init or cleanup (VARARGS)
/test/librbd/test_librbd.cc: 303 in test_ls(void *, unsigned long, ...)()
________________________________________________________________________________________________________
*** CID 1251445: Unchecked return value (CHECKED_RETURN)
/mon/MDSMonitor.cc: 1511 in MDSMonitor::filesystem_command(MMonCommand *, const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char>>, boost::variant<std::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, double, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detai
l::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_>, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char>>, boost::variant<std::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, double, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::
detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_>>>> &, std::basic_stringstream<char, std::char_traits<char>, std::allocator<char>> &)()
1505 r = -EINVAL;
1506 poolid = -1;
1507 ss << "cannot remove default data pool";
1508 }
1509
1510 if (poolid >= 0) {
>>> CID 1251445: Unchecked return value (CHECKED_RETURN)
>>> Calling "cmd_getval" without checking return value (as is done elsewhere 19 out of 22 times).
1511 cmd_getval(g_ceph_context, cmdmap, "poolid", poolid);
1512 r = pending_mdsmap.remove_data_pool(poolid);
1513 if (r == -ENOENT)
1514 r = 0;
1515 if (r == 0)
1516 ss << "removed data pool " << poolid << " from mdsmap";
________________________________________________________________________________________________________
*** CID 1251446: Unchecked return value (CHECKED_RETURN)
/osd/PGBackend.cc: 292 in PGBackend::build_pg_backend(const pg_pool_t &, std::tr1::shared_ptr<const OSDMap>, PGBackend::Listener *, coll_t, coll_t, ObjectStore *, CephContext *)()
286 }
287 case pg_pool_t::TYPE_ERASURE: {
288 ErasureCodeInterfaceRef ec_impl;
289 const map<string,string> &profile = curmap->get_erasure_code_profile(pool.erasure_code_profile);
290 assert(profile.count("plugin"));
291 stringstream ss;
>>> CID 1251446: Unchecked return value (CHECKED_RETURN)
>>> Calling "factory" without checking return value (as is done elsewhere 8 out of 10 times).
292 ceph::ErasureCodePluginRegistry::instance().factory(
293 profile.find("plugin")->second,
294 profile,
295 &ec_impl,
296 ss);
297 assert(ec_impl);
________________________________________________________________________________________________________
*** CID 1251447: Data race condition (MISSING_LOCK)
/os/FileJournal.cc: 614 in FileJournal::start_writer()()
608 }
609
610
611 void FileJournal::start_writer()
612 {
613 write_stop = false;
>>> CID 1251447: Data race condition (MISSING_LOCK)
>>> Accessing "this->aio_stop" without holding lock "Mutex._m". Elsewhere, "FileJournal.aio_stop" is accessed with "Mutex._m" held 1 out of 2 times (1 of these accesses strongly imply that it is necessary).
614 aio_stop = false;
615 write_thread.create();
616 #ifdef HAVE_LIBAIO
617 if (aio)
618 write_finish_thread.create();
619 #endif
________________________________________________________________________________________________________
*** CID 1251448: Resource leak (RESOURCE_LEAK)
/test/librados/TestCase.cc: 282 in RadosTest::cleanup_namespace(void *, std::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
276 int r;
277 const char *entry = NULL;
278 const char *key = NULL;
279 while ((r = rados_nobjects_list_next(list_ctx, &entry, &key, NULL)) != -ENOENT) {
280 ASSERT_EQ(0, r);
281 rados_ioctx_locator_set_key(ioctx, key);
>>> CID 1251448: Resource leak (RESOURCE_LEAK)
>>> Variable "list_ctx" going out of scope leaks the storage it points to.
282 ASSERT_EQ(0, rados_remove(ioctx, entry));
283 }
284 rados_nobjects_list_close(list_ctx);
285 }
286
287 std::string RadosTestPP::pool_name;
/test/librados/TestCase.cc: 275 in RadosTest::cleanup_namespace(void *, std::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
269
270 void RadosTest::cleanup_namespace(rados_ioctx_t ioctx, std::string ns)
271 {
272 rados_ioctx_snap_set_read(ioctx, LIBRADOS_SNAP_HEAD);
273 rados_ioctx_set_namespace(ioctx, ns.c_str());
274 rados_list_ctx_t list_ctx;
>>> CID 1251448: Resource leak (RESOURCE_LEAK)
>>> Variable "list_ctx" going out of scope leaks the storage it points to.
275 ASSERT_EQ(0, rados_nobjects_list_open(ioctx, &list_ctx));
276 int r;
277 const char *entry = NULL;
278 const char *key = NULL;
279 while ((r = rados_nobjects_list_next(list_ctx, &entry, &key, NULL)) != -ENOENT) {
280 ASSERT_EQ(0, r);
________________________________________________________________________________________________________
*** CID 1251449: Resource leak (RESOURCE_LEAK)
/test/librados/TestCase.cc: 52 in RadosTestNS::cleanup_all_objects(void *)()
46 const char *key = NULL;
47 const char *nspace = NULL;
48 while ((r = rados_nobjects_list_next(list_ctx, &entry, &key, &nspace)) != -ENOENT) {
49 ASSERT_EQ(0, r);
50 rados_ioctx_locator_set_key(ioctx, key);
51 rados_ioctx_set_namespace(ioctx, nspace);
>>> CID 1251449: Resource leak (RESOURCE_LEAK)
>>> Variable "list_ctx" going out of scope leaks the storage it points to.
52 ASSERT_EQ(0, rados_remove(ioctx, entry));
53 }
54 rados_nobjects_list_close(list_ctx);
55 }
56
57 std::string RadosTestPPNS::pool_name;
/test/librados/TestCase.cc: 43 in RadosTestNS::cleanup_all_objects(void *)()
37 void RadosTestNS::cleanup_all_objects(rados_ioctx_t ioctx)
38 {
39 // remove all objects to avoid polluting other tests
40 rados_ioctx_snap_set_read(ioctx, LIBRADOS_SNAP_HEAD);
41 rados_ioctx_set_namespace(ioctx, LIBRADOS_ALL_NSPACES);
42 rados_list_ctx_t list_ctx;
>>> CID 1251449: Resource leak (RESOURCE_LEAK)
>>> Variable "list_ctx" going out of scope leaks the storage it points to.
43 ASSERT_EQ(0, rados_nobjects_list_open(ioctx, &list_ctx));
44 int r;
45 const char *entry = NULL;
46 const char *key = NULL;
47 const char *nspace = NULL;
48 while ((r = rados_nobjects_list_next(list_ctx, &entry, &key, &nspace)) != -ENOENT) {
________________________________________________________________________________________________________
*** CID 1251450: Resource leak (RESOURCE_LEAK)
/test/librbd/test_librbd.cc: 177 in TestLibRBD_CreateAndStat_Test::TestBody()()
171 librados::Rados TestLibRBD::_rados;
172 uint64_t TestLibRBD::_image_number = 0;
173
174 TEST_F(TestLibRBD, CreateAndStat)
175 {
176 rados_ioctx_t ioctx;
>>> CID 1251450: Resource leak (RESOURCE_LEAK)
>>> Variable "ioctx" going out of scope leaks the storage it points to.
177 ASSERT_EQ(0, rados_ioctx_create(_cluster, m_pool_name.c_str(), &ioctx));
178
179 rbd_image_info_t info;
180 rbd_image_t image;
181 int order = 0;
182 std::string name = get_temp_image_name();
________________________________________________________________________________________________________
*** CID 1251451: Resource leak (RESOURCE_LEAK)
/test/librbd/test_librbd.cc: 1288 in TestLibRBD_ListChildren_Test::TestBody()()
1282 std::string child_name1 = get_temp_image_name();
1283 std::string child_name2 = get_temp_image_name();
1284 std::string child_name3 = get_temp_image_name();
1285 std::string child_name4 = get_temp_image_name();
1286
1287 // make a parent to clone from
>>> CID 1251451: Resource leak (RESOURCE_LEAK)
>>> Variable "ioctx2" going out of scope leaks the storage it points to.
1288 ASSERT_EQ(0, create_image_full(ioctx1, parent_name.c_str(), 4<<20, &order,
1289 false, features));
1290 ASSERT_EQ(0, rbd_open(ioctx1, parent_name.c_str(), &parent, NULL));
1291 // create a snapshot, reopen as the parent we're interested in
1292 ASSERT_EQ(0, rbd_snap_create(parent, "parent_snap"));
1293 ASSERT_EQ(0, rbd_snap_set(parent, "parent_snap"));
________________________________________________________________________________________________________
*** CID 1251452: Resource leak (RESOURCE_LEAK)
/test/librbd/test_librbd.cc: 1388 in TestLibRBD_ListChildrenTiered_Test::TestBody()()
1382
1383 int features = RBD_FEATURE_LAYERING;
1384 rbd_image_t parent;
1385 int order = 0;
1386
1387 // make a parent to clone from
>>> CID 1251452: Resource leak (RESOURCE_LEAK)
>>> Variable "ioctx2" going out of scope leaks the storage it points to.
1388 ASSERT_EQ(0, create_image_full(ioctx1, parent_name.c_str(), 4<<20, &order,
1389 false, features));
1390 ASSERT_EQ(0, rbd_open(ioctx1, parent_name.c_str(), &parent, NULL));
1391 // create a snapshot, reopen as the parent we're interested in
1392 ASSERT_EQ(0, rbd_snap_create(parent, "parent_snap"));
1393 ASSERT_EQ(0, rbd_snap_set(parent, "parent_snap"));
________________________________________________________________________________________________________
*** CID 1251453: Resource leak (RESOURCE_LEAK)
/test/system/st_rados_list_objects.cc: 72 in StRadosListObjects::run()()
66 RETURN1_IF_NONZERO(rados_ioctx_create(cl, "foo", &io_ctx));
67
68 int saw = 0;
69 const char *obj_name;
70 rados_list_ctx_t h;
71 printf("%s: listing objects.\n", get_id_str());
>>> CID 1251453: Resource leak (RESOURCE_LEAK)
>>> Variable "io_ctx" going out of scope leaks the storage it points to.
72 RETURN1_IF_NONZERO(rados_nobjects_list_open(io_ctx, &h));
73 while (true) {
74 int ret = rados_nobjects_list_next(h, &obj_name, NULL, NULL);
75 if (ret == -ENOENT) {
76 break;
77 }
/test/system/st_rados_list_objects.cc: 82 in StRadosListObjects::run()()
76 break;
77 }
78 else if (ret != 0) {
79 if (m_accept_list_errors && (!m_midway_sem_post || saw > m_midway_cnt))
80 break;
81 printf("%s: rados_objects_list_next error: %d\n", get_id_str(), ret);
>>> CID 1251453: Resource leak (RESOURCE_LEAK)
>>> Variable "io_ctx" going out of scope leaks the storage it points to.
82 return ret;
83 }
84 if ((saw % 25) == 0) {
85 printf("%s: listed object %d...\n", get_id_str(), saw);
86 }
87 ++saw;
________________________________________________________________________________________________________
*** CID 1251454: Resource leak (RESOURCE_LEAK)
/test/system/st_rados_list_objects.cc: 82 in StRadosListObjects::run()()
76 break;
77 }
78 else if (ret != 0) {
79 if (m_accept_list_errors && (!m_midway_sem_post || saw > m_midway_cnt))
80 break;
81 printf("%s: rados_objects_list_next error: %d\n", get_id_str(), ret);
>>> CID 1251454: Resource leak (RESOURCE_LEAK)
>>> Variable "h" going out of scope leaks the storage it points to.
82 return ret;
83 }
84 if ((saw % 25) == 0) {
85 printf("%s: listed object %d...\n", get_id_str(), saw);
86 }
87 ++saw;
________________________________________________________________________________________________________
*** CID 1251455: Uncaught exception (UNCAUGHT_EXCEPT)
/test/erasure-code/ceph_erasure_code_non_regression.cc: 300 in main()
294 {
295 stringstream path;
296 path << directory << "/" << chunk;
297 return path.str();
298 }
299
>>> CID 1251455: Uncaught exception (UNCAUGHT_EXCEPT)
>>> In function "main(int, char **)" an exception of type "ceph::FailedAssertion" is thrown and never caught.
300 int main(int argc, char** argv) {
301 ErasureCodeNonRegression non_regression;
302 int err = non_regression.setup(argc, argv);
303 if (err)
304 return err;
305 return non_regression.run();
/test/erasure-code/ceph_erasure_code_non_regression.cc: 300 in main()
294 {
295 stringstream path;
296 path << directory << "/" << chunk;
297 return path.str();
298 }
299
>>> CID 1251455: Uncaught exception (UNCAUGHT_EXCEPT)
>>> In function "main(int, char **)" an exception of type "ceph::FailedAssertion" is thrown and never caught.
300 int main(int argc, char** argv) {
301 ErasureCodeNonRegression non_regression;
302 int err = non_regression.setup(argc, argv);
303 if (err)
304 return err;
305 return non_regression.run();
________________________________________________________________________________________________________
*** CID 1251456: Uncaught exception (UNCAUGHT_EXCEPT)
/test/erasure-code/ceph_erasure_code_non_regression.cc: 300 in main()
294 {
295 stringstream path;
296 path << directory << "/" << chunk;
297 return path.str();
298 }
299
>>> CID 1251456: Uncaught exception (UNCAUGHT_EXCEPT)
>>> In function "main(int, char **)" an exception of type "boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::bad_lexical_cast> >" is thrown and never caught.
300 int main(int argc, char** argv) {
301 ErasureCodeNonRegression non_regression;
302 int err = non_regression.setup(argc, argv);
303 if (err)
304 return err;
305 return non_regression.run();
________________________________________________________________________________________________________
*** CID 1251457: Uncaught exception (UNCAUGHT_EXCEPT)
/test/erasure-code/ceph_erasure_code_non_regression.cc: 300 in main()
294 {
295 stringstream path;
296 path << directory << "/" << chunk;
297 return path.str();
298 }
299
>>> CID 1251457: Uncaught exception (UNCAUGHT_EXCEPT)
>>> In function "main(int, char **)" an exception of type "boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::bad_any_cast> >" is thrown and never caught.
300 int main(int argc, char** argv) {
301 ErasureCodeNonRegression non_regression;
302 int err = non_regression.setup(argc, argv);
303 if (err)
304 return err;
305 return non_regression.run();
________________________________________________________________________________________________________
*** CID 1251458: Uncaught exception (UNCAUGHT_EXCEPT)
/test/erasure-code/ceph_erasure_code_non_regression.cc: 300 in main()
294 {
295 stringstream path;
296 path << directory << "/" << chunk;
297 return path.str();
298 }
299
>>> CID 1251458: Uncaught exception (UNCAUGHT_EXCEPT)
>>> In function "main(int, char **)" an exception of type "boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::bad_function_call> >" is thrown and never caught.
300 int main(int argc, char** argv) {
301 ErasureCodeNonRegression non_regression;
302 int err = non_regression.setup(argc, argv);
303 if (err)
304 return err;
305 return non_regression.run();
________________________________________________________________________________________________________
*** CID 1251459: Uninitialized pointer field (UNINIT_CTOR)
/test/librados/TestCase.h: 24 in RadosTestNS::RadosTestNS()()
18 *
19 * Since pool creation and deletion is slow, this allows many tests to
20 * run faster.
21 */
22 class RadosTestNS : public ::testing::Test {
23 public:
>>> CID 1251459: Uninitialized pointer field (UNINIT_CTOR)
>>> Non-static class member "ioctx" is not initialized in this constructor nor in any functions that it calls.
24 RadosTestNS() {}
25 virtual ~RadosTestNS() {}
26 protected:
27 static void SetUpTestCase();
28 static void TearDownTestCase();
29 static void cleanup_all_objects(rados_ioctx_t ioctx);
________________________________________________________________________________________________________
*** CID 1251460: Uninitialized pointer field (UNINIT_CTOR)
/test/librados/TestCase.h: 76 in RadosTestECNS::RadosTestECNS()()
70 librados::Rados &cluster;
71 librados::IoCtx ioctx;
72 };
73
74 class RadosTestECNS : public RadosTestNS {
75 public:
>>> CID 1251460: Uninitialized pointer field (UNINIT_CTOR)
>>> Non-static class member "alignment" is not initialized in this constructor nor in any functions that it calls.
76 RadosTestECNS() {}
77 virtual ~RadosTestECNS() {}
78 protected:
79 static void SetUpTestCase();
80 static void TearDownTestCase();
81 static rados_t s_cluster;
________________________________________________________________________________________________________
*** CID 1251461: Uninitialized scalar field (UNINIT_CTOR)
/test/librados/TestCase.h: 93 in RadosTestECPPNS::RadosTestECPPNS()()
87 rados_ioctx_t ioctx;
88 uint64_t alignment;
89 };
90
91 class RadosTestECPPNS : public RadosTestPPNS {
92 public:
>>> CID 1251461: Uninitialized scalar field (UNINIT_CTOR)
>>> Non-static class member "alignment" is not initialized in this constructor nor in any functions that it calls.
93 RadosTestECPPNS() : cluster(s_cluster) {}
94 virtual ~RadosTestECPPNS() {}
95 protected:
96 static void SetUpTestCase();
97 static void TearDownTestCase();
98 static librados::Rados s_cluster;
________________________________________________________________________________________________________
*** CID 1251462: Use after free (USE_AFTER_FREE)
/test/librbd/test_librbd.cc: 299 in test_ls(void *, unsigned long, ...)()
293 va_start(ap, num_expected);
294 for (i = num_expected; i > 0; i--) {
295 char *expected = va_arg(ap, char *);
296 printf("expected = %s\n", expected);
297 std::set<std::string>::iterator it = image_names.find(expected);
298 if (it != image_names.end()) {
>>> CID 1251462: Use after free (USE_AFTER_FREE)
>>> Passing freed pointer "cur_name" as an argument to "printf".
299 printf("found %s\n", cur_name);
300 image_names.erase(it);
301 } else {
302 ADD_FAILURE() << "Unable to find image " << expected;
303 return -ENOENT;
304 }
________________________________________________________________________________________________________
*** CID 1251463: Missing varargs init or cleanup (VARARGS)
/test/librbd/test_librbd.cc: 303 in test_ls(void *, unsigned long, ...)()
297 std::set<std::string>::iterator it = image_names.find(expected);
298 if (it != image_names.end()) {
299 printf("found %s\n", cur_name);
300 image_names.erase(it);
301 } else {
302 ADD_FAILURE() << "Unable to find image " << expected;
>>> CID 1251463: Missing varargs init or cleanup (VARARGS)
>>> va_end was not called for "ap".
303 return -ENOENT;
304 }
305 }
306 va_end(ap);
307
308 if (!image_names.empty()) {
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, http://scan.coverity.com/projects/25?tab=overview
To unsubscribe from the email notification for new defects, http://scan5.coverity.com/cgi-bin/unsubscribe.py
next reply other threads:[~2014-11-11 20:40 UTC|newest]
Thread overview: 124+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-11 20:40 scan-admin [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-08-20 12:22 New Defects reported by Coverity Scan for ceph scan-admin
2022-08-20 13:17 ` Jeff Layton
2022-08-22 3:54 ` Brad Hubbard
2022-08-23 12:52 ` Jeff Layton
2018-01-04 3:32 scan-admin
2017-12-28 1:57 scan-admin
2017-12-21 1:54 scan-admin
2017-12-21 3:34 ` Jos Collin
2017-12-21 4:03 ` Brad Hubbard
2017-12-14 6:49 scan-admin
2017-12-01 2:25 scan-admin
2017-11-23 0:19 scan-admin
2017-11-16 11:35 scan-admin
2017-11-09 11:36 scan-admin
2017-11-02 2:11 scan-admin
2017-10-27 0:31 scan-admin
2017-10-19 3:54 scan-admin
2017-10-12 5:54 scan-admin
2017-10-05 5:08 scan-admin
2017-09-28 5:09 scan-admin
2017-09-21 6:44 scan-admin
2017-09-14 7:19 scan-admin
2017-09-07 5:08 scan-admin
2017-08-31 6:39 scan-admin
2017-08-24 23:32 scan-admin
2017-08-17 3:29 scan-admin
2017-08-10 3:50 scan-admin
2017-08-03 4:57 scan-admin
2017-07-27 3:50 scan-admin
2017-07-28 18:42 ` Gregory Farnum
2017-07-28 22:22 ` Brad Hubbard
2017-07-20 4:08 scan-admin
2017-07-13 5:11 scan-admin
2017-07-06 5:03 scan-admin
2017-06-29 4:08 scan-admin
2017-06-22 4:27 scan-admin
2017-06-15 9:50 scan-admin
2017-06-11 23:46 scan-admin
2017-06-01 4:33 scan-admin
2017-05-25 6:22 scan-admin
2017-05-18 1:44 scan-admin
2017-05-11 5:32 scan-admin
2017-05-04 2:45 scan-admin
2017-04-27 2:22 scan-admin
2017-04-20 5:34 scan-admin
2017-04-13 6:25 scan-admin
2017-04-06 9:40 scan-admin
2017-03-31 1:25 scan-admin
2017-03-23 7:58 scan-admin
2017-03-16 7:37 scan-admin
2017-03-09 6:12 scan-admin
2017-03-02 7:44 scan-admin
2017-02-23 9:09 scan-admin
2017-02-17 2:29 scan-admin
[not found] ` <CAJE9aOMoxWjhq=g+25hfhMhxSCnHAOwAyNhXvkxS1wwBEd3j+A@mail.gmail.com>
2017-02-17 5:19 ` kefu chai
2017-02-05 10:08 scan-admin
2017-01-27 13:22 scan-admin
2017-01-17 3:01 scan-admin
2017-01-09 10:05 scan-admin
2016-12-30 8:33 scan-admin
2016-12-23 9:16 scan-admin
2016-12-16 8:54 scan-admin
2016-12-09 11:29 scan-admin
2016-12-02 11:08 scan-admin
2016-11-25 7:55 scan-admin
2016-03-19 17:58 scan-admin
2016-03-13 17:40 scan-admin
2016-03-12 18:04 scan-admin
2016-03-05 17:55 scan-admin
2016-03-07 20:59 ` Gregory Farnum
2016-02-27 18:07 scan-admin
2016-02-20 18:26 scan-admin
2016-02-18 20:32 scan-admin
2016-02-13 17:47 scan-admin
2016-02-11 17:57 scan-admin
2016-02-11 22:01 ` Gregory Farnum
2016-02-12 16:36 ` Adam C. Emerson
2016-02-04 20:39 scan-admin
2016-02-03 20:40 scan-admin
2015-05-02 14:37 scan-admin
2015-01-21 1:41 scan-admin
2015-01-16 14:39 scan-admin
2015-01-16 15:17 ` Gregory Farnum
2015-01-16 16:00 ` John Spray
2015-01-16 16:08 ` Sage Weil
[not found] <54b528bef1f63_1b74f3532c63410@scan.coverity.com.mail>
2015-01-13 14:34 ` Sage Weil
2015-01-13 14:16 scan-admin
2015-01-10 14:36 scan-admin
2015-01-10 15:48 ` Haomai Wang
2015-01-09 14:30 scan-admin
2015-01-09 15:26 ` Sage Weil
2015-01-09 15:32 ` Danny Al-Gaaf
2015-01-04 14:14 scan-admin
2014-12-27 14:13 scan-admin
2014-12-28 6:03 ` Sage Weil
2014-12-26 14:19 scan-admin
2014-12-23 14:37 scan-admin
2014-12-21 14:13 scan-admin
2014-12-18 14:19 scan-admin
2014-12-14 14:17 scan-admin
2014-12-07 20:36 scan-admin
2014-12-05 14:11 scan-admin
2014-12-02 14:09 scan-admin
2014-11-25 14:09 scan-admin
2014-11-23 14:08 scan-admin
2014-11-20 14:20 scan-admin
2014-11-14 14:21 scan-admin
2014-11-13 14:21 scan-admin
2014-11-09 14:12 scan-admin
2014-10-30 13:19 scan-admin
2014-10-30 16:08 ` Sage Weil
2014-10-28 13:16 scan-admin
2014-10-28 18:26 ` Danny Al-Gaaf
2014-10-26 13:17 scan-admin
2014-10-24 17:55 scan-admin
2014-10-24 17:59 ` Sage Weil
2014-10-17 13:27 scan-admin
2014-10-09 13:23 scan-admin
2014-10-02 13:21 scan-admin
2014-09-25 13:18 scan-admin
2014-09-16 21:40 scan-admin
2014-08-16 21:31 scan-admin
2014-08-09 15:30 scan-admin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=546274419c35a_3916a97338434b1@scan.coverity.com.mail \
--to=scan-admin@coverity.com \
--cc=ceph-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.