Re: An empty vptr in an raw object

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

 



On 23/12/2016, Sage Weil wrote:
[snip]
> Hmm, I jumped to a much older commit and the valgrind warnigns go away; I 
> think it's related to the buffer mempools.  Bisecting.

I ran into a similar problem in test_denc that seems to be caused by
underestimating the needed length of the appender:

39	void test_denc(T v) {
40	  // estimate
41	  size_t s = 0;
42	  denc(v, s);
43	  ASSERT_NE(s, 0u);
44	
45	  // encode
46	  bufferlist bl;
47	  {
48	    auto a = bl.get_contiguous_appender(sizeof(T) * 3);
49	    denc(v, a);
50	  }

This fails (the way you've described) pretty reliably whenever the
overhead of a structure being described is less than three times the
actual encoded length of the structure.

If I change the sizeof(T) * 3 above to s, it works perfectly.
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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