[Bug 1921749] Re: nautilus: ceph radosgw beast frontend coroutine stack corruption

Mauricio Faria de Oliveira 1921749 at bugs.launchpad.net
Mon Mar 29 13:58:50 UTC 2021


coredump #1

	(gdb) bt
	#0  raise (sig=sig at entry=11) at ../sysdeps/unix/sysv/linux/raise.c:51
	#1  0x0000555f023cf6b0 in reraise_fatal (signum=11) at ./src/global/signal_handler.cc:81
	#2  handle_fatal_signal (signum=11) at ./src/global/signal_handler.cc:326
	#3  <signal handler called>
	#4  tcmalloc::SLL_Next (t=0x67777ee60000555f) at src/linked_list.h:45
	#5  tcmalloc::SLL_Pop (list=0x555f03530628) at src/linked_list.h:59
	#6  tcmalloc::ThreadCache::FreeList::Pop (this=<optimized out>) at src/thread_cache.h:212
	#7  tcmalloc::ThreadCache::Allocate (cl=<optimized out>, size=<optimized out>, this=<optimized out>) at src/thread_cache.h:365
	#8  (anonymous namespace)::do_memalign (align=align at entry=8, size=<optimized out>, size at entry=4096) at src/tcmalloc.cc:1462
	#9  0x00007f1d87d08379 in (anonymous namespace)::do_memalign_or_cpp_memalign (size=4096, align=8) at src/tcmalloc.cc:1131
	#10 tc_posix_memalign (result_ptr=result_ptr at entry=0x7f1d74c51310, align=align at entry=8, size=size at entry=4096) at src/tcmalloc.cc:1781
	#11 0x00007f1d7ea60a86 in ceph::buffer::v14_2_0::raw_combined::create (mempool=10, align=8, len=4000) at ./src/common/buffer.cc:121
	#12 ceph::buffer::v14_2_0::list::refill_append_space (this=this at entry=0x7f1d74c51480, len=len at entry=1) at ./src/common/buffer.cc:1442
	#13 0x00007f1d7ea6197a in ceph::buffer::v14_2_0::list::append (this=0x7f1d74c51480, data=0x7f1d74c513e0 "\b\024\305t\035\177", 
	    len=<optimized out>) at ./src/common/buffer.cc:1470
	#14 0x00007f1d7ea02f2c in ceph::encode_raw<unsigned char> (bl=..., t=@0x7f1d74c513e0: 8 '\b') at ./src/include/encoding.h:73
	#15 ceph::encode (features=720575940647714820, bl=..., v=@0x7f1d74c513e0: 8 '\b') at ./src/include/encoding.h:85
	#16 ceph::msgr::v2::ControlFrame<ceph::msgr::v2::HelloFrame, unsigned char, entity_addr_t>::_encode_payload_each<unsigned char const> (
	    t=@0x7f1d74c513e0: 8 '\b', this=0x7f1d74c51480) at ./src/msg/async/frames_v2.h:426
	#17 ceph::msgr::v2::ControlFrame<ceph::msgr::v2::HelloFrame, unsigned char, entity_addr_t>::_encode (args#1=..., 
	    args#0=@0x7f1d74c513e0: 8 '\b', this=0x7f1d74c51480) at ./src/msg/async/frames_v2.h:460
	#18 ceph::msgr::v2::ControlFrame<ceph::msgr::v2::HelloFrame, unsigned char, entity_addr_t>::Encode (args#1=..., 
	    args#0=@0x7f1d74c513e0: 8 '\b', this=<optimized out>) at ./src/msg/async/frames_v2.h:471
	#19 ProtocolV2::_handle_peer_banner_payload (this=0x555f054c0000, buffer=..., r=<optimized out>) at ./src/msg/async/ProtocolV2.cc:942
	#20 0x00007f1d7ea011a4 in ProtocolV2::run_continuation (this=0x555f054c0000, continuation=...) at ./src/msg/async/ProtocolV2.cc:47
	#21 0x00007f1d7e9ce0e6 in std::function<void (char*, long)>::operator()(char*, long) const (__args#1=<optimized out>, 
	    __args#0=<optimized out>, this=0x555f054b8410) at /usr/include/c++/7/bits/std_function.h:706
	#22 AsyncConnection::process (this=0x555f054b8000) at ./src/msg/async/AsyncConnection.cc:450
	#23 0x00007f1d7ea241cd in EventCenter::process_events (this=this at entry=0x555f03c4a980, timeout_microseconds=<optimized out>, 
	    timeout_microseconds at entry=30000000, working_dur=working_dur at entry=0x7f1d74c51be8) at ./src/msg/async/Event.cc:415
	#24 0x00007f1d7ea28e48 in NetworkStack::<lambda()>::operator() (__closure=0x555f03d1b988) at ./src/msg/async/Stack.cc:53
	#25 std::_Function_handler<void(), NetworkStack::add_thread(unsigned int)::<lambda()> >::_M_invoke(const std::_Any_data &) (__functor=...)
	    at /usr/include/c++/7/bits/std_function.h:316
	#26 0x00007f1d7cc596df in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
	#27 0x00007f1d7cf2c6db in start_thread (arg=0x7f1d74c54700) at pthread_create.c:463
	#28 0x00007f1d7c316a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

