Bug #66818
closedSegmentation fault in DumpMetricsHook caused by ceph daemon -c /ceph/build/ceph.conf ${oid} dump_metrics
0%
Description
Hit when running performance tests as described in ticket https://tracker.ceph.com/issues/66525
Recreate:¶
- Create a cluster with 3 OSD and two reactors, eg:
# MDS=0 MON=1 OSD=3 MGR=1 ../src/vstart.sh --new -x --localhost --without-dashboard --bluestore --redirect-output --bluestore-devs /dev/sdd,/dev/sde,/dev/sdf --crimson --crimson-smp 2 --crimson_seastar_num_threads 2 --no-restart # Crimson 3osd 2 reactor
- Create a single RBD image, launch the run_fio.sh script, which executes
ceph daemon -c /ceph/build/ceph.conf ${oid} dump_metricsat the end of each workload.# RBD_NAME=fio_test_0 RBD_SIZE="10G" fio /fio/examples/rbd_prefill.fio && rbd du fio_test_0 && /root/bin/run_fio.sh -s -a -c "0-31" -p crimson_3osd_2reactor
Sigsegv:¶
- osd.2.stdout:
INFO 2024-07-03 09:14:38,524 [shard 0:main] osd - get_early_config: set --thread-affinity 1 --cpuset 4-5 DEBUG 2024-07-03 09:14:38,524 [shard 0:main] seastar - reactor::drain INFO 2024-07-03 09:14:38,855 seastar - Reactor backend: linux-aio Segmentation fault on shard 1. Backtrace: 0# crimson::admin::DumpMetricsHook::call(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > > > > > const&, std::basic_string_view<char, std::char_traits<char> >, ceph::buffer::v15_2_0::list&&) const::{lambda(auto:1&)#1}::operator()<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const::{lambda()#1}::operator()() const at /usr/include/c++/11/bits/basic_string.h:921 1# seastar::smp_message_queue::async_work_item<crimson::reactor_map_seq<crimson::admin::DumpMetricsHook::call(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > > > > > const&, std::basic_string_view<char, std::char_traits<char> >, ceph::buffer::v15_2_0::list&&) const::{lambda(auto:1&)#1}::operator()<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const::{lambda()#1}>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)::{lambda(auto:1)#1}::operator()<unsigned int>(unsigned int)::{lambda()#1}>::run_and_dispose() at /ceph/src/seastar/include/seastar/core/future.hh:1102 2# seastar::reactor::run_tasks(seastar::reactor::task_queue&) at /ceph/src/seastar/src/core/reactor.cc:2692 3# seastar::reactor::run_some_tasks() at /ceph/src/seastar/src/core/reactor.cc:3155 4# seastar::reactor::do_run() at /ceph/src/seastar/src/core/reactor.cc:3324 5# std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_data() const at /usr/include/c++/11/bits/basic_string.h:195 6# seastar::posix_thread::start_routine(void*) at /ceph/src/seastar/src/core/posix.cc:92 7# 0x00007FB766A06912 in /lib64/libc.so.6 8# 0x00007FB7669A4450 in /lib64/libc.so.6 Dump of siginfo: si_signo: 11 si_errno: 0
- osd.1.stdout:
INFO 2024-07-03 09:14:34,731 [shard 0:main] osd - get_early_config: set --thread-affinity 1 --cpuset 2-3 DEBUG 2024-07-03 09:14:34,731 [shard 0:main] seastar - reactor::drain INFO 2024-07-03 09:14:35,100 seastar - Reactor backend: linux-aio Segmentation fault on shard 1. Backtrace: Reactor stalled for 54 ms on shard 1. Backtrace: 0x2a0a98a 0x29c74d0 0x29c7a16 0x29c7bf7 0x54daf 0x11aa76 0x11a899 0x1a7a41d 0x1a7aca5 0x1a7b799 0x1a77c10 0x1a77cef 0x1a78a7a 0x54daf 0x1777a4c 0x1777b56 0x29c36ef 0x29c3a40 0x29fb4f5 0x29fc2b6 0x2b807dd 0xa1911 0x3f44f kernel callstack: 0xffffffffffffff80 0xffffffffa651c48c 0xffffffffa651c9e2 0xffffffffa652335d 0xffffffffa65236f7 0xffffffffa62f41b3 0xffffffffa62f4351 0xffffffffa62f5690 0xffffffffa62f6337 0xffffffffa62f67a0 0xffffffffa6d2515c 0xffffffffa6e0009b Reactor stalled for 1958 ms on shard 1. Backtrace: 0x2a0a98a 0x29c74d0 0x29c7a16 0x29c7bf7 0x54daf 0x11aa76 0x11a899 0x1a7a41d 0x1a7a63e 0x1a7aaf1 0x1a7b799 0x1a77c10 0x1a77cef 0x1a78a7a 0x54daf 0x1777a4c 0x1777b56 0x29c36ef 0x29c3a40 0x29fb4f5 0x29fc2b6 0x2b807dd 0xa1911 0x3f44f kernel callstack: 0xffffffffffffff80 0xffffffffa651c2ea 0xffffffffa651c9e2 0xffffffffa652335d 0xffffffffa65236f7 0xffffffffa62f41b3 0xffffffffa62f4351 0xffffffffa62f5690 0xffffffffa62f6337 0xffffffffa62f67a0 0xffffffffa6d2515c 0xffffffffa6e0009b Reactor stalled for 5306 ms on shard 1. Backtrace: 0x2a0a98a 0x29c74d0 0x29c7a16 0x29c7bf7 0x54daf 0x11aa76 0x11a899 0x1a7a41d 0x1a7aca5 0x1a7b799 0x1a77c10 0x1a77cef 0x1a78a7a 0x54daf 0x1777a4c 0x1777b56 0x29c36ef 0x29c3a40 0x29fb4f5 0x29fc2b6 0x2b807dd 0xa1911 0x3f44f kernel callstack: 0xffffffffffffff80 0xffffffffa67c1307 0xffffffffa6543cd6 0xffffffffa65476fe 0xffffffffa6548726 0xffffffffa627e045 0xffffffffa651b8a7 0xffffffffa651cb6a 0xffffffffa652335d 0xffffffffa65236f7 0xffffffffa62f41b3 0xffffffffa62f4351 0xffffffffa62f5690 0xffffffffa62f6337 0xffffffffa62f67a0 0xffffffffa6d2515c 0xffffffffa6e0009b Reactor stalled for 10887 ms on shard 1. Backtrace: 0x2a0a98a 0x29c74d0 0x29c7a16 0x29c7bf7 0x54daf 0x11aa76 0x11a899 0x1a7a41d 0x1a7a63e 0x1a7aaf1 0x1a7b799 0x1a77c10 0x1a77cef 0x1a78a7a 0x54daf 0x1777a4c 0x1777b56 0x29c36ef 0x29c3a40 0x29fb4f5 0x29fc2b6 0x2b807dd 0xa1911 0x3f44f kernel callstack: 0xffffffffffffff80 0xffffffffa651c9ce 0xffffffffa652335d 0xffffffffa65236f7 0xffffffffa62f41b3 0xffffffffa62f4351 0xffffffffa62f5690 0xffffffffa62f6337 0xffffffffa62f67a0 0xffffffffa6d2515c 0xffffffffa6e0009b 0# crimson::admin::DumpMetricsHook::call(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > > > > > const&, std::basic_string_view<char, std::char_traits<char> >, ceph::buffer::v15_2_0::list&&) const::{lambda(auto:1&)#1}::operator()<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const::{lambda()#1}::operator()() const at /ceph/src/crimson/admin/osd_admin.cc:243 1# seastar::smp_message_queue::async_work_item<crimson::reactor_map_seq<crimson::admin::DumpMetricsHook::call(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > > > > > const&, std::basic_string_view<char, std::char_traits<char> >, ceph::buffer::v15_2_0::list&&) const::{lambda(auto:1&)#1}::operator()<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const::{lambda()#1}>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)::{lambda(auto:1)#1}::operator()<unsigned int>(unsigned int)::{lambda()#1}>::run_and_dispose() at /ceph/src/seastar/include/seastar/core/future.hh:1102 2# seastar::reactor::run_tasks(seastar::reactor::task_queue&) at /ceph/src/seastar/src/core/reactor.cc:2692 3# seastar::reactor::run_some_tasks() at /ceph/src/seastar/src/core/reactor.cc:3155 4# seastar::reactor::do_run() at /ceph/src/seastar/src/core/reactor.cc:3324 5# std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_data() const at /usr/include/c++/11/bits/basic_string.h:195 6# seastar::posix_thread::start_routine(void*) at /ceph/src/seastar/src/core/posix.cc:92 7# 0x00007FC368C43912 in /lib64/libc.so.6 8# 0x00007FC368BE1450 in /lib64/libc.so.6 Dump of siginfo: si_signo: 11 si_errno: 0 si_code: 1 si_pid: 80 : /ceph/src/ceph-run: line 27: 476766 Segmentation fault (core dumped) "$@"
Work around:¶
do not run ceph daemon -c /ceph/build/ceph.conf ${oid} dump_metrics
Files
JP Updated by Jose J Palacios Perez over 2 years ago
Update: probably the correct way is to use ceph tell osd.X dump_metrics, I'll modify the test script. This might not be a genuine defect, apologies.
JP Updated by Jose J Palacios Perez over 2 years ago
I just managed to recreate the issue with the appropriate ceph tell osd.X dump_metrics:
== Monitoring OSD osd.2: 509166 ==
== Monitoring OSD osd.1: 507949 ==
== Monitoring OSD osd.0: 506731 ==
Error ENXIO: osd down6)]
:
Couldn't create thread/CPU maps: No such process
== Monitoring OSD osd.2: 509166 ==
== Monitoring OSD osd.1: 507949 ==
== Monitoring OSD osd.0: 506731 ==
Error ENXIO: problem getting command descriptions from osd.2
:
Error ENXIO: problem getting command descriptions from osd.2
* Looking at the osd.2.stdout: sigsegv:EBUG 2024-07-04 12:52:34,593 [shard 0:main] ms - ~SocketMessenger: temp_mon_client
INFO 2024-07-04 12:52:34,593 [shard 0:main] osd - get_early_config: set --thread-affinity 1 --cpuset 4-5
DEBUG 2024-07-04 12:52:34,593 [shard 0:main] seastar - reactor::drain
INFO 2024-07-04 12:52:34,934 seastar - Reactor backend: linux-aio
Segmentation fault on shard 1.
Backtrace:
0# crimson::admin::DumpMetricsHook::call(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > > > > > const&, std::basic_string_view<char, std::char_traits<char> >, ceph::buffer::v15_2_0::list&&) const::{lambda(auto:1&)#1}::operator()<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const::{lambda()#1}::operator()() const at /usr/include/c++/11/bits/basic_string.h:921
1# seastar::smp_message_queue::async_work_item<crimson::reactor_map_seq<crimson::admin::DumpMetricsHook::call(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > > > > > const&, std::basic_string_view<char, std::char_traits<char> >, ceph::buffer::v15_2_0::list&&) const::{lambda(auto:1&)#1}::operator()<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const::{lambda()#1}>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)::{lambda(auto:1)#1}::operator()<unsigned int>(unsigned int)::{lambda()#1}>::run_and_dispose() at /ceph/src/seastar/include/seastar/core/future.hh:1102
2# seastar::reactor::run_tasks(seastar::reactor::task_queue&) at /ceph/src/seastar/src/core/reactor.cc:2692
3# seastar::reactor::run_some_tasks() at /ceph/src/seastar/src/core/reactor.cc:3155
4# seastar::reactor::do_run() at /ceph/src/seastar/src/core/reactor.cc:3324
5# std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_data() const at /usr/include/c++/11/bits/basic_string.h:195
6# seastar::posix_thread::start_routine(void*) at /ceph/src/seastar/src/core/posix.cc:92
7# 0x00007F2407878912 in /lib64/libc.so.6
8# 0x00007F2407816450 in /lib64/libc.so.6
Dump of siginfo:
si_signo: 11
si_errno: 0
si_code: 1
* then later another OSD goes down:[13:20:42]$ # pgrep osd
507949
# osd.0.stdout:
NFO 2024-07-04 12:52:26,945 [shard 0:main] osd - get_early_config: set --thread-affinity 1 --cpuset 0-1
DEBUG 2024-07-04 12:52:26,945 [shard 0:main] seastar - reactor::drain
INFO 2024-07-04 12:52:27,355 seastar - Reactor backend: linux-aio
Segmentation fault on shard 1.
Backtrace:
0# crimson::admin::DumpMetricsHook::call(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx
11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > >, std::less
<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_st
ring<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > > > > > const&, std::bas
ic_string_view<char, std::char_traits<char> >, ceph::buffer::v15_2_0::list&&) const::{lambda(auto:1&)#1}::operator()<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator
<char> >&) const::{lambda()#1}::operator()() const at /usr/include/c++/11/bits/basic_string.h:921
1# seastar::smp_message_queue::async_work_item<crimson::reactor_map_seq<crimson::admin::DumpMetricsHook::call(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char
>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocat
or<long> >, std::vector<double, std::allocator<double> > >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allo
cator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >,
std::vector<double, std::allocator<double> > > > > > const&, std::basic_string_view<char, std::char_traits<char> >, ceph::buffer::v15_2_0::list&&) const::{lambda(auto:1&)#1}::operator()<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(st
d::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const::{lambda()#1}>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)::{lambda(auto:1)#1}::operator()<unsigned int>(unsigned int)::{lambda()#1}>::run_and_di
spose() at /ceph/src/seastar/include/seastar/core/future.hh:1102
2# seastar::reactor::run_tasks(seastar::reactor::task_queue&) at /ceph/src/seastar/src/core/reactor.cc:2692
3# seastar::reactor::run_some_tasks() at /ceph/src/seastar/src/core/reactor.cc:3155
4# seastar::reactor::do_run() at /ceph/src/seastar/src/core/reactor.cc:3324
5# std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_data() const at /usr/include/c++/11/bits/basic_string.h:195
6# seastar::posix_thread::start_routine(void*) at /ceph/src/seastar/src/core/posix.cc:92
7# 0x00007F78B409A912 in /lib64/libc.so.6
8# 0x00007F78B4038450 in /lib64/libc.so.6
Dump of siginfo:
si_signo: 11
si_errno: 0
This has been working fine for several runs, so I might need to run the tests with the osd dump_metrics disabled to complete the set of runs.
Since it can be recreated, will keep this open to continue investigating.
JP Updated by Jose J Palacios Perez over 2 years ago
This is the last stack frame where the SIGSEGV happened, slightly formatted for readability:
typedef boost::variant<std::string,
bool,
int64_t,
double,
std::vector<std::string>,
std::vector<int64_t>,
std::vector<double>> cmd_vartype;
typedef std::map<
std::string,
cmd_vartype,
std::less<>> cmdmap_t;
0# crimson::admin::DumpMetricsHook::call
(
std::map<
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,
boost::variant<
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,
bool, long, double, std::vector<
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,
std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >
>,
std::vector<long, std::allocator<long> >,
std::vector<double, std::allocator<double> >
>,
std::less<void>,
std::allocator<
std::pair<
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const,
boost::variant<
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,
bool, long, double,
std::vector<
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,
std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >
>,
std::vector<long, std::allocator<long> >,
std::vector<double, std::allocator<double> >
>
>
>
>
const&, // const cmdmap_t&
std::basic_string_view<char, std::char_traits<char> >, ceph::buffer::v15_2_0::list&&
) /* end call*/
now the question is to figure out which could've been null and cause the SIGSEGV...
JP Updated by Jose J Palacios Perez over 2 years ago
- Assignee set to Jose J Palacios Perez
I will try to instrument the code to check for the arguments to the function that SIGSEGV, one frame before, possibly will be able to identify whether there is a use after free bug.
JP Updated by Jose J Palacios Perez over 1 year ago
I have been hitting this continuously when running the test scripts with the OSD performance monitoring enabled, it shows the signs of a race condition.
- Here is the process table after the SIGSEGV happenend: notice the two instances of python3.9 that serve the ceph tell CLI (separated by 10 mins):
USER PID PPID %CPU ELAPSED TTY TIME COMMAND
root 1 0 0.000 1974h54m16.988758327s pts/0 6s /bin/bash
root 2695586 1 0.000 2h27m27.989068166s pts/0 0s /usr/bin/coreutils --coreutils-prog-shebang=tee /usr/bin/tee
root 2696993 1 8.712 2h21m45.989207062s pts/0 12m21s fio /root/bin/rbd_fio_examples/rbd_mj_seqread.fio --output=fio_sea_1osd_56reactor_32fio_bal_osd_rc_1job_16io_64k_seqread_p0.json --output-format=json
root 2697783 1 0.000 2h20m55.989339454s pts/0 0s /usr/bin/python3.9 /ceph/build/bin/ceph tell osd.0 dump_metrics reactor_utilization
root 2704929 1 0.000 30m39.989472184s pts/0 0s bash /root/bin/run_balanced_osd.sh -p -j -b bal_osd -t sea -d /tmp/_d0a142a1e15/1osd_56reactor_28fio_sea_rc
root 2709118 2704929 0.000 22m42.989606581s pts/0 0s /usr/bin/coreutils --coreutils-prog-shebang=tee /usr/bin/tee
root 2710551 1 137.060 16m59.989744008s pts/0 23m18s fio /root/bin/rbd_fio_examples/rbd_mj_seqread.fio --output=fio_sea_1osd_56reactor_32fio_bal_osd_rc_1job_16io_64k_seqread_p0.json --output-format=json
root 2711579 1 0.000 15m22.989864383s pts/0 0s /usr/bin/python3.9 /ceph/build/bin/ceph tell osd.0 dump_metrics reactor_utilization
- This is the log with the options used to create the cluster, the execution of FIO, and the point where the OSD is no longer found (pgrep):
MDS=0 MON=1 OSD=1 MGR=1 taskset -ac '0-27,56-83' /ceph/src/vstart.sh --new -x --localhost --without-dashboard --redirect-output --seastore --seastore-devs /dev/nvme9n1p2,/dev/nvme8n1p2 --osd-args "--seastore_max_concurrent_transactions=128 --seastore_cache_lru_size=2G" --crimson --crimson-balance-cpu osd --crimson-smp 56 --no-restart
ip 127.0.0.1
port 40000
:
/ceph/build/bin/crimson-osd --seastore_max_concurrent_transactions=128 --seastore_cache_lru_size=2G -i 0 -c /ceph/build/ceph.conf --mkfs --key AQBEbTdo7xsBERAAw67ETh/OgabYtaHb0YZgUg== --osd-uuid 2e4b1092-acc6-48dc-8b35-d82ed2af6bce
INFO 2025-05-28 20:08:36,801 seastar - Reactor backend: linux-aio:
:
INFO 2025-05-28 20:08:36,840 [shard 0:main] osd - get_early_config: set --thread-affinity 1 --cpuset 0-27,56-83
DEBUG 2025-05-28 20:08:36,840 [shard 0:main] seastar - reactor::drain
INFO 2025-05-28 20:08:36,946 seastar - Reactor backend: linux-aio
start osd.0
osd 0 /ceph/build/bin/crimson-osd --seastore_max_concurrent_transactions=128 --seastore_cache_lru_size=2G -i 0 -c /ceph/build/ceph.conf
export PYTHONPATH=/ceph/src/pybind:/ceph/build/lib/cython_modules/lib.3:/ceph/src/python-common:$PYTHONPATH
export LD_LIBRARY_PATH=/ceph/build/lib:$LD_LIBRARY_PATH
export PATH=/ceph/build/bin:$PATH
export CEPH_CONF=/ceph/build/ceph.conf
alias cephfs-shell=/ceph/src/tools/cephfs/shell/cephfs-shell
CEPH_DEV=1
2712589
Creating 32 RBD images
NAME PROVISIONED USED
fio_test_0 2 GiB 0 B
Prefilling rbd/fio_test_0
bench type write io_size 65536 io_threads 1 bytes 2147483648 pattern sequential
SEC OPS OPS/SEC BYTES/SEC
1 26182 26182.2 1.6 GiB/s
elapsed: 1 ops: 32768 ops/sec: 26361.2 bytes/sec: 1.6 GiB/s
:
NAME PROVISIONED USED
fio_test_31 2 GiB 2 GiB
cluster:
id: b72cee0a-6e0b-4435-9213-adcf469faa9e
health: HEALTH_WARN
2 pool(s) have no replicas configured
services:
mon: 1 daemons, quorum a (age 108s) [leader: a]
mgr: x(active, since 104s)
osd: 1 osds: 1 up (since 98s), 1 in (since 102s)
data:
pools: 2 pools, 129 pgs
objects: 15.78k objects, 61 GiB
usage: 61 GiB used, 7.0 TiB / 7.1 TiB avail
pgs: 129 active+clean
io:
client: 2.4 MiB/s rd, 1.9 GiB/s wr, 2.96k op/s rd, 2.27k op/s wr
pool 1 '.mgr' replicated size 1 min_size 1 crush_rule 0 object_hash rjenkins pg_num 1 pgp_num 1 autoscale_mode off last_change 9 flags hashpspool,nopgchange,crimson stripe_width 0 pg_num_max 32 pg_num_min 1 application mgr read_balance_score 1.00
pool 2 'rbd' replicated size 1 min_size 1 crush_rule 0 object_hash rjenkins pg_num 128 pgp_num 128 autoscale_mode off last_change 14 flags hashpspool,nopgchange,selfmanaged_snaps,crimson stripe_width 0 application rbd read_balance_score 1.00
POOL_NAME USED OBJECTS CLONES COPIES MISSING_ON_PRIMARY UNFOUND DEGRADED RD_OPS RD WR_OPS WR USED COMPR UNDER COMPR
.mgr 449 KiB 2 0 2 0 0 0 43 37 KiB 57 584 KiB 0 B 0 B
rbd 61 GiB 15779 0 15779 0 0 0 97150 77 MiB 74404 61 GiB 0 B 0 B
total_objects 15781
total_used 61 GiB
total_avail 7.0 TiB
total_space 7.1 TiB
/root/bin/run_fio.sh -s -j -w hockey -r -w sr -c "0-111" -f 28-55,84-111 -p sea_1osd_56reactor_32fio_bal_osd_rc -n -d /tmp/_d0a142a1e15/1osd_56reactor_28fio_sea_rc
/tmp/_d0a142a1e15/1osd_56reactor_28fio_sea_rc /ceph/build
== Attempt 1 for job 1 with io depth 16 ==
== Wed May 28 20:10:24 UTC 2025 == (16,1): sea_1osd_56reactor_32fio_bal_osd_rc_1job_16io_64k_seqread_p0 ==
== Monitoring OSD: 2712589 FIO: 2716035 ==
== Latency std dev too high, failing this attempt ==
== Attempt 1 failed, retrying... ==
== Attempt 2 for job 1 with io depth 16 ==
== Wed May 28 20:16:06 UTC 2025 == (16,1): sea_1osd_56reactor_32fio_bal_osd_rc_1job_16io_64k_seqread_p0 ==
== Monitoring OSD: 2712589 FIO: 2717427 ==
:
== OSD process not running, killing FIO ... ==
^C== INT received, exiting... ==
/root/bin/run_balanced_osd.sh: line 310: kill: (2718428) - No such process
I will try to dilute this into a simpler snippet that can be run manually
MB Updated by Matan Breizman over 1 year ago
- Related to Bug #71457: admin_socket_objecter_requests fails with RelWithDebInfo added
MB Updated by Matan Breizman over 1 year ago
Jose J Palacios Perez wrote in #note-3:
now the question is to figure out which could've been null and cause the SIGSEGV...
Adding logs/assertions could be one way to identify the root cause.
See example for this approach here: https://github.com/ceph/ceph/pull/63523/files
Note: This issue is possibly related to: https://tracker.ceph.com/issues/71457
I will try to dilute this into a simpler snippet that can be run manually
That would be great! Please let me know if you were able to reproduce manually. Thanks!
JP Updated by Jose J Palacios Perez over 1 year ago
Still manage to recreate:
1) Create a cluster with vstart, configure pool, volumes, etc.
2) Launch FIO for a sequential read workload
3) Trigger monitoring to get Reactor performance
4) Sometimes the OSD hits a SIGSEGV.
Details:
1)
MDS=0 MON=1 OSD=1 MGR=1 taskset -ac '0-27,56-83' /ceph/src/vstart.sh --new -x --localhost --without-dashboard --redirect-output --seastore --seastore-devs /dev/nvme9n1p2,/dev/nvme8n1p2 --osd-args "--seastore_max_concurrent_transactions=128 --seastore_cache_lru_size=2G" --crimson --crimson-balance-cpu osd --crimson-smp 56 --no-restart
2) Create 32 RBD images, each of 2 GB size, prefill them so all appear as full:
Prefilling rbd/fio_test_31
bench type write io_size 65536 io_threads 1 bytes 2147483648 pattern sequential
SEC OPS OPS/SEC BYTES/SEC
1 29526 29555.6 1.8 GiB/s
elapsed: 1 ops: 32768 ops/sec: 28971.6 bytes/sec: 1.8 GiB/s
NAME PROVISIONED USED
fio_test_31 2 GiB 2 GiB
cluster:
id: 9c630557-a385-4250-9715-8171bce86ffa
health: HEALTH_WARN
2 pool(s) have no replicas configured
services:
mon: 1 daemons, quorum a (age 108s) [leader: a]
mgr: x(active, since 104s)
osd: 1 osds: 1 up (since 98s), 1 in (since 102s)
data:
pools: 2 pools, 129 pgs
objects: 15.75k objects, 61 GiB
usage: 61 GiB used, 7.0 TiB / 7.1 TiB avail
pgs: 129 active+clean
io:
client: 2.3 MiB/s rd, 1.9 GiB/s wr, 2.94k op/s rd, 2.23k op/s wr
pool 1 '.mgr' replicated size 1 min_size 1 crush_rule 0 object_hash rjenkins pg_num 1 pgp_num 1 autoscale_mode off last_change 9 flags hashpspool,nopgchange,crimson stripe_width 0 pg_num_max 32 pg_num_min 1 application mgr read_balance_score 1.00
pool 2 'rbd' replicated size 1 min_size 1 crush_rule 0 object_hash rjenkins pg_num 128 pgp_num 128 autoscale_mode off last_change 14 flags hashpspool,nopgchange,selfmanaged_snaps,crimson stripe_width 0 application rbd read_balance_score 1.00
POOL_NAME USED OBJECTS CLONES COPIES MISSING_ON_PRIMARY UNFOUND DEGRADED RD_OPS RD WR_OPS WR USED COMPR UNDER COMPR
.mgr 449 KiB 2 0 2 0 0 0 43 37 KiB 57 584 KiB 0 B 0 B
rbd 61 GiB 15746 0 15746 0 0 0 96952 77 MiB 73869 61 GiB 0 B 0 B
total_objects 15748
total_used 61 GiB
total_avail 7.0 TiB
total_space 7.1 TiB
3) Launch FIO, and monitor reactor utilisation:
fio /root/bin/rbd_fio_examples/rbd_mj_seqread.fio --output=fio_sea_1osd_56reactor_32fio_bal_osd_rc_1job_16io_64k_seqread_p0.json --output-format=json
/usr/bin/python3.9 /ceph/build/bin/ceph tell osd.0 dump_metrics reactor_utilization
4)
DEBUG 2025-05-29 14:00:00,810 [shard 0:main] seastar - reactor::drain
INFO 2025-05-29 14:00:00,919 seastar - Reactor backend: linux-aio
Segmentation fault on shard 1.
Backtrace:
0# crimson::admin::DumpMetricsHook::call(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > > > > > const&, std::basic_string_view<char, std::char_traits<char> >, ceph::buffer::v15_2_0::list&&) const::{lambda(auto:1&)#1}::operator()<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const::{lambda()#1}::operator()() const at /opt/rh/gcc-toolset-13/root/usr/include/c++/13/bits/basic_string.h:1072
1# seastar::smp_message_queue::async_work_item<crimson::reactor_map_seq<crimson::admin::DumpMetricsHook::call(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > > > > > const&, std::basic_string_view<char, std::char_traits<char> >, ceph::buffer::v15_2_0::list&&) const::{lambda(auto:1&)#1}::operator()<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const::{lambda()#1}>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)::{lambda(auto:1)#1}::operator()<unsigned int>(unsigned int)::{lambda()#1}>::run_and_dispose() at /ceph/src/seastar/include/seastar/core/future.hh:1082
2# seastar::reactor::run_tasks(seastar::reactor::task_queue&) at /ceph/src/seastar/src/core/reactor.cc:2610
3# seastar::reactor::now() at /ceph/src/seastar/include/seastar/core/reactor.hh:446
4# seastar::reactor::do_run() at /ceph/src/seastar/src/core/reactor.cc:3250
5# std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() at /opt/rh/gcc-toolset-13/root/usr/include/c++/13/bits/basic_string.h:804
6# seastar::posix_thread::start_routine(void*) at /ceph/src/seastar/src/core/posix.cc:92
2746144 pts/0 S 0:00 bash /root/bin/run_fio.sh -s -j -w hockey -r -w sr -c "0-111" -f 28-55,84-111 -p sea_1osd_56reactor_32fio_bal_osd_rc -n -d /tmp/_d0a142a1e15/1osd_56reactor_28fio_sea_rc
2748124 pts/0 Sl 9:43 \_ fio /root/bin/rbd_fio_examples/rbd_mj_seqread.fio --output=fio_sea_1osd_56reactor_32fio_bal_osd_rc_1job_16io_64k_seqread_p0.json --output-format=json
2748858 pts/0 S 0:00 \_ bash /root/bin/run_fio.sh -s -j -w hockey -r -w sr -c "0-111" -f 28-55,84-111 -p sea_1osd_56reactor_32fio_bal_osd_rc -n -d /tmp/_d0a142a1e15/1osd_56reactor_28fio_sea_rc
2748927 pts/0 Sl 0:00 \_ /usr/bin/python3.9 /ceph/build/bin/ceph tell osd.0 dump_metrics reactor_utilization
JP Updated by Jose J Palacios Perez over 1 year ago
|I still don't get a core dump from the OSD process when it hits SIGSEGV: this is the settings within the container:
# cat /proc/sys/kernel/core_pattern
|/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h
@d9754c08030d:~/bin
[09:26:15]$ # ulimit
unlimited
# journalctl
No journal files were found.
-- No entries --
This is the process three within the container: bare basic:
# psf
PID TTY STAT TIME COMMAND
1 pts/0 Ss 0:07 /bin/bash
2784012 pts/0 R+ 0:00 ps ax --forest
What else do I need?
MB Updated by Matan Breizman over 1 year ago
Jose J Palacios Perez wrote in #note-9:
|I still don't get a core dump from the OSD process when it hits SIGSEGV: this is the settings within the container:
[...]
This is the process three within the container: bare basic:
[...]
What else do I need?
Can you please take a look at https://github.com/ceph/ceph/pull/63673? Thanks!
JP Updated by Jose J Palacios Perez over 1 year ago
Not been able to recreate on recent build (hash: 8216229e03c), so probably related to the asok issue that Matan pointed out.
I'll keep an eye open
Thu Jun 12 14:11:55 UTC 2025 Starting watchdog
Thu Jun 12 14:11:55 UTC 2025 Starting FIO...
pool 'rbd' created
enabled application 'rbd' on pool 'rbd'
set pool 2 size to 1
noautoscale is set, all pools now have autoscale off
nodeep-scrub is set
noscrub is set
Thu Jun 12 14:14:42 UTC 2025 FIO 3453385 started
Thu Jun 12 14:14:42 UTC 2025 Waiting for FIO to complete, (watchdog pid 3449876)...
Thu Jun 12 14:31:26 UTC 2025 FIO completed, killing watchdog 3449876...
WARNING: crimson-osd still alive after 1 seconds
WARNING: crimson-osd still alive after 2 seconds
WARNING: crimson-osd still alive after 4 seconds
# sudo podman top ceph-aprg
USER PID PPID %CPU ELAPSED TTY TIME COMMAND
root 1 0 0.000 2329h51m54.028850204s pts/0 8s /bin/bash
root 3449162 1 0.000 30m21.029173169s pts/0 0s bash /root/bin/run_balanced_osd.sh -p -j -b bal_osd -t sea -d /tmp/_8216229e03c/1osd_1reactor_28fio_sea_sigsegv_sr
root 3449382 1 0.000 18m42.029329892s pts/0 0s /bin/sh /ceph/src/ceph-run --no-restart /ceph/build/bin/ceph-mon -i a -c /ceph/build/ceph.conf -f
root 3449384 3449382 0.356 18m42.029479263s pts/0 4s /ceph/build/bin/ceph-mon -i a -c /ceph/build/ceph.conf -f
root 3449522 1 0.000 18m41.029637407s pts/0 0s /bin/sh /ceph/src/ceph-run --no-restart /ceph/build/bin/ceph-mgr -i x -c /ceph/build/ceph.conf -f
root 3449526 3449522 0.446 18m41.029796964s pts/0 5s /ceph/build/bin/ceph-mgr -i x -c /ceph/build/ceph.conf -f
root 3449835 1 0.000 18m34.029983371s pts/0 0s /bin/sh /ceph/src/ceph-run --no-restart /ceph/build/bin/crimson-osd --seastore_max_concurrent_transactions=128 --seastore_cache_lru_size=2G -i 0 -c /ceph/build/ceph.conf -f
root 3449838 3449835 174.950 18m34.030130003s pts/0 32m29s /ceph/build/bin/crimson-osd --seastore_max_concurrent_transactions=128 --seastore_cache_lru_size=2G -i 0 -c /ceph/build/ceph.conf -f
root 3449876 3449162 0.000 18m14.030295333s pts/0 0s bash /root/bin/run_balanced_osd.sh -p -j -b bal_osd -t sea -d /tmp/_8216229e03c/1osd_1reactor_28fio_sea_sigsegv_sr
root 3453385 3449162 0.000 15m26.030456215s pts/0 0s bash /root/bin/run_fio.sh -s -j -w hockey -r -w sr -c "0-111" -f 28-55,84-111 -p sea_1osd_1reactor_32fio_bal_osd_rc -n -d /tmp/_8216229e03c/1osd_1reactor_28fio_sea_sigsegv_sr
root 3457265 3453385 169.595 4m20.030637886s pts/0 7m21s fio /root/bin/rbd_fio_examples/rbd_mj_seqread.fio --output=fio_sea_1osd_1reactor_32fio_bal_osd_rc_1job_16io_64k_seqread_p0.json --output-format=json
root 3459031 3449876 0.000 2.030817856s pts/0 0s /usr/bin/coreutils --coreutils-prog-shebang=sleep /usr/bin/sleep 1
The list of metrics from reactor utilisation look fine, here is a snippet:
6601 06-12-2025 14:31 sea_1osd_1reactor_32fio_bal_osd_rc_1procs_seqread_dump_20250612_141514.json
6600 06-12-2025 14:31 sea_1osd_1reactor_32fio_bal_osd_rc_1procs_seqread_dump_20250612_142046.json
6601 06-12-2025 14:31 sea_1osd_1reactor_32fio_bal_osd_rc_1procs_seqread_dump_20250612_142619.json
"metrics": [
{
"reactor_utilization": {
"shard": "0",
"value": 93.78852763999997
}
},
{
"reactor_utilization": {
"shard": "1",
"value": 100.00000000000013
}
}
]
},
{
"metrics": [
{
"reactor_utilization": {
"shard": "0",
"value": 86.436070479999955
}
},
{
"reactor_utilization": {
"shard": "1",
"value": 100.00000000000013
}
}
]
},
JP Updated by Jose J Palacios Perez over 1 year ago · Edited
I managed to hit it again on a long duration test :-(
INFO 2025-06-12 15:11:49,239 [shard 0:main] osd - Configure option_name crimson_reactor_task_quota_ms with value : 0.500000
INFO 2025-06-12 15:11:49,239 [shard 0:main] osd - Configure option_name crimson_reactor_idle_poll_time_us with value : 200
INFO 2025-06-12 15:11:49,239 [shard 0:main] osd - get_early_config: set --thread-affinity 1 --cpuset 0-27,56-83
DEBUG 2025-06-12 15:11:49,239 [shard 0:main] seastar - reactor::drain
INFO 2025-06-12 15:11:49,390 seastar - Reactor backend: linux-aio
Segmentation fault on shard 1.
Backtrace:
0# crimson::admin::DumpMetricsHook::call(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > > > > > const&, std::basic_string_view<char, std::char_traits<char> >, ceph::buffer::v15_2_0::list&&) const::{lambda(auto:1&)#1}::operator()<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const::{lambda()#1}::operator()() const at /opt/rh/gcc-toolset-13/root/usr/include/c++/13/bits/basic_string.h:1072
1# seastar::smp_message_queue::async_work_item<crimson::reactor_map_seq<crimson::admin::DumpMetricsHook::call(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > > > > > const&, std::basic_string_view<char, std::char_traits<char> >, ceph::buffer::v15_2_0::list&&) const::{lambda(auto:1&)#1}::operator()<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const::{lambda()#1}>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)::{lambda(auto:1)#1}::operator()<unsigned int>(unsigned int)::{lambda()#1}>::run_and_dispose() at /ceph/src/seastar/include/seastar/core/future.hh:1082
2# seastar::reactor::run_tasks(seastar::reactor::task_queue&) at /ceph/src/seastar/src/core/reactor.cc:2609
3# seastar::reactor::now() at /ceph/src/seastar/include/seastar/core/reactor.hh:446
4# seastar::reactor::do_run() at /ceph/src/seastar/src/core/reactor.cc:3249
5# std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() at /opt/rh/gcc-toolset-13/root/usr/include/c++/13/bits/basic_string.h:804
6# seastar::posix_thread::start_routine(void*) at /ceph/src/seastar/src/core/posix.cc:92
7# 0x00007FF559D87002 in /lib64/libc.so.6
8# 0x00007FF559E0C070 in /lib64/libc.so.6
Dump of siginfo:
si_signo: 11
si_errno: 0
si_code: 1
si_pid: 8
si_uid: 0
si_status: 0
si_utime: 0
si_stime: 0
si_int: 0
si_ptr: 0
si_overrun: 0
si_timerid: 8
si_addr: 0x8
/ceph/src/ceph-run: line 27: 3460207 Segmentation fault (core dumped) "$@"
- The test driving script needs improvement though:
Thu Jun 12 17:01:06 UTC 2025== Stopping the cluster... ==
/root/bin/run_balanced_osd.sh: line 335: kill: (3638985) - No such process
Thu Jun 12 17:01:08 UTC 2025== INT received, exiting... ==
Segmentation fault (core dumped)
@d9754c08030d:/ceph/build
[17:01:09]$ # DEBU[8459459] Received a resize event: {Width:267 Height:61}
DEBU[8459459] Sending signal 28 to container d9754c08030d6b7b3090008eb5ea70bab5be245516d1b545894e437f714fa012
- Processes left hung:
# sudo podman top ceph-aprg USER PID PPID %CPU ELAPSED TTY TIME COMMAND root 1 0 0.000 2349h50m46.04392763s pts/0 8s /bin/bash root 3463800 1 1.466 19h15m24.044202633s pts/0 16m56s fio /root/bin/rbd_fio_examples/rbd_mj_randread.fio --output=fio_sea_1osd_56reactor_32fio_bal_osd_rc_1job_1io_4k_randread_p0.json --output-format=json root 3464535 1 0.013 19h14m54.044322854s pts/0 9s /usr/bin/python3.9 /ceph/build/bin/ceph tell osd.0 dump_metrics reactor_utilization
- OSD cores:
# ls -lht /var/lib/systemd/coredump/
total 633M
-rw-r-----. 1 root root 3.1M Jun 12 17:01 core.bash.0.fb62b985edb14266b3de32817af88195.3378404.1749747669000000.zst
-rw-r-----. 1 root root 3.1M Jun 12 17:01 core.bash.0.fb62b985edb14266b3de32817af88195.3558134.1749747668000000.zst
-rw-r-----. 1 root root 2.6M Jun 12 15:14 core.crimson-osd.0.fb62b985edb14266b3de32817af88195.3379255.1749741257000000.zst
-rw-r-----. 1 root root 2.4M Jun 11 10:03 core.crimson-osd.0.fb62b985edb14266b3de32817af88195.3153185.1749636185000000.zst
- Examining the last core:
# gdb -q /ceph/build/bin/crimson-osd core.crimson-osd.0.fb62b985edb14266b3de32817af88195.3379255.1749741257000000
warning: Error reading shared library list entry at 0x696e6e75723a5652
Cannot access memory at address 0x69626f6e6e613a5e
Cannot access memory at address 0x69626f6e6e613a56
Failed to read a valid object file image from memory.
Core was generated by `/ceph/build/bin/crimson-osd --seastore_max_concurrent_transactions=128 --seasto'.
Program terminated with signal SIGSEGV, Segmentation fault.
(gdb) p $_siginfo._sifields._sigfault.si_addr
$1 = (void *) 0x34cc6f
(gdb) handle SIG34 SIG35 SIGUSR1 nostop noprint pass
Signal Stop Print Pass to program Description
SIGUSR1 No No Yes User defined signal 1
SIG34 No No Yes Real-time event 34
SIG35 No No Yes Real-time event 35
(gdb) info line
No line number information available.
(gdb) info s
#0 0x00007ff559d88d4c in ?? ()
Backtrace stopped: Cannot access memory at address 0x60c00034eb50
(gdb) info threads
Id Target Id Frame
* 1 LWP 3460214 0x00007ff559d88d4c in ?? ()
2 LWP 3460207 0x00007ff559e0456d in ?? ()
:
156 LWP 3460225 0x00007ff559e0456d in ?? ()
157 LWP 3460261 0x00007ff559e0456d in ?? ()
158 LWP 3460224 0x00007ff559e0456d in ?? ()
159 LWP 3460223 0x00007ff559e0456d in ?? ()
160 LWP 3460266 0x00007ff559e0456d in ?? ()
161 LWP 3460253 0x00007ff559e0456d in ?? ()
162 LWP 3460220 0x00007ff559e0456d in ?? ()
163 LWP 3460219 0x00007ff559e0456d in ?? ()
164 LWP 3460254 0x00007ff559e0456d in ?? ()
165 LWP 3460231 0x00007ff559e0456d in ?? ()
166 LWP 3460321 0x00007ff559dfae2c in ?? ()
167 LWP 3460372 0x00007ff559d840da in ?? ()
168 LWP 3460265 0x00007ff559e0456d in ?? ()
(gdb)
so it seems this core is corrupted :-(
JP Updated by Jose J Palacios Perez over 1 year ago · Edited
- cherry pick 63673 and try again
- run with --valgrind option -- done, see below
- try recreate somehow to get a readable core (how?)
- try guess at the available stack trace, from frame 0: DumpMetricsHook() called from seastar::smp_message_queue::async_work_item() which of the follow might cause the segmentation fault:
std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > > > > > const&, std::basic_string_view<char, std::char_traits<char> >, ceph::buffer::v15_2_0::list&&) const::{lambda(auto:1&)#1}::operator()<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const::{lambda()#1}::operator()() const at /opt/rh/gcc-toolset-13/root/usr/include/c++/13/bits/basic_string.h:1072
JP Updated by Jose J Palacios Perez over 1 year ago · Edited
Details when instrumented with valgrind:
# sudo podman top ceph-aprg
USER PID PPID %CPU ELAPSED TTY TIME COMMAND
root 1 0 0.000 2351h13m59.747835566s pts/0 8s /bin/bash
root 3639312 1 0.000 6m19.748081177s pts/0 0s bash /root/bin/run_balanced_osd.sh -p -j -b bal_osd -t sea -d /tmp/_8216229e03c/VALGRIND/1osd_56reactor_28fio_sea_rc
root 3639533 1 0.000 16.748226706s pts/0 0s /bin/sh /ceph/src/ceph-run --no-restart /ceph/build/bin/ceph-mon -i a -c /ceph/build/ceph.conf -f
root 3639535 3639533 0.000 16.748356073s pts/0 0s /ceph/build/bin/ceph-mon -i a -c /ceph/build/ceph.conf -f
root 3639673 1 0.000 15.748483476s pts/0 0s /bin/sh /ceph/src/ceph-run --no-restart /ceph/build/bin/ceph-mgr -i x -c /ceph/build/ceph.conf -f
root 3639677 3639673 19.049 15.748616139s pts/0 3s /ceph/build/bin/ceph-mgr -i x -c /ceph/build/ceph.conf -f
root 3640093 1 80.012 8.748741748s pts/0 7s valgrind --tool=memcheck /ceph/build/bin/crimson-osd --seastore_max_concurrent_transactions=128 --seastore_cache_lru_size=2G -i 0 -c /ceph/build/ceph.conf -f
root 3640100 3639312 0.000 7.748866787s pts/0 0s /usr/bin/coreutils --coreutils-prog-shebang=sleep /usr/bin/sleep 20
/ceph/build/bin/ceph -c /ceph/build/ceph.conf -k /ceph/build/keyring osd new 24418b26-baaa-4df0-945c-fc6669db9bd5 -i /ceph/build/dev/osd0/new.json
valgrind --tool=memcheck /ceph/build/bin/crimson-osd --seastore_max_concurrent_transactions=128 --seastore_cache_lru_size=2G -i 0 -c /ceph/build/ceph.conf -f &
==3640093== Memcheck, a memory error detector
==3640093== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==3640093== Using Valgrind-3.24.0 and LibVEX; rerun with -h for copyright info
==3640093== Command: /ceph/build/bin/crimson-osd --seastore_max_concurrent_transactions=128 --seastore_cache_lru_size=2G -i 0 -c /ceph/build/ceph.conf -f
==3640093==
OSDs started
vstart cluster complete. Use stop.sh to stop. See out/* (e.g. 'tail -f out/????') for debug output.
Fri Jun 13 11:52:07 UTC 2025 Sleeping for 20 secs...
==3640093== Syscall param write(buf) points to unaddressable byte(s)
==3640093== at 0x5C8D56D: syscall (syscall.S:38)
==3640093== by 0x5D93941: UnknownInlinedFun (Ginit.c:146)
==3640093== by 0x5D93941: UnknownInlinedFun (Ginit.c:179)
==3640093== by 0x5D93941: mincore_validate (Ginit.c:168)
==3640093== by 0x5D93A57: UnknownInlinedFun (Ginit.c:305)
==3640093== by 0x5D93A57: access_mem (Ginit.c:326)
==3640093== by 0x5D98179: UnknownInlinedFun (libunwind_i.h:202)
==3640093== by 0x5D98179: apply_reg_state (Gparser.c:885)
==3640093== by 0x5D991A1: UnknownInlinedFun (Gparser.c:974)
==3640093== by 0x5D991A1: _ULx86_64_step (Gstep.c:75)
==3640093== by 0x48E470A: GetStackTrace_libunwind(void**, int, int) [clone .part.0] (stacktrace_libunwind-inl.h:120)
==3640093== by 0x48E3C5F: maybe_convert_libunwind_to_generic_fp() (stacktrace.cc:353)
==3640093== by 0x48CA371: UnknownInlinedFun (stacktrace.cc:364)
==3640093== by 0x48CA371: init_default_stack_impl() (stacktrace.cc:385)
==3640093== by 0x48C99E6: _sub_I_65535_0.0 (in /usr/lib64/libtcmalloc.so.4.5.9)
==3640093== by 0x400551D: call_init (dl-init.c:70)
==3640093== by 0x400551D: call_init (dl-init.c:26)
==3640093== by 0x400560B: _dl_init (dl-init.c:117)
==3640093== by 0x401D7F9: ??? (in /usr/lib64/ld-linux-x86-64.so.2)
==3640093== Address 0x1ffefff000 is on thread 1's stack
==3640093== 568 bytes below stack pointer
==3640093==
==3640093== Syscall param write(buf) points to uninitialised byte(s)
==3640093== at 0x5C8D56D: syscall (syscall.S:38)
==3640093== by 0x5D93941: UnknownInlinedFun (Ginit.c:146)
==3640093== by 0x5D93941: UnknownInlinedFun (Ginit.c:179)
==3640093== by 0x5D93941: mincore_validate (Ginit.c:168)
==3640093== by 0x5D93A57: UnknownInlinedFun (Ginit.c:305)
==3640093== by 0x5D93A57: access_mem (Ginit.c:326)
==3640093== by 0x5D98179: UnknownInlinedFun (libunwind_i.h:202)
==3640093== by 0x5D98179: apply_reg_state (Gparser.c:885)
==3640093== by 0x5D991A1: UnknownInlinedFun (Gparser.c:974)
==3640093== by 0x5D991A1: _ULx86_64_step (Gstep.c:75)
==3640093== by 0x48E4755: GetStackTrace_libunwind(void**, int, int) [clone .part.0] (stacktrace_libunwind-inl.h:138)
==3640093== by 0x48E3C5F: maybe_convert_libunwind_to_generic_fp() (stacktrace.cc:353)
==3640093== by 0x48CA371: UnknownInlinedFun (stacktrace.cc:364)
==3640093== by 0x48CA371: init_default_stack_impl() (stacktrace.cc:385)
==3640093== by 0x48C99E6: _sub_I_65535_0.0 (in /usr/lib64/libtcmalloc.so.4.5.9)
==3640093== by 0x400551D: call_init (dl-init.c:70)
==3640093== by 0x400551D: call_init (dl-init.c:26)
==3640093== by 0x400560B: _dl_init (dl-init.c:117)
==3640093== by 0x401D7F9: ??? (in /usr/lib64/ld-linux-x86-64.so.2)
==3640093== Address 0x1fff000000 is on thread 1's stack
==3640093== in frame #8, created by _sub_I_65535_0.0 (???:)
==3640093==
--3640117-- Warning: unhandled io_submit opcode: 5
--3640117-- WARNING: unhandled amd64-linux syscall: 333
--3640117-- You may be able to write your own handler.
--3640117-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--3640117-- Nevertheless we consider this a bug. Please report
--3640117-- it at http://valgrind.org/support/bug_reports.html.
--3640117-- Warning: unhandled io_submit opcode: 5
--3640117-- WARNING: unhandled amd64-linux syscall: 333
--3640117-- You may be able to write your own handler.
--3640117-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--3640117-- Nevertheless we consider this a bug. Please report
--3640117-- it at http://valgrind.org/support/bug_reports.html.
--3640117-- Warning: unhandled io_submit opcode: 5
--3640117-- WARNING: unhandled amd64-linux syscall: 333
--3640117-- You may be able to write your own handler.
--3640117-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--3640117-- Nevertheless we consider this a bug. Please report
--3640117-- it at http://valgrind.org/support/bug_reports.html.
Aborting.
Backtrace:
0x2c45829
0x2bfc9cb
0x2bfce64
0x2bfcf1e
/lib64/libc.so.6+0x3ebef
/lib64/libc.so.6+0x8bd4b
/lib64/libc.so.6+0x3eb45
/lib64/libc.so.6+0x28832
0x13495b2
/lib64/libc.so.6+0x8f217
0x2d97a9a
0x1349f44
0x2c37191
0x2b9db10
0x2b9e788
0x1410090
0x1410b30
0x13512d6
/lib64/libc.so.6+0x295cf
/lib64/libc.so.6+0x2967f
0x13b26f4
==3640117==
==3640117== Process terminating with default action of signal 6 (SIGABRT): dumping core
==3640117== at 0x5C11D4C: __pthread_kill_implementation (pthread_kill.c:44)
==3640117== by 0x5BC4B45: raise (raise.c:26)
==3640117== by 0x5BAE832: abort (abort.c:79)
==3640117== by 0x13495B2: std::once_flag::_Prepare_execution::_Prepare_execution<std::call_once<seastar::memory::mem_base()::{lambda()#1}>(std::once_flag&, seastar::memory::mem_base()::{lambda()#1}&&)::{lambda()#1}>(seastar::memory::mem_base()::{lambda()#1}&)::{la
mbda()#1}::_FUN() [clone .cold] (memory.cc:339)
==3640117== by 0x5C15217: __pthread_once_slow (pthread_once.c:117)
==3640117== by 0x2D97A9A: __gthread_once (gthr-default.h:700)
==3640117== by 0x2D97A9A: call_once<seastar::memory::mem_base()::<lambda()> > (mutex:907)
==3640117== by 0x2D97A9A: mem_base (memory.cc:333)
==3640117== by 0x2D97A9A: seastar::memory::cpu_pages::initialize() [clone .part.0] (memory.cc:1215)
==3640117== by 0x1349F44: seastar::memory::configure(std::vector<seastar::resource::memory, std::allocator<seastar::resource::memory> >, bool, bool, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >) (memory.cc:1862)
==3640117== by 0x2C37191: seastar::smp::configure(seastar::smp_options const&, seastar::reactor_options const&) (reactor.cc:4384)
==3640117== by 0x2B9DB10: seastar::app_template::run_deprecated(int, char**, std::function<void ()>&&) (app-template.cc:252)
==3640117== by 0x2B9E788: seastar::app_template::run(int, char**, std::function<seastar::future<int> ()>&&) (app-template.cc:167)
==3640117== by 0x1410090: crimson::osd::_get_early_config(int, char const**) (main_config_bootstrap_helpers.cc:152)
==3640117== by 0x1410B30: crimson::osd::get_early_config(int, char const**) (main_config_bootstrap_helpers.cc:301)
==3640117==
==3640117== HEAP SUMMARY:
==3640117== in use at exit: 2,843,410 bytes in 13,003 blocks
==3640117== total heap usage: 44,837 allocs, 31,834 frees, 8,934,626 bytes allocated
==3640117==
==3640117== LEAK SUMMARY:
==3640117== definitely lost: 8 bytes in 1 blocks
==3640117== indirectly lost: 0 bytes in 0 blocks
==3640117== possibly lost: 2,838 bytes in 22 blocks
==3640117== still reachable: 2,840,564 bytes in 12,980 blocks
==3640117== suppressed: 0 bytes in 0 blocks
==3640117== Rerun with --leak-check=full to see details of leaked memory
==3640117==
==3640117== Use --track-origins=yes to see where uninitialised values come from
==3640117== For lists of detected and suppressed errors, rerun with: -s
==3640117== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
get_early_config: parent failed to decode
do_early_config returned error: -22
==3640093==
==3640093== HEAP SUMMARY:
==3640093== in use at exit: 18,572 bytes in 151 blocks
==3640093== total heap usage: 34,412 allocs, 34,261 frees, 5,316,660 bytes allocated
==3640093==
==3640093== LEAK SUMMARY:
==3640093== definitely lost: 8 bytes in 1 blocks
==3640093== indirectly lost: 0 bytes in 0 blocks
==3640093== possibly lost: 0 bytes in 0 blocks
==3640093== still reachable: 18,564 bytes in 150 blocks
==3640093== suppressed: 0 bytes in 0 blocks
==3640093== Rerun with --leak-check=full to see details of leaked memory
==3640093==
==3640093== Use --track-origins=yes to see where uninitialised values come from
==3640093== For lists of detected and suppressed errors, rerun with: -s
==3640093== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
# sudo podman top ceph-aprg
USER PID PPID %CPU ELAPSED TTY TIME COMMAND
root 1 0 0.000 2351h16m14.419716629s pts/0 8s /bin/bash
root 3639312 1 0.000 8m34.420046126s pts/0 0s bash /root/bin/run_balanced_osd.sh -p -j -b bal_osd -t sea -d /tmp/_8216229e03c/VALGRIND/1osd_56reactor_28fio_sea_rc
root 3640126 3639312 0.000 2m2.420187596s pts/0 0s bash /root/bin/cephlogoff.sh
root 3640227 3640126 0.000 1m32.420306134s pts/0 0s /usr/bin/python3.9 bin/ceph tell osd.0 config set debug_bluestore 1/5
But it didn't produced a core for this (June 13):
# ls -lht /var/lib/systemd/coredump/
total 23M
-rw-r-----. 1 root root 3.1M Jun 12 17:01 core.bash.0.fb62b985edb14266b3de32817af88195.3378404.1749747669000000.zst
-rw-r-----. 1 root root 3.1M Jun 12 17:01 core.bash.0.fb62b985edb14266b3de32817af88195.3558134.1749747668000000.zst
-rw-r-----. 1 root root 2.6M Jun 12 15:14 core.crimson-osd.0.fb62b985edb14266b3de32817af88195.3379255.1749741257000000.zst
-rw-r-----. 1 root root 2.4M Jun 11 10:03 core.crimson-osd.0.fb62b985edb14266b3de32817af88195.3153185.1749636185000000.zst
-rw-r-----. 1 root root 393K Jun 6 08:57 core.coroutines_demo.0.fb62b985edb14266b3de32817af88195.1926377.1749200251000000.zst
-rw-r-----. 1 root root 3.6M May 30 15:07 core.crimson-osd.0.fb62b985edb14266b3de32817af88195.1295503.1748617658000000.zst
-rw-r-----. 1 root root 3.4M May 29 18:39 core.crimson-osd.0.fb62b985edb14266b3de32817af88195.1266828.1748543992000000.zst
-rw-r-----. 1 root root 4.0M May 29 17:45 core.crimson-osd.0.fb62b985edb14266b3de32817af88195.1257935.1748540753000000.zst
JP Updated by Jose J Palacios Perez over 1 year ago · Edited
This is the debug code added to the the function that hits the sigsegv:
/**
* A Seastar admin hook: fetching the values of configured metrics
*/
class DumpMetricsHook : public AdminSocketHook {
public:
DumpMetricsHook() :
AdminSocketHook("dump_metrics",
"name=group,type=CephString,req=false",
"dump current configured seastar metrics and their values")
{}
seastar::future<tell_result_t> call(const cmdmap_t& cmdmap,
std::string_view format,
ceph::bufferlist&& input) const final
{
ceph_assert(cmdmap != nullptr);
INFO("cmdmap(): {})", cmdmap);
ceph_assert(input.empty());
INFO("input: {})", input );
ceph_assert( !format.empty() && format != "none" &&
format != "text" && format != "json");
INFO("format(): {})", format);
noticed that none of the call methods for all the classes in the same module osd_admin.cc uses explicitly the input buffer list, which seem to be an obvious candidate for a use/after free. However notice the end right side of the long stack frame:
::operator()() const at /opt/rh/gcc-toolset-13/root/usr/include/c++/13/bits/basic_string.h:1072
which is this:
1065 public:
1066 // Capacity:
1067 /// Returns the number of characters in the string, not including any
1068 /// null-termination.
1069 _GLIBCXX_NODISCARD _GLIBCXX20_CONSTEXPR
1070 size_type
1071 size() const _GLIBCXX_NOEXCEPT
1072 { return _M_string_length; }
is that the actual point of the SIGSEGV? Testing for a basic string length? Not sure if I understand since the constructor initialises such attribute here:
759 _GLIBCXX20_CONSTEXPR
760 basic_string(_InputIterator __beg, _InputIterator __end,
761 const _Alloc& __a = _Alloc())
762 : _M_dataplus(_M_local_data(), __a), _M_string_length(0)
763 {
Looking at the next function in stack trace frame seastar::smp_message_queue::async_work_item() that invokes the above DumpMetricsHook():
- smp.hh line 285:
auto wi = std::make_unique<async_work_item<Func>>(*this, options.service_group, std::forward<Func>(func));
I think I need to trace when is this wi disposed to prove that there is a use after free situation.
JP Updated by Jose J Palacios Perez over 1 year ago
- seastar::include/core/future.hh:
template <typename Promise, typename Func, typename Wrapper, typename T = void> struct continuation final : continuation_base_with_promise<Promise, T> { continuation(Promise&& pr, Func&& func, Wrapper&& wrapper) noexcept : continuation_base_with_promise<Promise, T>(std::move(pr)) , _func(std::move(func)) , _wrapper(std::move(wrapper)) {} virtual void run_and_dispose() noexcept override { try { _wrapper(std::move(this->_pr), _func, std::move(this->_state)); //<<-- } catch (...) { this->_pr.set_to_current_exception(); } delete this; } Func _func; [[no_unique_address]] Wrapper _wrapper; };
JP Updated by Jose J Palacios Perez over 1 year ago
Struggling to find the definition of bufferlist:
tracer.cc:22:using bufferlist = ceph::buffer::list;
util.cc:49:using ceph::bufferlist;
/ceph/src/crimson/common/local_shared_foreign_ptr.h:142:13: note: template argument deduction/substitution failed:
/ceph/src/crimson/admin/osd_admin.cc:333:26: note: ‘ceph::bufferlist’ {aka ‘ceph::buffer::v15_2_0::list’} is not derived from ‘const crimson::local_shared_foreign_ptr<T>’
333 | ceph_assert(input != nullptr);
| ^~~~~~~
JP Updated by Jose J Palacios Perez over 1 year ago
I locally checked out PR 63523:
git fetch origin pull/63523/head:wip-matanb-crimson-asock-race-fixes
I'm trying to use the debug macros defined in src/crimson/common/log.h#define INFO(...) LOG(seastar::log_level::info, __VA_ARGS__)
#define DEBUG(...) LOG(seastar::log_level::debug, __VA_ARGS__)
- made this simple change in src/crimson/admnin/osd_admin.cc:
340 seastar::future<tell_result_t> call(const cmdmap_t& cmdmap, 341 std::string_view format, 342 ceph::bufferlist&& input) const final 343 { 344 LOG_PREFIX(AdminSocketHook::DumpMetricsHook); 345 DEBUG(""); 346 // ceph_assert(cmdmap != nullptr); 347 DEBUG("cmdmap: {}", cmdmap); 348 DEBUG("input: {}", input ); 349 DEBUG("format: {}", format); : - get this compilation error:
har, std::char_traits<char>, std::allocator<char> > > >, std::vector<long int, std::allocator<long int> >, std::vector<double, std::allocator<double> > > > > >&}; format_info_t<Args ...> = format_info]’ /ceph/src/crimson/admin/osd_admin.cc:347:5: required from here /ceph/src/fmt/include/fmt/ranges.h:572:29: error: no matching function for call to ‘std::tuple<fmt::v11::formatter<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char, void>, fmt::v11::formatter<boost::variant<std::__cxx11::basic_string <char, std::char_traits<char>, std::allocator<char> >, bool, long int, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > , std::vector<long int, std::allocator<long int> >, std::vector<double, std::allocator<double> > >, char, void> >::tuple()’ 572 | FMT_CONSTEXPR formatter() {} | ^ /opt/rh/gcc-toolset-13/root/usr/include/c++/13/tuple:1358:17: note: candidate expects 1 argument, 0 provided /opt/rh/gcc-toolset-13/root/usr/include/c++/13/tuple:1356:17: note: candidate: ‘constexpr std::tuple<_T1, _T2>::tuple(const std::tuple<_T1, _T2>&) [with _T1 = fmt::v11::formatter<std::__cxx11::basic_string<char>, char, void>; _T2 = fmt::v11::formatter<boost::variant<std::__cxx11::basic_string<char>, bool, long int, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long int, std::allocator<long int> >, std::vector<double, std::allocator<double> > >, char, void>]’ 1356 | constexpr tuple(const tuple&) = default; | ^~~~~ /opt/rh/gcc-toolset-13/root/usr/include/c++/13/tuple:1356:17: note: candidate expects 1 argument, 0 provided ninja: build stopped: cannot make progress due to previous errors.
I've been looking ar src/crimson/admin/admin_socket.cc for examples of usage, I am guessing that the variable being traced needs to be convertible to string somehow?
JP Updated by Jose J Palacios Perez over 1 year ago
- For debug tracing the cmdmap_t, it is defined as
src/common/cmdparse.h: typedef std::map<std::string, cmd_vartype, std::less<>> cmdmap_t;
and there is this function in src/common/cmdparse.cc:string cmd_vartype_stringify(const cmd_vartype &v) { return boost::apply_visitor(stringify_visitor(), v); }
It might be possible to debug trace each piece of the cmdmap_t? Or define a function method that stringfies a cmdmap_t?
JP Updated by Jose J Palacios Perez over 1 year ago
Trying to printing addresses is not allowed either:
@@ -343,6 +343,11 @@ public:
{
LOG_PREFIX(AdminSocketHook::DumpMetricsHook);
DEBUG("");
+ // ceph_assert(cmdmap != nullptr);
+ DEBUG("cmdmap: {}", &cmdmap);
+ DEBUG("format: {}", &format);
+ DEBUG("input: {}", &input );
+
std::unique_ptr<Formatter> fref{Formatter::create(format, "json-pretty", "json-pretty")};
auto *f = fref.get();
std::string prefix;
it produces:
/ceph/src/seastar/include/seastar/util/log.hh:292:42: required from ‘void seastar::logger::log(seastar::log_level, format_info_t<Args ...>, Args&& ...) [with Args = {const char* const&, ceph::buffer::v15_2_0::list*}; format_info_t<Args ...> = format_info]’
/ceph/src/crimson/admin/osd_admin.cc:349:5: required from here
/ceph/src/fmt/include/fmt/base.h:1635:17: error: static assertion failed: Formatting of non-void pointers is disallowed.
MB Updated by Matan Breizman over 1 year ago
Jose J Palacios Perez wrote in #note-20:
Trying to printing addresses is not allowed either:
You can try using fmt::ptr
JP Updated by Jose J Palacios Perez over 1 year ago
Going back to basics, this compiles fine, now I need to traverse the cmdmap and the bufferlist references:
{
LOG_PREFIX(AdminSocketHook::DumpMetricsHook);
DEBUG("");
+ // ceph_assert(cmdmap != nullptr);
+ void *p = (void *)&cmdmap; // reinterpret_cast<void*>
+ DEBUG("format: {}", format);
+ DEBUG("cmdmap: {}",p);
+ p = (void*)&input;
+ DEBUG("input: {}", p);
+
JP Updated by Jose J Palacios Perez over 1 year ago
As per the conversation earlier, I made a very small change to test the theory, just returns an empty formatter and do not call any of the callbacks nor reactor_map_seq():
+++ b/src/crimson/admin/osd_admin.cc
@@ -343,12 +343,24 @@ public:
{
LOG_PREFIX(AdminSocketHook::DumpMetricsHook);
DEBUG("");
+ INFO("format: {}", format);
+ // ceph_assert(cmdmap != nullptr);
+ void *p = (void *)&cmdmap; // reinterpret_cast<void*>
+ INFO("cmdmap: {}",fmt::ptr(p));
+ p = (void*)&input;
+ INFO("input: {}", p);
+
std::unique_ptr<Formatter> fref{Formatter::create(format, "json-pretty", "json-pretty")};
+
auto *f = fref.get();
std::string prefix;
cmd_getval(cmdmap, "group", prefix);
f->open_object_section("metrics");
f->open_array_section("metrics");
+ fref->close_section();
+ fref->close_section();
+ return seastar::make_ready_future<tell_result_t>(std::move(fref));
+
return seastar::do_with(std::move(prefix), [f](auto &prefix) {
return crimson::reactor_map_seq([f, &prefix] {
for (const auto& [full_name, metric_family]: seastar::scollectd::get_value_map()) {
this is the error I got:
INFO 2025-06-18 13:00:01,938 [shard 0:main] osd - get_early_config: set --thread-affinity 0 --smp 4
DEBUG 2025-06-18 13:00:01,938 [shard 0:main] seastar - reactor::drain
INFO 2025-06-18 13:00:02,163 seastar - Reactor backend: linux-aio
Could not initialize seastar: std::bad_array_new_length (std::bad_array_new_length)
start osd.0
osd 0 /ceph/build/bin/crimson-osd --seastore_max_concurrent_transactions=128 --seastore_cache_lru_size=2G -i 0 -c /ceph/build/ceph.conf
OSDs started
so I am guessing this DumpMetricsHook::call() is probably invoked in other places during OSD init?
And still I get the expected debug print in the osd stdout, nor osd log:
# grep -nHi INFO osd* | grep cmdmap
# grep -nHic INFO osd*
osd-mkfs.0.log:53
osd.0.stdout:54
# grep -nHi INFO osd* | grep -c cmdmap
0
-- same with the other var names input and format :-(
JP Updated by Jose J Palacios Perez over 1 year ago
Retrying slightly different change:
INFO 2025-06-18 15:08:47,296 [shard 0:main] ms - [0x60000012c7e0 osd.0(client) v2:127.0.0.1:6801/717069311 >> mgr.4106 127.0.0.1:0/4239200078@47054] established, going to ready
INFO 2025-06-18 15:08:47,296 [shard 0:main] asok - AdminSocket::handle_command:
INFO 2025-06-18 15:08:47,296 [shard 0:main] asok - AdminSocket::execute_command:
INFO 2025-06-18 15:08:47,296 [shard 0:main] asok - AdminSocket::parse_cmd:
ERROR 2025-06-18 15:08:47,296 [shard 0:main] asok - AdminSocket::parse_cmd: unknown command: smart
E486: Pattern not found: DumpMetricsHook
but once we invoke the ceph tell cmd, we finally get the expected debug traces in the OSD log, so minor progress:
psf
PID TTY STAT TIME COMMAND
1 pts/0 Ss 0:09 /bin/bash
4057056 pts/0 S 0:00 /bin/sh /ceph/src/ceph-run --no-restart /ceph/build/bin/ceph-mon -i a -c /ceph/build/ceph.conf -f
4057058 pts/0 Sl 0:03 \_ /ceph/build/bin/ceph-mon -i a -c /ceph/build/ceph.conf -f
4057196 pts/0 S 0:00 /bin/sh /ceph/src/ceph-run --no-restart /ceph/build/bin/ceph-mgr -i x -c /ceph/build/ceph.conf -f
4057200 pts/0 Sl 0:05 \_ /ceph/build/bin/ceph-mgr -i x -c /ceph/build/ceph.conf -f
4057509 pts/0 S 0:00 /bin/sh /ceph/src/ceph-run --no-restart /ceph/build/bin/crimson-osd --seastore_max_concurrent_transactions=128 --seastore_cache_lru_size=2G -i 0 -c /ceph/build/ceph.conf -f
4057512 pts/0 Sl 0:18 \_ /ceph/build/bin/crimson-osd --seastore_max_concurrent_transactions=128 --seastore_cache_lru_size=2G -i 0 -c /ceph/build/ceph.conf -f
4057555 pts/0 R+ 0:00 ps ax --forest
@d9754c08030d:/ceph/build
[15:27:02]$ # ceph tell osd.0 dump_metrics reactor_utilization
{
"metrics": [
{
"reactor_utilization": {
"shard": "0",
"value": 0.019011599999896323
}
},
{
"reactor_utilization": {
"shard": "1",
"value": 0.0085916999999047228
}
},
{
"reactor_utilization": {
"shard": "2",
"value": 0.0053907799998031969
}
},
{
"reactor_utilization": {
"shard": "3",
"value": 0.004947699999968691
}
}
]
}
@d9754c08030d:/ceph/build
[15:27:41]$ # grep -nHi AdminSocketHook out/osd.0.log
out/osd.0.log:2194:INFO 2025-06-18 15:27:28,217 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: format:
out/osd.0.log:2195:INFO 2025-06-18 15:27:28,217 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: cmdmap: 0x7ffd92910dd0
out/osd.0.log:2196:INFO 2025-06-18 15:27:28,217 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: input: 0x6020002dbb28
INFO 2025-06-18 15:27:28,214 [shard 0:main] ms - [0x60000012cb60 osd.0(client) v2:127.0.0.1:6801/717069311 >> client.4136 127.0.0.1:0/2781286829@33112] established, going to ready
INFO 2025-06-18 15:27:28,214 [shard 0:main] asok - AdminSocket::handle_command:
INFO 2025-06-18 15:27:28,214 [shard 0:main] asok - AdminSocket::execute_command:
INFO 2025-06-18 15:27:28,214 [shard 0:main] asok - AdminSocket::parse_cmd:
INFO 2025-06-18 15:27:28,214 [shard 0:main] asok - AdminSocket::GetdescsHook:
INFO 2025-06-18 15:27:28,217 [shard 0:main] asok - AdminSocket::handle_command:
INFO 2025-06-18 15:27:28,217 [shard 0:main] asok - AdminSocket::execute_command:
INFO 2025-06-18 15:27:28,217 [shard 0:main] asok - AdminSocket::parse_cmd:
INFO 2025-06-18 15:27:28,217 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: format:
INFO 2025-06-18 15:27:28,217 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: cmdmap: 0x7ffd92910dd0
INFO 2025-06-18 15:27:28,217 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: input: 0x6020002dbb28
INFO 2025-06-18 15:27:28,220 [shard 2:main] ms - [0x60000012cb60 osd.0(client) v2:127.0.0.1:6801/717069311 >> client.4136 127.0.0.1:0/2781286829] do_in_dispatch(): fault at open, io_stat(io_state=open, in_seq=2, out_seq=2, out_pending_msgs_size=0, out_sent_msgs_size=0, need_ack=0, need_keepalive=0, need_keepalive_ack=0), going to delay -- read eof, send 1 notify_out_fault()
INFO 2025-06-18 15:27:28,220 [shard 0:main] ms - [0x60000012cb60 osd.0(client) v2:127.0.0.1:6801/717069311 >> client.4136 127.0.0.1:0/2781286829@33112] protocol READY do_in_dispatch fault on lossy channel, going to CLOSING -- read eof
INFO 2025-06-18 15:27:28,220 [shard 0:main] ms - [0x60000012cb60 osd.0(client) v2:127.0.0.1:6801/717069311 >> client.4136 127.0.0.1:0/2781286829@33112] closing: reset yes, replace no
WARN 2025-06-18 15:27:28,220 [shard 2:main] osd - OSD::ms_handle_reset: [0x60000012cb60 osd.0(client) v2:127.0.0.1:6801/717069311 >> client.4136 127.0.0.1:0/2781286829]
not sure why the format string is empty though
This is how we created the cluster:
# MDS=0 MON=1 OSD=1 MGR=1 /ceph/src/vstart.sh --new -x --localhost --without-dashboard --redirect-output --seastore --seastore-devs /dev/nvme9n1p2,/dev/nvme8n1p2 --osd-args "--seastore_max_concurrent_transactions=128 --seastore_cache_lru_size=2G" --crimson --crimson-smp 4 --no-restart
as a side note, notice how if not using the balance option, the OSD process inherits the same taskset as its parent (vstart), so in this case we have reactors not pinned to as specific core:
# taskset -acp $(pgrep crimson-osd)
pid 4057512's current affinity list: 0-111
pid 4057518's current affinity list: 0-111
pid 4057519's current affinity list: 0-111
pid 4057520's current affinity list: 0-111
pid 4057521's current affinity list: 0-111
pid 4057522's current affinity list: 0-111
pid 4057523's current affinity list: 0-111
pid 4057524's current affinity list: 0-111
pid 4057525's current affinity list: 0-111
pid 4057526's current affinity list: 0-111
pid 4057527's current affinity list: 0-111
pid 4057528's current affinity list: 0-111
# ps -p 4057512 -L -o pid,tid,comm,psr
PID TID COMMAND PSR
4057512 4057512 crimson-osd 8
4057512 4057518 reactor-1 111
4057512 4057519 reactor-2 63
4057512 4057520 reactor-3 5
4057512 4057521 syscall-0 7
4057512 4057522 syscall-1 62
4057512 4057523 syscall-3 64
4057512 4057524 syscall-2 31
4057512 4057525 crimson-osd 95
4057512 4057526 reactor-1 31
4057512 4057527 reactor-3 10
4057512 4057528 reactor-2 84
I don't recollect to have seen this before tbh, perhaps since I always use the balanced option and always set a set of cores for FIO, in this case I created the cluster manually
JP Updated by Jose J Palacios Perez over 1 year ago
The new log entries shown that the objects passed as arguments to the DumpMetricsHook::call() are persistent (they are each the same object resp.), here are some entries picked at random intervals:
ut/osd.0.log:2194:INFO 2025-06-18 15:27:28,217 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: format:
out/osd.0.log:2195:INFO 2025-06-18 15:27:28,217 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: cmdmap: 0x7ffd92910dd0
out/osd.0.log:2196:INFO 2025-06-18 15:27:28,217 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: input: 0x6020002dbb28
out/osd.0.log:2391:INFO 2025-06-18 15:47:20,078 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: format:
out/osd.0.log:2392:INFO 2025-06-18 15:47:20,078 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: cmdmap: 0x7ffd92910dd0
out/osd.0.log:2393:INFO 2025-06-18 15:47:20,078 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: input: 0x6010002dbb28
:
out/osd.0.log:2708:INFO 2025-06-18 15:49:08,009 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: format:
out/osd.0.log:2709:INFO 2025-06-18 15:49:08,009 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: cmdmap: 0x7ffd92910dd0
out/osd.0.log:2710:INFO 2025-06-18 15:49:08,009 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: input: 0x6010002dbb28
out/osd.0.log:2728:INFO 2025-06-18 15:49:13,119 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: format:
out/osd.0.log:2729:INFO 2025-06-18 15:49:13,119 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: cmdmap: 0x7ffd92910dd0
out/osd.0.log:2730:INFO 2025-06-18 15:49:13,119 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: input: 0x6010002dbb28
out/osd.0.log:2747:INFO 2025-06-18 15:49:18,227 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: format:
out/osd.0.log:2748:INFO 2025-06-18 15:49:18,227 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: cmdmap: 0x7ffd92910dd0
out/osd.0.log:2749:INFO 2025-06-18 15:49:18,227 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: input: 0x6010002dbb28
:
out/osd.0.log:13857:INFO 2025-06-18 16:48:30,268 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: format:
out/osd.0.log:13858:INFO 2025-06-18 16:48:30,268 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: cmdmap: 0x7ffd92910dd0
out/osd.0.log:13859:INFO 2025-06-18 16:48:30,268 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: input: 0x6010002dbb28
:
out/osd.0.log:60265:INFO 2025-06-18 20:55:27,524 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: format:
out/osd.0.log:60266:INFO 2025-06-18 20:55:27,524 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: cmdmap: 0x7ffd92910dd0
out/osd.0.log:60267:INFO 2025-06-18 20:55:27,524 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: input: 0x6010002dbb28
we didn't hit a single SIGSEGV in those 4 hours, the OSD is still alive and kicking:
PID TTY STAT TIME COMMAND
1 pts/0 Ss 0:09 /bin/bash
4057056 pts/0 S 0:00 /bin/sh /ceph/src/ceph-run --no-restart /ceph/build/bin/ceph-mon -i a -c /ceph/build/ceph.conf -f
4057058 pts/0 Sl 4:10 \_ /ceph/build/bin/ceph-mon -i a -c /ceph/build/ceph.conf -f
4057196 pts/0 S 0:00 /bin/sh /ceph/src/ceph-run --no-restart /ceph/build/bin/ceph-mgr -i x -c /ceph/build/ceph.conf -f
4057200 pts/0 Sl 2:25 \_ /ceph/build/bin/ceph-mgr -i x -c /ceph/build/ceph.conf -f
4057509 pts/0 S 0:00 /bin/sh /ceph/src/ceph-run --no-restart /ceph/build/bin/crimson-osd --seastore_max_concurrent_transactions=128 --seastore_cache_lru_size=2G -i 0 -c /ceph/build/ceph.conf -f
4057512 pts/0 Sl 18:57 \_ /ceph/build/bin/crimson-osd --seastore_max_concurrent_transactions=128 --seastore_cache_lru_size=2G -i 0 -c /ceph/build/ceph.conf -f
The patch is very simple, obviously not a fix:
+++ b/src/crimson/admin/osd_admin.cc
@@ -343,12 +343,24 @@ public:
{
LOG_PREFIX(AdminSocketHook::DumpMetricsHook);
DEBUG("");
+ INFO("format: {}", format);
+ // ceph_assert(cmdmap != nullptr);
+ void *p = (void *)&cmdmap; // reinterpret_cast<void*>
+ INFO("cmdmap: {}",fmt::ptr(p));
+ p = (void*)&input;
+ INFO("input: {}", p);
+
std::unique_ptr<Formatter> fref{Formatter::create(format, "json-pretty", "json-pretty")};
+
auto *f = fref.get();
std::string prefix;
cmd_getval(cmdmap, "group", prefix);
f->open_object_section("metrics");
f->open_array_section("metrics");
+/* fref->close_section();
+ fref->close_section();
+ return seastar::make_ready_future<tell_result_t>(std::move(fref));
+*/
return seastar::do_with(std::move(prefix), [f](auto &prefix) {
return crimson::reactor_map_seq([f, &prefix] {
for (const auto& [full_name, metric_family]: seastar::scollectd::get_value_map()) {
next will try adding debug traces inside the callbacks that reactor_map_seq() invoke, an dlook at the alternatives native in Seastar discussed yesterday.
MB Updated by Matan Breizman over 1 year ago
Jose J Palacios Perez wrote in #note-25:
The new log entries shown that the objects passed as arguments to the DumpMetricsHook::call() are persistent (they are each the same object resp.), here are some entries picked at random intervals:
[...]
we didn't hit a single SIGSEGV in those 4 hours, the OSD is still alive and kicking:
[...]
The patch is very simple, obviously not a fix:
[...]
next will try adding debug traces inside the callbacks that reactor_map_seq() invoke, an dlook at the alternatives native in Seastar discussed yesterday.
Please see last commit in https://github.com/ceph/ceph/pull/63523/commits. This should explain the segfaults we had around the admin socket!
JP Updated by Jose J Palacios Perez over 1 year ago
Still cannot longer recreate: last tried last night (only four reactors) and completes without hitting the SIGSEGV:
# echo $(date); /root/bin/run_balanced_osd.sh -p -j -b bal_osd -t sea -d /tmp/_87d20855809/crimson-asock/1osd_4reactor_28fio_sea_rc # base,w OSD monitoring, all workloads try recreate sigsegv
Mon Jun 23 22:40:12 UTC 2025
== Preconditioning ==
:
rm -- /tmp/ceph_monmap.73392
Populating config ...
/ceph/build/bin/ceph -c /ceph/build/ceph.conf -k /ceph/build/keyring -i /ceph/build/dev/mgr.x/keyring auth add mgr.x mon 'allow profile mgr' mds 'allow *' osd 'allow *'
added key for mgr.x
/ceph/build/bin/ceph -c /ceph/build/ceph.conf -k /ceph/build/keyring config set mgr mgr/prometheus/x/server_port 9283 --force
:
Mon Jun 23 22:46:43 UTC 2025 Starting watchdog
Mon Jun 23 22:46:43 UTC 2025 Starting FIO...
pool 'rbd' created
enabled application 'rbd' on pool 'rbd'
set pool 2 size to 1
noautoscale is set, all pools now have autoscale off
nodeep-scrub is set
noscrub is set
Mon Jun 23 22:48:24 UTC 2025 FIO 77363 started
Mon Jun 23 22:48:24 UTC 2025 Waiting for FIO to complete, (watchdog pid 73989)...
:
Tue Jun 24 06:22:42 UTC 2025 FIO completed, killing watchdog 73989...
WARNING: crimson-osd still alive after 1 seconds
WARNING: crimson-osd still alive after 2 seconds
WARNING: crimson-osd still alive after 4 seconds
# ls -lht /tmp/_87d20855809/crimson-asock/1osd_4reactor_28fio_sea_rc
total 15M
-rw-r--r--. 1 root root 4.4M Jun 24 06:22 sea_1osd_4reactor_32fio_bal_osd_rc_1procs_seqwrite.zip
-rw-r--r--. 1 root root 3.8K Jun 24 06:22 fio_sea_1osd_4reactor_32fio_bal_osd_rc_1procs_seqwrite_err.zip
-rw-r--r--. 1 root root 4.9M Jun 24 04:09 sea_1osd_4reactor_32fio_bal_osd_rc_1procs_seqread.zip
-rw-r--r--. 1 root root 3.7K Jun 24 04:09 fio_sea_1osd_4reactor_32fio_bal_osd_rc_1procs_seqread_err.zip
-rw-r--r--. 1 root root 2.3M Jun 24 01:44 sea_1osd_4reactor_32fio_bal_osd_rc_1procs_randwrite.zip
-rw-r--r--. 1 root root 5.0K Jun 24 01:44 fio_sea_1osd_4reactor_32fio_bal_osd_rc_1procs_randwrite_err.zip
-rw-r--r--. 1 root root 2.7M Jun 24 00:13 sea_1osd_4reactor_32fio_bal_osd_rc_1procs_randread.zip
-rw-r--r--. 1 root root 3.2K Jun 24 00:13 fio_sea_1osd_4reactor_32fio_bal_osd_rc_1procs_randread_err.zip
the minimal debug info in place shows what we already know, the object arguments of function are persistent,
build/out/osd.0.log:1302885:INFO 2025-06-24 06:19:14,484 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: format:
build/out/osd.0.log:1302886:INFO 2025-06-24 06:19:14,484 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: cmdmap: 0x7fffbb38abf0
build/out/osd.0.log:1302887:INFO 2025-06-24 06:19:14,484 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: input: 0x6000a15e4b28
build/out/osd.0.log:1303360:INFO 2025-06-24 06:19:19,601 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: format:
build/out/osd.0.log:1303361:INFO 2025-06-24 06:19:19,601 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: cmdmap: 0x7fffbb38abf0
build/out/osd.0.log:1303362:INFO 2025-06-24 06:19:19,601 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: input: 0x6000caf0f428
build/out/osd.0.log:1317834:INFO 2025-06-24 06:22:24,200 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: format:
build/out/osd.0.log:1317835:INFO 2025-06-24 06:22:24,200 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: cmdmap: 0x7fffbb38abf0
build/out/osd.0.log:1317836:INFO 2025-06-24 06:22:24,200 [shard 0:main] osd - AdminSocketHook::DumpMetricsHook: input: 0x6000caf0f7a8
I have not managed to make the foreign pointer to work, the intention is that the ceph::Formatter (fref) that is used by all the shards to append their Performance data would be a foreign pointer rather than a raw pointer as it is now (obtained from a unique_ptr). I have tried several different ways, among others:
- as part of the capture in
co_await crimson::invoke_on_all_seq([f = seastar::make_foreign(fref).get(), &prefix] {
which gets this error:/ceph/src/crimson/admin/osd_admin.cc: In member function ‘virtual seastar::future<crimson::admin::tell_result_t> crimson::admin::DumpMetricsHook::call(const cmdmap_t&, std::string_view, ceph::bufferlist&&) const’: /ceph/src/crimson/admin/osd_admin.cc:352:67: error: use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = ceph::Formatter; _Dp = std::default_delete<ceph::Formatter>]’ 352 | co_await crimson::invoke_on_all_seq([f = seastar::make_foreign(fref).get(), &prefix] { | In file included from /opt/rh/gcc-toolset-13/root/usr/include/c++/13/memory:78, from /ceph/src/crimson/admin/osd_admin.h:5, from /ceph/src/crimson/admin/osd_admin.cc:4: /opt/rh/gcc-toolset-13/root/usr/include/c++/13/bits/unique_ptr.h:522:7: note: declared here 522 | unique_ptr(const unique_ptr&) = delete; | ^~~~~~~~~~ In file included from /ceph/src/seastar/include/seastar/core/metrics_api.hh:27, from /ceph/src/seastar/include/seastar/core/scollectd.hh:44, from /ceph/src/seastar/include/seastar/core/scollectd_api.hh:8, from /ceph/src/crimson/admin/osd_admin.cc:12: /ceph/src/seastar/include/seastar/core/sharded.hh:1067:31: note: initializing argument 1 of ‘seastar::foreign_ptr<T> seastar::make_foreign(T) [with T = std::unique_ptr<ceph::Formatter>]’ 1067 | foreign_ptr<T> make_foreign(T ptr) { | ~~^~~ /ceph/src/crimson/admin/osd_admin.cc: In lambda function: /ceph/src/crimson/admin/osd_admin.cc:360:13: error: ‘f’ was not declared in this scope 360 | f->open_object_section(""); // enclosed by array | ^ ninja: build stopped: cannot make progress due to previous errors. ~~~~~~~~~~~~~~~~~~~~~^~~~~~
I will continue looking at the examples of use of the foreign pointers in seastar, mostly involve making the conversion from either captured variables or formal arguments to lambda expressions.
JP Updated by Jose J Palacios Perez over 1 year ago
Matan Breizman wrote in #note-26:
Please see last commit in https://github.com/ceph/ceph/pull/63523/commits. This should explain the segfaults we had around the admin socket!
Yes, in these last attempts I did pulled your code changes in place,
git fetch origin pull/63523/head:wip-matanb-crimson-asock-race-fixesMB Updated by Matan Breizman over 1 year ago · Edited
Jose J Palacios Perez wrote in #note-28:
Yes, in these last attempts I did pulled your code changes in place,
git fetch origin pull/63523/head:wip-matanb-crimson-asock-race-fixes
The latest fix is from yesterday, the older sha1 (previous week) didn't work as expected.
This is the referred fix: https://github.com/ceph/ceph/pull/63523/commits/550b2b8ade7e10078ab9610442d039b65cce6a2b
I'm waiting to run this through the suite to verify it.
JP Updated by Jose J Palacios Perez over 1 year ago
The latest fix is from yesterday, the older sha1 (previous week) didn't work as expected.
This is the referred fix: https://github.com/ceph/ceph/pull/63523/commits/550b2b8ade7e10078ab9610442d039b65cce6a2b
I'm waiting to run this through the suite to verify it.
Thank you @Matan Breizman I'll double check now
JP Updated by Jose J Palacios Perez over 1 year ago
# echo $(date); /root/bin/run_balanced_osd.sh -p -j -b bal_osd -t sea -d /tmp/_87d20855809/crimson-asock/1osd_4reactor_28fio_sea_rc # base,w OSD monitoring, all workloads try recreate sigsegv
Tue Jun 24 13:02:37 UTC 2025
== Preconditioning ==
nvme0n1p2: (g=0): rw=randwrite, bs=(R) 64.0KiB-64.0KiB, (W) 64.0KiB-64.0KiB, (T) 64.0KiB-64.0KiB, ioengine=libaio, iodepth=256
nvme3n1p2: (g=0): rw=randwrite, bs=(R) 64.0KiB-64.0KiB, (W) 64.0KiB-64.0KiB, (T) 64.0KiB-64.0KiB, ioengine=libaio, iodepth=256
nvme4n1p2: (g=0): rw=randwrite, bs=(R) 64.0KiB-64.0KiB, (W) 64.0KiB-64.0KiB, (T) 64.0KiB-64.0KiB, ioengine=libaio, iodepth=256
nvme2n1p2: (g=0): rw=randwrite, bs=(R) 64.0KiB-64.0KiB, (W) 64.0KiB-64.0KiB, (T) 64.0KiB-64.0KiB, ioengine=libaio, iodepth=256
nvme6n1p2: (g=0): rw=randwrite, bs=(R) 64.0KiB-64.0KiB, (W) 64.0KiB-64.0KiB, (T) 64.0KiB-64.0KiB, ioengine=libaio, iodepth=256
nvme5n1p2: (g=0): rw=randwrite, bs=(R) 64.0KiB-64.0KiB, (W) 64.0KiB-64.0KiB, (T) 64.0KiB-64.0KiB, ioengine=libaio, iodepth=256
nvme8n1p2: (g=0): rw=randwrite, bs=(R) 64.0KiB-64.0KiB, (W) 64.0KiB-64.0KiB, (T) 64.0KiB-64.0KiB, ioengine=libaio, iodepth=256
nvme9n1p2: (g=0): rw=randwrite, bs=(R) 64.0KiB-64.0KiB, (W) 64.0KiB-64.0KiB, (T) 64.0KiB-64.0KiB, ioengine=libaio, iodepth=256
fio-3.39-26-ga72fe
Starting 8 threads
Jobs: 8 (f=8): [w(8)][10.4%][w=22.3GiB/s][w=365k IOPS][eta 51m:34s]
nvme0n1p2: (groupid=0, jobs=8): err= 0: pid=299387: Tue Jun 24 13:08:39 2025
write: IOPS=365k, BW=22.3GiB/s (23.9GB/s)(8034GiB/360812msec); 0 zone resets
slat (nsec): min=1784, max=475519, avg=5975.14, stdev=2212.67
clat (usec): min=37, max=64047, avg=5607.00, stdev=4892.19
lat (usec): min=48, max=64052, avg=5612.97, stdev=4892.15
:
un status group 0 (all jobs):
WRITE: bw=22.3GiB/s (23.9GB/s), 22.3GiB/s-22.3GiB/s (23.9GB/s-23.9GB/s), io=8034GiB (8626GB), run=360812-360812msec
Disk stats (read/write):
nvme0n1: ios=0/17862050, sectors=0/2286342400, merge=0/0, ticks=0/92095782, in_queue=92095782, util=72.89%
nvme3n1: ios=0/17936188, sectors=0/2295832064, merge=0/0, ticks=0/92201218, in_queue=92201218, util=72.35%
nvme4n1: ios=0/17967817, sectors=0/2299880576, merge=0/0, ticks=0/92201708, in_queue=92201708, util=71.92%
nvme2n1: ios=0/17955327, sectors=0/2298281856, merge=0/0, ticks=0/92181882, in_queue=92181883, util=72.06%
nvme6n1: ios=0/17944328, sectors=0/2296873984, merge=0/0, ticks=0/92199799, in_queue=92199798, util=72.01%
nvme5n1: ios=0/17933149, sectors=0/2295443072, merge=0/0, ticks=0/92199183, in_queue=92199182, util=71.94%
nvme8n1: ios=0/17950533, sectors=0/2297668224, merge=0/0, ticks=0/92200202, in_queue=92200202, util=72.05%
nvme9n1: ios=0/6076153, sectors=0/777747584, merge=0/0, ticks=0/92304814, in_queue=92304814, util=88.75%
nvme7n1p2 nvme1n1p2 nvme2n1p2 nvme4n1p2 nvme6n1p2 nvme0n1p2 nvme5n1p2 nvme9n1p2 nvme3n1p2 nvme8n1p2
reads_completed 0 0 0 0 0 0 0 0 0 0
writes_completed 0 0 17955589 17968079 17944588 17862314 17933408 6076409 17936451 17950791
nvme7n1p2 nvme1n1p2 nvme2n1p2 nvme4n1p2 nvme6n1p2 nvme0n1p2 nvme5n1p2 nvme9n1p2 nvme3n1p2 nvme8n1p2
read_time_ms 0 0 0 0 0 0 0 0 0 0
write_time_ms 0 0 92183301 92203079 92201165 92097417 92201328 92311879 92203505 92202057
== bal_osd ==
== sea ==
== (sea) 1 OSD crimson, 4 reactor, fixed 32fio==
:
Tue Jun 24 13:09:08 UTC 2025 Starting watchdog
Tue Jun 24 13:09:08 UTC 2025 Starting FIO...
pool 'rbd' created
enabled application 'rbd' on pool 'rbd'
set pool 2 size to 1
noautoscale is set, all pools now have autoscale off
nodeep-scrub is set
noscrub is set
Tue Jun 24 13:11:21 UTC 2025 FIO 303434 started
Tue Jun 24 13:11:21 UTC 2025 Waiting for FIO to complete, (watchdog pid 299998)...
Tue Jun 24 21:09:32 UTC 2025 FIO completed, killing watchdog 299998...
WARNING: crimson-osd still alive after 1 seconds
WARNING: crimson-osd still alive after 2 seconds
WARNING: crimson-osd still alive after 4 seconds
- osd.0.stdout: clean
INFO 2025-06-24 21:09:38,588 [shard 0:main] osd - crimson shutdown complete - no evidence of failures in out/osd.0.log either
MB Updated by Matan Breizman over 1 year ago
- Status changed from New to Duplicate
- Pull request ID set to 63523
Jose J Palacios Perez wrote in #note-31:
All tests completed without hitting a sigsegv:
[...]
- osd.0.stdout: clean
[...]- no evidence of failures in out/osd.0.log either
That's great! Thank you for verifying, I'll close the tracker and backport the fix. Please reopen if seen again.
UB Updated by Upkeep Bot 3 months ago
- Pull request ID deleted (
63523) - Upkeep Timestamp set to 2026-08-29T14:17:18+00:00