assertion failure while stating an object (librados::IoCtx::stat)
Hi Ceph Team, We are using ceph version 0.67.4 and are recently hitting large number of assertion failures on our ceph cluster while stating an object using C++ librados API (as shown below)
-----
uint64_t size;
time_t mtime;
std::string object_name;
librados::IoCtx mioctx;
...
do {
// generate object_name
}
while ( 0 == mioctx.stat(object_name, &size, &mtime));
-----
We did not face similar issues in past 3 months.
Any thoughts on what can be done to straighten this up?
Sample log is given below:
common/Mutex.cc: In function 'void Mutex::Lock(bool)' thread 7f615f275700 time 2014-04-04 09:03:22.128731
common/Mutex.cc: 93: FAILED assert(r == 0)
ceph version 0.67.4 (ad85b8bfafea6232d64cb7ba76a8b6e8252fa0c7) 1: (Mutex::Lock(bool)+0x1d3) [0x7f61576ac763]
2: (librados::IoCtxImpl::operate_read(object_t const&, ObjectOperation*,
ceph::buffer::list*)+0x17b) [0x7f615765069b]
3: (librados::IoCtxImpl::stat(object_t const&, unsigned long*,
long*)+0x185) [0x7f6157653b05]
4: (librados::IoCtx::stat(std::string const&, unsigned long*, long*)+0x58)
[0x7f6157628498]
5: (radosencwriter::getUniqueObjectName(unsigned int)+0x22b)
[0x7f6158726c6b]
6: (radosencwriter::write_to_rados(std::string const&, unsigned
long)+0x14c) [0x7f6158726f9c]
7: (radosencwriter::write(std::string const&, unsigned long)+0x37a)
[0x7f615872868a]
8: (()+0x36153) [0x7f6158715153]
9: (Perl_pp_entersub()+0x5a5) [0x7f615eda3705]
10: (Perl_runops_standard()+0x16) [0x7f615eda1c46]
11: (perl_run()+0x13c) [0x7f615ed4660c]
12: (main()+0x154) [0x400f24]
13: (__libc_start_main()+0xfd) [0x7f615e312c8d]
14: starman worker () [0x400d09]
NOTE: a copy of the executable, or objdump -rdS <executable> is needed to
interpret this.
Hi Amit,
Quoted 19 lines · Amit Tiwary
Hi Ceph Team, We are using ceph version 0.67.4 and are recently hitting large number of assertion failures on our ceph cluster while stating an object using C++ librados API (as shown below)
-----
uint64_tsize;
time_tmtime;
std::stringobject_name;
librados::IoCtxmioctx;
...do { // generate object_name}
while ( 0 ==mioctx.stat(object_name, &size, &mtime));
-----
We did not face similar issues in past 3 months. Any thoughts on what can be done to straighten this up?Sample log is given below:
Quoted 7 lines
common/Mutex.cc: In function 'void
Mutex::Lock(bool)' thread7f615f275700time 2014-04-04 09:03:22.128731
common/Mutex.cc: 93: FAILED assert(r == 0)
ceph version 0.67.4 (ad85b8bfafea6232d64cb7ba76a8b6e8252fa0c7) 1: (Mutex::Lock(bool)+0x1d3) [0x7f61576ac763]
2: (librados::IoCtxImpl::operate_read(object_t const&, ObjectOperation*,
ceph::buffer::list*)+0x17b) [0x7f615765069b]
This Mutex assertion usually triggers in use-after-free cases where the pthread mutex id is invalid (because it has been deallocated). My guess is that your IoCtx has been freed, or the shutdown() method has been called on the cluster handle... is that possible? (Obviously not with the code fragment above, but I'm guess that isn't a straight copy+paste from your code?)
sage
Quoted 26 lines
3: (librados::IoCtxImpl::stat(object_t const&, unsigned long*,
long*)+0x185) [0x7f6157653b05]
4: (librados::IoCtx::stat(std::string const&, unsigned long*, long*)+0x58)
[0x7f6157628498]
5: (radosencwriter::getUniqueObjectName(unsigned int)+0x22b)
[0x7f6158726c6b]
6: (radosencwriter::write_to_rados(std::string const&, unsigned
long)+0x14c) [0x7f6158726f9c]
7: (radosencwriter::write(std::string const&, unsigned long)+0x37a)
[0x7f615872868a]
8: (()+0x36153) [0x7f6158715153]
9: (Perl_pp_entersub()+0x5a5) [0x7f615eda3705]
10: (Perl_runops_standard()+0x16) [0x7f615eda1c46]
11: (perl_run()+0x13c) [0x7f615ed4660c]
12: (main()+0x154) [0x400f24]
13: (__libc_start_main()+0xfd) [0x7f615e312c8d]
14: starman worker () [0x400d09]
NOTE: a copy of the executable, orobjdump -rdS <executable>is needed to
interpret this.--
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
Quoted 4 lines · Sage Weil <sage <at> inktank.com> writes:
Hi Amit,
Quoted 2 lines
common/Mutex.cc: In function 'void
Mutex::Lock(bool)' thread
7f615f275700
Quoted 5 lines
Quoted 5 lines
time 2014-04-04 09:03:22.128731
common/Mutex.cc: 93: FAILED assert(r == 0)
ceph version 0.67.4 (ad85b8bfafea6232d64cb7ba76a8b6e8252fa0c7) 1: (Mutex::Lock(bool)+0x1d3) [0x7f61576ac763]
2: (librados::IoCtxImpl::operate_read(object_t const&,
ObjectOperation*,
Quoted 11 lines
Quoted 1 line
ceph::buffer::list*)+0x17b) [
0x7f615765069b]This Mutex assertion usually triggers in use-after-free cases where the pthread mutex id is invalid (because it has been deallocated). My guess is that your IoCtx has been freed, or the
shutdown()method has been called on the cluster handle... is that possible? (Obviously not with the code fragment above, but I'm guess that isn't a straight copy+paste from your code?)sage
Thanks Sage for your input. I would look into the code to figure out if they are any calls to IoCtx::close() or Rados::shutdown(). However, on closer inspection I find lot of pthread_create() failing (refer log below) with error 11 (EAGAIN) indicating "insufficient resources to create another thread, or a system-imposed limit on the number of threads was encountered". Could Mutex assertion failure be a side effect of this?
-------------------------------Thread::try_create(): pthread_create failed with error 11 common/Thread.cc: In function 'void Thread::create(size_t)' thread 7f615f275700 time 2014-04-04 08:57:03.511877
common/Thread.cc: 110: FAILED assert(ret == 0)
ceph version 0.67.4 (ad85b8bfafea6232d64cb7ba76a8b6e8252fa0c7) 1: (()+0x36004f) [0x7f615783804f]
2: (SimpleMessenger::connect_rank(entity_addr_t const&, int, Connection*,
Message*)+0x17b) [0x7f61577c9b9b]
3: (SimpleMessenger::get_connection(entity_inst_t const&)+0x244)
[0x7f61577ce824]
4: (Objecter::get_session(int)+0x1d1) [0x7f615765b391]
5: (Objecter::recalc_op_target(Objecter::Op*)+0x336) [0x7f615765c0d6] 6: (Objecter::_op_submit(Objecter::Op*)+0x43) [0x7f6157665993] 7: (librados::IoCtxImpl::operate_read(object_t const&, ObjectOperation*,
ceph::buffer::list*)+0x2dc) [0x7f61576507fc]
8: (librados::IoCtxImpl::stat(object_t const&, unsigned long*,
long*)+0x185) [0x7f6157653b05]
9: (librados::IoCtx::stat(std::string const&, unsigned long*, long*)+0x58)
[0x7f6157628498]
Regards,
Amit Tiwary
Quoted 41 lines · Amit Tiwary
Quoted 4 lines · Sage Weil <sage <at> inktank.com> writes:
Hi Amit,
Quoted 2 lines
common/Mutex.cc: In function 'void
Mutex::Lock(bool)' thread
7f615f275700Quoted 5 lines
Quoted 5 lines
time 2014-04-04 09:03:22.128731
common/Mutex.cc: 93: FAILED assert(r == 0)
ceph version 0.67.4 (ad85b8bfafea6232d64cb7ba76a8b6e8252fa0c7) 1: (Mutex::Lock(bool)+0x1d3) [0x7f61576ac763]
2: (librados::IoCtxImpl::operate_read(object_t const&,ObjectOperation*,
Quoted 11 lines
Quoted 1 line
ceph::buffer::list*)+0x17b) [
0x7f615765069b]This Mutex assertion usually triggers in use-after-free cases where the pthread mutex id is invalid (because it has been deallocated). My guess is that your IoCtx has been freed, or the
shutdown()method has been called on the cluster handle... is that possible? (Obviously not with the code fragment above, but I'm guess that isn't a straight copy+paste from your code?)sage
Thanks Sage for your input. I would look into the code to figure out if they are any calls to
IoCtx::close()orRados::shutdown(). However, on closer inspection I find lot ofpthread_create()failing (refer log below) with error 11 (EAGAIN) indicating "insufficient resources to create another thread, or a system-imposed limit on the number of threads was encountered". Could Mutex assertion failure be a side effect of this?
-------------------------------Thread::try_create():pthread_createfailed with error 11 common/Thread.cc: In function 'voidThread::create(size_t)' thread7f615f275700time 2014-04-04 08:57:03.511877
common/Thread.cc: 110: FAILED assert(ret == 0)
ceph version 0.67.4 (ad85b8bfafea6232d64cb7ba76a8b6e8252fa0c7) 1: (()+0x36004f) [0x7f615783804f]
2: (SimpleMessenger::connect_rank(entity_addr_t const&, int, Connection*,
Message*)+0x17b) [0x7f61577c9b9b]
3: (SimpleMessenger::get_connection(entity_inst_t const&)+0x244)
[0x7f61577ce824]
4: (Objecter::get_session(int)+0x1d1) [0x7f615765b391]
Quoted 8 lines
5: (Objecter::recalc_op_target(Objecter::Op*)+0x336) [
0x7f615765c0d6] 6: (Objecter::_op_submit(Objecter::Op*)+0x43) [0x7f6157665993] 7: (librados::IoCtxImpl::operate_read(object_t const&, ObjectOperation*,
ceph::buffer::list*)+0x2dc) [0x7f61576507fc]
8: (librados::IoCtxImpl::stat(object_t const&, unsigned long*,
long*)+0x185) [0x7f6157653b05]
9: (librados::IoCtx::stat(std::string const&, unsigned long*, long*)+0x58)
[0x7f6157628498]
Hmm, perhaps it's related. It sounds like you need to increase the ulimit on number of open files (ulimit -n) as we create many threads and sockets to communicate with the cluster.
sage