See	
	#4  tcmalloc::SLL_Next (t=0x67777ee60000555f) at src/linked_list.h:45
	#5  tcmalloc::SLL_Pop (list=0x555f03530628) at src/linked_list.h:59

The pointer in frame 4 is bogus,

	(gdb) x 0x555f03530628
	0x555f03530628: 0x0000555f

	(gdb) x 0x67777ee60000555f
	0x67777ee60000555f:     Cannot access memory at address 0x67777ee60000555f

-- 
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to ceph in Ubuntu.
https://bugs.launchpad.net/bugs/1921749

Title:
  nautilus: ceph radosgw beast frontend coroutine stack corruption

Status in Ubuntu Cloud Archive:
  Fix Released
Status in Ubuntu Cloud Archive train series:
  Confirmed
Status in ceph package in Ubuntu:
  Fix Released

Bug description:
  [Impact]

  The radosgw beast frontend in ceph nautilus might hit coroutine stack
  corruption on startup and requests.

  This is usually observed right at the startup of the ceph-radosgw systemd unit; sometimes 1 minute later.
  But it might occur any time handling requests, depending on coroutine/request's function path/stack size.

  The symptoms are usually a crash with stack trace listing TCMalloc (de)allocate/release to central cache,
  but less rare signs are large allocs in the _terabytes_ range (pointer to stack used as allocation size)
  and stack traces showing function return addresses (RIP) that are actually pointers to an stack address.

  This is not widely hit in Ubuntu as most deployments use the ceph-radosgw charm that hardcodes 'civetweb'
  as rgw frontend, which is _not_ affected; custom/cephadm deployments that choose 'beast' might hit this.

    @ charm-ceph-radosgw/templates/ceph.conf
          rgw frontends = civetweb port={{ port }}

  Let's report this LP bug for documentation and tracking purposes until
  UCA gets the fixes.

  [Fix]

  This has been reported by an Ubuntu Advantage user, and another user in ceph tracker #47910 [1].
  This had been reported and fixed in Octopus [2] (confirmed by UA user; no longer affected.)

  The Nautilus backport has recently been merged [3, 4] and should be
  available in v14.2.19.

  [Test Case]

  The conditions to trigger the bug aren't clear, but apparently related to EC pools w/ very large buckets,
  and of course the radosgw frontend beast being enabled (civetweb is not affected.)

  [Where problems could occur]

  The fixes are restricted to the beast frontend, specifically to the coroutines used to handle requests.
  So problems would probably be seen in request handling only with the beast frontend.
  Workarounds thus include switching back to the civetweb frontend.

  This changes core/base parts of the RGW beast frontend code, but are in place from Octopus released.
  The other user/reporter in the ceph tracker has been using the patches for weeks with no regression;
  the ceph tests have passed and likely serious issues would be caught by ceph CI upstream.

  [1] https://tracker.ceph.com/issues/47910 report tracker (nautilus)
  [2] https://tracker.ceph.com/issues/43739 master tracker (octopus)
  [3] https://tracker.ceph.com/issues/43921 backport tracker (nautilus)
  [4] https://github.com/ceph/ceph/pull/39947 github PR

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-archive/+bug/1921749/+subscriptions



More information about the Ubuntu-openstack-bugs mailing list