New Defects reported by Coverity Scan for ceph (fwd)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Looks like recent changes from Greg, Loic, and I.
--- Begin Message ---

Hi,


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

Defect(s) Reported-by: Coverity Scan
Showing 4 of 4 defect(s)


** CID 1242019:  Data race condition  (MISSING_LOCK)
/msg/Pipe.cc: 230 in Pipe::DelayedDelivery::entry()()

** CID 1242021:  Resource leak  (RESOURCE_LEAK)
/test/librados/tier.cc: 1026 in LibRadosTwoPoolsPP_EvictSnap2_Test::TestBody()()
/test/librados/tier.cc: 1022 in LibRadosTwoPoolsPP_EvictSnap2_Test::TestBody()()
/test/librados/tier.cc: 1040 in LibRadosTwoPoolsPP_EvictSnap2_Test::TestBody()()
/test/librados/tier.cc: 1037 in LibRadosTwoPoolsPP_EvictSnap2_Test::TestBody()()

** CID 1242020:  Resource leak  (RESOURCE_LEAK)
/test/librados/aio.cc: 168 in LibRadosAio_TooBig_Test::TestBody()()

** CID 1242018:  Resource leak  (RESOURCE_LEAK)
/test/librados/aio.cc: 188 in LibRadosAio_TooBigPP_Test::TestBody()()
/test/librados/aio.cc: 190 in LibRadosAio_TooBigPP_Test::TestBody()()
/test/librados/aio.cc: 187 in LibRadosAio_TooBigPP_Test::TestBody()()


