Bug #68683
closedcrash: virtual ceph::common::RefCountedObject::~RefCountedObject(): ceph_assert(nref == 0)
0%
Description
/a/skanta-2024-09-25_00:14:38-rados-wip-bharath4-testing-2024-09-24-1154-distro-default-smithi/7919056/
Teuthology marks this as a DEAD job, but the logs in mgr.x.log shows that there is a crash.
-3> 2024-09-25T06:20:04.601+0000 7fb4e62b2640 10 -- [v2:127.0.0.1:6800/1060193505,v1:127.0.0.1:6801/1060193505] >> 127.0.0.1:0/468411532 conn(0x55cc46805400 msgr2=0x55cc46a84580 crc :-1 s=STATE_CONNECTION_ESTABLISHED l=1)._try_send sent bytes 2671 remaining bytes 0
-2> 2024-09-25T06:20:04.601+0000 7fb4e62b2640 10 --2- [v2:127.0.0.1:6800/1060193505,v1:127.0.0.1:6801/1060193505] >> 127.0.0.1:0/468411532 conn(0x55cc46805400 0x55cc46a84580 crc :-1 s=READY pgs=2 cs=0 l=1 rev1=1 crypto rx=0 tx=0 comp rx=0 tx=0).write_message sending 0x
55cc465adba0 done.
-1> 2024-09-25T06:20:04.601+0000 7fb484efa640 -1 /home/jenkins-build/build/workspace/ceph-dev-new-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos9/DIST/centos9/MACHINE_SIZE/gigantic/release/19.3.0-5148-g63255792/rpm/el9/BUILD/ceph-19.3.0-5148-g63255792/sr
c/common/RefCountedObj.cc: In function 'virtual ceph::common::RefCountedObject::~RefCountedObject()' thread 7fb484efa640 time 2024-09-25T06:20:04.602403+0000
/home/jenkins-build/build/workspace/ceph-dev-new-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos9/DIST/centos9/MACHINE_SIZE/gigantic/release/19.3.0-5148-g63255792/rpm/el9/BUILD/ceph-19.3.0-5148-g63255792/src/common/RefCountedObj.cc: 14: FAILED ceph_assert(nre
f == 0)
ceph version 19.3.0-5148-g63255792 (6325579215aff7b11aac72aff6990e59906e826a) squid (dev)
1: (ceph::__ceph_assert_fail(char const*, char const*, int, char const*)+0x12e) [0x7fb4e7f8c76a]
2: /usr/lib64/ceph/libceph-common.so.2(+0x18c928) [0x7fb4e7f8c928]
3: /usr/lib64/ceph/libceph-common.so.2(+0x288c49) [0x7fb4e8088c49]
4: /usr/lib64/ceph/libceph-common.so.2(+0x3f285b) [0x7fb4e81f285b]
5: (ceph::common::RefCountedObject::put() const+0x1b2) [0x7fb4e808ab72]
6: ceph-mgr(+0x19f444) [0x55cc3a7ff444]
7: (OpHistoryServiceThread::entry()+0x124) [0x55cc3a869764]
8: /lib64/libc.so.6(+0x89c52) [0x7fb4e7689c52]
9: /lib64/libc.so.6(+0x10ec80) [0x7fb4e770ec80]
0> 2024-09-25T06:20:04.602+0000 7fb484efa640 -1 *** Caught signal (Aborted) **
in thread 7fb484efa640 thread_name:OpHistorySvc
ceph version 19.3.0-5148-g63255792 (6325579215aff7b11aac72aff6990e59906e826a) squid (dev)
1: /lib64/libc.so.6(+0x3e6f0) [0x7fb4e763e6f0]
2: /lib64/libc.so.6(+0x8b99c) [0x7fb4e768b99c]
3: raise()
4: abort()
5: (ceph::__ceph_assert_fail(char const*, char const*, int, char const*)+0x188) [0x7fb4e7f8c7c4]
6: /usr/lib64/ceph/libceph-common.so.2(+0x18c928) [0x7fb4e7f8c928]
7: /usr/lib64/ceph/libceph-common.so.2(+0x288c49) [0x7fb4e8088c49]
8: /usr/lib64/ceph/libceph-common.so.2(+0x3f285b) [0x7fb4e81f285b]
9: (ceph::common::RefCountedObject::put() const+0x1b2) [0x7fb4e808ab72]
10: ceph-mgr(+0x19f444) [0x55cc3a7ff444]
11: (OpHistoryServiceThread::entry()+0x124) [0x55cc3a869764]
12: /lib64/libc.so.6(+0x89c52) [0x7fb4e7689c52]
13: /lib64/libc.so.6(+0x10ec80) [0x7fb4e770ec80]
NOTE: a copy of the executable, or `objdump -rdS <executable>` is needed to interpret this.
I could not get a sanitized trace using the ceph-debug-docker.sh because the image that was built for this failed job is no longer available.
This also looks similar to https://tracker.ceph.com/issues/60608
RZ Updated by Radoslaw Zarzynski about 2 years ago
- Assignee set to Prashant D
@Prashant D: would you mind taking a look?
AM Updated by Aishwarya Mathuria over 1 year ago
/a//skanta-2025-04-23_06:37:41-rados-wip-bharath3-testing-2025-04-22-1320-distro-default-smithi/8255180
-15> 2025-04-23T08:04:25.554+0000 7f7258ca4640 -1 ./src/common/RefCountedObj.cc: In function 'virtual ceph::common::RefCountedObject::~RefCountedObject()' thread 7f7258ca4640 time 2025-04-23T08:04:25.558695+0000 ./src/common/RefCountedObj.cc: 14: FAILED ceph_assert(nref == 0) ceph version 20.0.0-1540-g48ca0aae (48ca0aae680874ce871665f6a22e2a1a9a1f8316) tentacle (dev) 1: (ceph::__ceph_assert_fail(char const*, char const*, int, char const*)+0x121) [0x7f72b7c7f3ef] 2: /usr/lib/ceph/libceph-common.so.2(+0x1850d2) [0x7f72b7c7b0d2] 3: /usr/lib/ceph/libceph-common.so.2(+0x3ea4cb) [0x7f72b7ee04cb] 4: (ceph::common::RefCountedObject::put() const+0x117) [0x7f72b7d7df97] 5: ceph-mgr(+0x132124) [0x562bf8977124] 6: (OpHistoryServiceThread::entry()+0x124) [0x562bf89db614] 7: /lib/x86_64-linux-gnu/libc.so.6(+0x94b43) [0x7f72b7716b43] 8: /lib/x86_64-linux-gnu/libc.so.6(+0x126a00) [0x7f72b77a8a00]
RZ Updated by Radoslaw Zarzynski over 1 year ago
scrub note: bump up, pinging @Prashant D.
PD Updated by Prashant D over 1 year ago
Hi,
We are aware of this issue and working on fixing it. Currently, I am analyzing a coredump generated on a local reproducer setup.
Meanwhile kindly disable mgr op tracking to avoid this mgr crash :
$ ceph config set mgr mgr_enable_op_tracker false
RZ Updated by Radoslaw Zarzynski over 1 year ago
Bump up.
LF Updated by Laura Flores over 1 year ago
@Prashant D any updates on this?
PD Updated by Prashant D over 1 year ago ยท Edited
Hi Laura,
I am able to reproduce this issue locally and found out that we are into possible use-after-free or double-free bug here.
(gdb) bt
#0 0x00007f900a147a6c in __pthread_kill_implementation () from /lib64/libc.so.6
#1 0x00007f900a0fa686 in raise () from /lib64/libc.so.6
#2 0x000055a1b2b9f492 in reraise_fatal (signum=6) at /usr/src/debug/ceph-19.2.0-98.el9cp.x86_64/src/global/signal_handler.cc:88
#3 handle_oneshot_fatal_signal (signum=6) at /usr/src/debug/ceph-19.2.0-98.el9cp.x86_64/src/global/signal_handler.cc:367
#4 <signal handler called>
#5 0x00007f900a147a6c in __pthread_kill_implementation () from /lib64/libc.so.6
#6 0x00007f900a0fa686 in raise () from /lib64/libc.so.6
#7 0x00007f900a0e4833 in abort () from /lib64/libc.so.6
#8 0x00007f900a766d0a in ceph::__ceph_assert_fail (assertion=<optimized out>, file=<optimized out>, line=<optimized out>, func=<optimized out>) at /usr/src/debug/ceph-19.2.0-98.el9cp.x86_64/src/common/assert.cc:74
#9 0x00007f900a766e6f in ceph::__ceph_assert_fail (ctx=...) at /usr/src/debug/ceph-19.2.0-98.el9cp.x86_64/src/common/assert.cc:79
#10 0x00007f900a85f579 in ceph::common::RefCountedObject::~RefCountedObject (this=<optimized out>, this=<optimized out>) at /usr/src/debug/ceph-19.2.0-98.el9cp.x86_64/src/common/RefCountedObj.cc:14
#11 0x00007f900a9cff9b in MMgrCommand::~MMgrCommand (this=<optimized out>, this=<optimized out>) at /usr/src/debug/ceph-19.2.0-98.el9cp.x86_64/src/messages/MMgrCommand.h:22
#12 MMgrCommand::~MMgrCommand (this=<optimized out>, this=<optimized out>) at /usr/src/debug/ceph-19.2.0-98.el9cp.x86_64/src/messages/MMgrCommand.h:22
#13 0x00007f900a862008 in ceph::common::RefCountedObject::put (this=0x55a1bf42e4e0) at /usr/src/debug/ceph-19.2.0-98.el9cp.x86_64/src/common/RefCountedObj.cc:28
#14 0x000055a1b2a1bcb4 in ceph::common::intrusive_ptr_release (p=<optimized out>) at /usr/src/debug/ceph-19.2.0-98.el9cp.x86_64/src/common/RefCountedObj.h:195
#15 boost::intrusive_ptr<Message>::~intrusive_ptr (this=<optimized out>, this=<optimized out>) at /usr/src/debug/ceph-19.2.0-98.el9cp.x86_64/redhat-linux-build/boost/include/boost/smart_ptr/intrusive_ptr.hpp:100
#16 MgrOpRequest::~MgrOpRequest (this=<optimized out>, this=<optimized out>) at /usr/src/debug/ceph-19.2.0-98.el9cp.x86_64/src/mgr/MgrOpRequest.h:53
#17 MgrOpRequest::~MgrOpRequest (this=<optimized out>, this=<optimized out>) at /usr/src/debug/ceph-19.2.0-98.el9cp.x86_64/src/mgr/MgrOpRequest.h:53
#18 TrackedOp::put (this=0x55a1bf44de40) at /usr/src/debug/ceph-19.2.0-98.el9cp.x86_64/src/common/TrackedOp.h:358
#19 0x000055a1b2a84054 in intrusive_ptr_release (o=<optimized out>, o=<optimized out>) at /usr/src/debug/ceph-19.2.0-98.el9cp.x86_64/src/common/TrackedOp.h:442
#20 boost::intrusive_ptr<TrackedOp>::~intrusive_ptr (this=<optimized out>, this=<optimized out>) at /usr/src/debug/ceph-19.2.0-98.el9cp.x86_64/redhat-linux-build/boost/include/boost/smart_ptr/intrusive_ptr.hpp:100
#21 std::pair<utime_t, boost::intrusive_ptr<TrackedOp> >::~pair (this=<optimized out>, this=<optimized out>) at /usr/include/c++/11/bits/stl_pair.h:211
#22 OpHistoryServiceThread::entry (this=0x55a1b5953768) at /usr/src/debug/ceph-19.2.0-98.el9cp.x86_64/src/common/TrackedOp.cc:66
#23 0x00007f900a145d22 in start_thread () from /lib64/libc.so.6
#24 0x00007f900a1cad40 in clone3 () from /lib64/libc.so.6
(gdb) f 16
#16 MgrOpRequest::~MgrOpRequest (this=<optimized out>, this=<optimized out>) at /usr/src/debug/ceph-19.2.0-98.el9cp.x86_64/src/mgr/MgrOpRequest.h:53
53 }
(gdb) l
48 bool filter_out(const std::set<std::string>& filters) override;
49
50 public:
51 ~MgrOpRequest() override {
52 request->put();
53 }
54
55 template<class T>
56 const T* get_req() const { return static_cast<const T*>(request); }
57
(gdb) f 10
#10 0x00007f900a85f579 in ceph::common::RefCountedObject::~RefCountedObject (this=<optimized out>, this=<optimized out>) at /usr/src/debug/ceph-19.2.0-98.el9cp.x86_64/src/common/RefCountedObj.cc:14
14 ceph_assert(nref == 0);
This is reproducible on main branch as well. Kindly allow me sometime to open a PR for it.
PD Updated by Prashant D over 1 year ago
- Status changed from New to Fix Under Review
- Pull request ID set to 63989
PD Updated by Patrick Donnelly over 1 year ago
- Status changed from Fix Under Review to Duplicate
PD Updated by Patrick Donnelly over 1 year ago
- Is duplicate of Bug #70618: mgr: fix use-after-free issue with MgrOpRequest added
SA Updated by Shraddha Agrawal over 1 year ago
/a/skanta-2025-06-26_23:33:10-rados-wip-bharath6-testing-2025-06-26-1840-tentacle-distro-default-smithi/8352316
UB Updated by Upkeep Bot 3 months ago
- Pull request ID deleted (
63989) - Upkeep Timestamp set to 2026-08-29T14:17:13+00:00