________________________________________________________________________________________________________
*** CID 1242019:  Data race condition  (MISSING_LOCK)
/msg/Pipe.cc: 230 in Pipe::DelayedDelivery::entry()()
224         if (flush_count > 0) {
225           --flush_count;
226           active_flush = true;
227         }
228         if (pipe->in_q->can_fast_dispatch(m)) {
229           if (!stop_fast_dispatching_flag) {
>>>     CID 1242019:  Data race condition  (MISSING_LOCK)
>>>     Accessing "this->delay_dispatching" without holding lock "Mutex._m". Elsewhere, "_ZN4Pipe15DelayedDeliveryE.delay_dispatching" is accessed with "Mutex._m" held 1 out of 2 times (1 of these accesses strongly imply that it is necessary).
230             delay_dispatching = true;
231             delay_lock.Unlock();
232             pipe->in_q->fast_dispatch(m);
233             delay_lock.Lock();
234             delay_dispatching = false;
235             if (stop_fast_dispatching_flag) {

________________________________________________________________________________________________________
*** CID 1242021:  Resource leak  (RESOURCE_LEAK)
/test/librados/tier.cc: 1026 in LibRadosTwoPoolsPP_EvictSnap2_Test::TestBody()()
1020         op.cache_evict();
1021         librados::AioCompletion *completion = cluster.aio_create_completion();
1022         ASSERT_EQ(0, cache_ioctx.aio_operate(
1023           "foo", completion, &op,
1024           librados::OPERATION_IGNORE_CACHE, NULL));
1025         completion->wait_for_safe();
>>>     CID 1242021:  Resource leak  (RESOURCE_LEAK)
>>>     Variable "completion" going out of scope leaks the storage it points to.
1026         ASSERT_EQ(0, completion->get_return_value());
1027         completion->release();
1028       }
1029     
1030       // verify the snapdir is not present in the cache pool
1031       {
/test/librados/tier.cc: 1022 in LibRadosTwoPoolsPP_EvictSnap2_Test::TestBody()()
1016     
1017       // evict
1018       {
1019         ObjectReadOperation op;
1020         op.cache_evict();
1021         librados::AioCompletion *completion = cluster.aio_create_completion();
>>>     CID 1242021:  Resource leak  (RESOURCE_LEAK)
>>>     Variable "completion" going out of scope leaks the storage it points to.
1022         ASSERT_EQ(0, cache_ioctx.aio_operate(
1023           "foo", completion, &op,
1024           librados::OPERATION_IGNORE_CACHE, NULL));
1025         completion->wait_for_safe();
1026         ASSERT_EQ(0, completion->get_return_value());
1027         completion->release();
/test/librados/tier.cc: 1040 in LibRadosTwoPoolsPP_EvictSnap2_Test::TestBody()()
1034         op.list_snaps(&snapset, NULL);
1035         ioctx.snap_set_read(librados::SNAP_DIR);
1036         librados::AioCompletion *completion = cluster.aio_create_completion();
1037         ASSERT_EQ(0, ioctx.aio_operate("foo", completion, &op,
1038     				   librados::OPERATION_IGNORE_CACHE, NULL));
1039         completion->wait_for_safe();
>>>     CID 1242021:  Resource leak  (RESOURCE_LEAK)
>>>     Variable "completion" going out of scope leaks the storage it points to.
1040         ASSERT_EQ(-ENOENT, completion->get_return_value());
1041         completion->release();
1042       }
1043     }
1044     
1045     TEST_F(LibRadosTwoPoolsPP, TryFlush) {
/test/librados/tier.cc: 1037 in LibRadosTwoPoolsPP_EvictSnap2_Test::TestBody()()
1031       {
1032         ObjectReadOperation op;
1033         librados::snap_set_t snapset;
1034         op.list_snaps(&snapset, NULL);
1035         ioctx.snap_set_read(librados::SNAP_DIR);
1036         librados::AioCompletion *completion = cluster.aio_create_completion();
>>>     CID 1242021:  Resource leak  (RESOURCE_LEAK)
>>>     Variable "completion" going out of scope leaks the storage it points to.
1037         ASSERT_EQ(0, ioctx.aio_operate("foo", completion, &op,
1038     				   librados::OPERATION_IGNORE_CACHE, NULL));
1039         completion->wait_for_safe();
1040         ASSERT_EQ(-ENOENT, completion->get_return_value());
1041         completion->release();
1042       }

________________________________________________________________________________________________________
*** CID 1242020:  Resource leak  (RESOURCE_LEAK)
/test/librados/aio.cc: 168 in LibRadosAio_TooBig_Test::TestBody()()
162     }
163     
164     TEST(LibRadosAio, TooBig) {
165       AioTestData test_data;
166       rados_completion_t my_completion;
167       ASSERT_EQ("", test_data.init());
>>>     CID 1242020:  Resource leak  (RESOURCE_LEAK)
>>>     Variable "my_completion" going out of scope leaks the storage it points to.
168       ASSERT_EQ(0, rados_aio_create_completion((void*)&test_data,
169     	      set_completion_complete, set_completion_safe, &my_completion));
170       char buf[128];
171       memset(buf, 0xcc, sizeof(buf));
172       ASSERT_EQ(-E2BIG, rados_aio_write(test_data.m_ioctx, "foo",
173                                         my_completion, buf, UINT_MAX, 0));

________________________________________________________________________________________________________
*** CID 1242018:  Resource leak  (RESOURCE_LEAK)
/test/librados/aio.cc: 188 in LibRadosAio_TooBigPP_Test::TestBody()()
182       ASSERT_EQ("", test_data.init());
183     
184       bufferlist bl;
185       AioCompletion *aio_completion = test_data.m_cluster.aio_create_completion(
186                                                                                 (void*)&test_data, NULL, NULL);
187       ASSERT_EQ(-E2BIG, test_data.m_ioctx.aio_write("foo", aio_completion, bl, UINT_MAX, 0));
>>>     CID 1242018:  Resource leak  (RESOURCE_LEAK)
>>>     Variable "aio_completion" going out of scope leaks the storage it points to.
188       ASSERT_EQ(-E2BIG, test_data.m_ioctx.aio_append("foo", aio_completion, bl, UINT_MAX));
189       // ioctx.aio_write_full no way to overflow bl.length()
190     }
191     
192     TEST(LibRadosAio, SimpleWrite) {
193       AioTestData test_data;
/test/librados/aio.cc: 190 in LibRadosAio_TooBigPP_Test::TestBody()()
184       bufferlist bl;
185       AioCompletion *aio_completion = test_data.m_cluster.aio_create_completion(
186                                                                                 (void*)&test_data, NULL, NULL);
187       ASSERT_EQ(-E2BIG, test_data.m_ioctx.aio_write("foo", aio_completion, bl, UINT_MAX, 0));
188       ASSERT_EQ(-E2BIG, test_data.m_ioctx.aio_append("foo", aio_completion, bl, UINT_MAX));
189       // ioctx.aio_write_full no way to overflow bl.length()
>>>     CID 1242018:  Resource leak  (RESOURCE_LEAK)
>>>     Variable "aio_completion" going out of scope leaks the storage it points to.
190     }
191     
192     TEST(LibRadosAio, SimpleWrite) {
193       AioTestData test_data;
194       rados_completion_t my_completion;
195       ASSERT_EQ("", test_data.init());
/test/librados/aio.cc: 187 in LibRadosAio_TooBigPP_Test::TestBody()()
181       AioTestDataPP test_data;
182       ASSERT_EQ("", test_data.init());
183     
184       bufferlist bl;
185       AioCompletion *aio_completion = test_data.m_cluster.aio_create_completion(
186                                                                                 (void*)&test_data, NULL, NULL);
>>>     CID 1242018:  Resource leak  (RESOURCE_LEAK)
>>>     Variable "aio_completion" going out of scope leaks the storage it points to.
187       ASSERT_EQ(-E2BIG, test_data.m_ioctx.aio_write("foo", aio_completion, bl, UINT_MAX, 0));
188       ASSERT_EQ(-E2BIG, test_data.m_ioctx.aio_append("foo", aio_completion, bl, UINT_MAX));
189       // ioctx.aio_write_full no way to overflow bl.length()
190     }
191     
192     TEST(LibRadosAio, SimpleWrite) {


________________________________________________________________________________________________________
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




--- End Message ---

[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux