openbmc / bmcweb

A do everything Redfish, KVM, GUI, and DBus webserver for OpenBMC
Apache License 2.0
154 stars 131 forks source link

Crash in ~InProgressActionData() #215

Closed leiyu-bytedance closed 3 years ago

leiyu-bytedance commented 3 years ago

Describe the bug The bmcweb crashes in ~InProgressActionData()

Environment The build is on 67d90e92a

To Reproduce No stable reproduce steps, it happens when the WebUI is opened (and probably it's fetching sensors), and use REST API to delete a software object.

Is this a regression Probably no, the issue occurs rarely, and it may only occur when bmcweb is super busy.

Stack trace:

#0  0x0000002a in ?? ()
#1  0x004718f0 in crow::openbmc_mapper::InProgressActionData::~InProgressActionData (this=<optimized out>, this=<optimized out>) at ../git/include/openbmc_dbus_rest.hpp:451
#2  0x004b5540 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x1fa3ef0)
    at /extra/leiyu/openbmc/build/tmp/work/arm1176jzs-openbmc-linux-gnueabi/bmcweb/1.0+gitAUTOINC+fe4b30937d-r0/recipe-sysroot/usr/include/c++/11.1.1/bits/shared_ptr_base.h:168
#3  0x004a4d18 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=<optimized out>, this=<optimized out>)
    at /extra/leiyu/openbmc/build/tmp/work/arm1176jzs-openbmc-linux-gnueabi/bmcweb/1.0+gitAUTOINC+fe4b30937d-r0/recipe-sysroot/usr/include/c++/11.1.1/bits/shared_ptr_base.h:705
#4  0x0066164c in sdbusplus::asio::detail::async_send_handler<crow::openbmc_mapper::findActionOnInterface(std::shared_ptr<crow::openbmc_mapper::InProgressActionData> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)::{lambda(boost::system::error_code, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}::operator()(boost::system::error_code, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const::{lambda(boost::system::error_code, sdbusplus::message::message&)#1}>::~async_send_handler() (this=<optimized out>, this=<optimized out>)
    at /extra/leiyu/openbmc/build/tmp/work/arm1176jzs-openbmc-linux-gnueabi/bmcweb/1.0+gitAUTOINC+fe4b30937d-r0/recipe-sysroot/usr/include/sdbusplus/asio/detail/async_send_handler.hpp:31
#5  std::default_delete<sdbusplus::asio::detail::async_send_handler<crow::openbmc_mapper::findActionOnInterface(std::shared_ptr<crow::openbmc_mapper::InProgressActionData> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)::{lambda(boost::system::error_code, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}::operator()(boost::system::error_code, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const::{lambda(boost::system::error_code, sdbusplus::message::message&)#1}> >::operator()(sdbusplus::asio::detail::async_send_handler<crow::openbmc_mapper::findActionOnInterface(std::shared_ptr<crow::openbmc_mapper::InProgressActionData> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)::{lambda(boost::system::error_code, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}::operator()(boost::system::error_code, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const::{lambda(boost::system::error_code, sdbusplus::message::message&)#1}>*) const (
    this=<optimized out>, __ptr=0x2168340)
    at /extra/leiyu/openbmc/build/tmp/work/arm1176jzs-openbmc-linux-gnueabi/bmcweb/1.0+gitAUTOINC+fe4b30937d-r0/recipe-sysroot/usr/include/c++/11.1.1/bits/unique_ptr.h:85
#6  std::default_delete<sdbusplus::asio::detail::async_send_handler<crow::openbmc_mapper::findActionOnInterface(std::shared_ptr<crow::openbmc_mapper::InProgressActionData> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)::{lambda(boost::system::error_code, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}::operator()(boost::system::error_code, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const::{lambda(boost::system::error_code, sdbusplus::message::message&)#1}> >::operator()(sdbusplus::asio::detail::async_send_handler<crow::openbmc_mapper::findActionOnInterface(std::shared_ptr<crow::openbmc_mapper::InProgressActionData> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)::{lambda(boost::system::error_code, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}::operator()(boost::system::error_code, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const::{lambda(boost::system::error_code, sdbusplus::message::message&)#1}>*) const (
    this=<optimized out>, __ptr=0x2168340)
    at /extra/leiyu/openbmc/build/tmp/work/arm1176jzs-openbmc-linux-gnueabi/bmcweb/1.0+gitAUTOINC+fe4b30937d-r0/recipe-sysroot/usr/include/c++/11.1.1/bits/unique_ptr.h:79
#7  std::unique_ptr<sdbusplus::asio::detail::async_send_handler<crow::openbmc_mapper::findActionOnInterface(std::shared_ptr<crow::openbmc_mapper::InProgressActionData> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)::{lambda(boost::system::error_code, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}::operator()(boost::system::error_code, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const::{lambda(boost::system::error_code, sdbusplus::message::message&)#1}>, std::default_delete<sdbusplus::asio::detail::async_send_handler<crow::openbmc_mapper::findActionOnInterface(std::shared_ptr<crow::openbmc_mapper::InProgressActionData> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)::{lambda(boost::system::error_code, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}::operator()(boost::system::error_code, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const::{lambda(boost::system::error_code, sdbusplus::message::message&)#1}> > >::~unique_ptr() [clone .isra.0] (this=<optimized out>, this=<optimized out>)
    at /extra/leiyu/openbmc/build/tmp/work/arm1176jzs-openbmc-linux-gnueabi/bmcweb/1.0+gitAUTOINC+fe4b30937d-r0/recipe-sysroot/usr/include/c++/11.1.1/bits/unique_ptr.h:361
#8  0x004eb010 in sdbusplus::asio::detail::async_send_handler<crow::openbmc_mapper::findActionOnInterface(std::shared_ptr<crow::openbmc_mapper::InProgressActionData> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)::{lambda(boost::system::error_code, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}::operator()(boost::system::error_code, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const::{lambda(boost::system::error_code, sdbusplus::message::message&)#1}>::callback(sd_bus_message*, void*, sd_bus_error*) (mesg=mesg@entry=0x0, userdata=<optimized out>)
    at /extra/leiyu/openbmc/build/tmp/work/arm1176jzs-openbmc-linux-gnueabi/bmcweb/1.0+gitAUTOINC+fe4b30937d-r0/recipe-sysroot/usr/include/sdbusplus/asio/detail/async_send_handler.hpp:66
#9  0x76cd03d4 in process_reply (m=0x0, bus=<optimized out>) at ../git/src/libsystemd/sd-bus/sd-bus.c:2764
#10 process_message (m=0x2112280, bus=<optimized out>) at ../git/src/libsystemd/sd-bus/sd-bus.c:2942
#11 process_running (ret=0x0, bus=<optimized out>) at ../git/src/libsystemd/sd-bus/sd-bus.c:3004
#12 bus_process_internal (bus=<optimized out>, ret=0x0) at ../git/src/libsystemd/sd-bus/sd-bus.c:3224
#13 0x00465e8c in sdbusplus::bus::bus::process_discard (this=<optimized out>)
    at /extra/leiyu/openbmc/build/tmp/work/arm1176jzs-openbmc-linux-gnueabi/bmcweb/1.0+gitAUTOINC+fe4b30937d-r0/recipe-sysroot/usr/include/sdbusplus/bus.hpp:217
#14 0x00466190 in sdbusplus::asio::connection::read_immediate()::{lambda()#1}::operator()() const (__closure=0x7eadb494)
    at /extra/leiyu/openbmc/build/tmp/work/arm1176jzs-openbmc-linux-gnueabi/bmcweb/1.0+gitAUTOINC+fe4b30937d-r0/recipe-sysroot/usr/include/sdbusplus/asio/connection.hpp:354
#15 0x0051cbc0 in boost_asio_handler_invoke_helpers::invoke<sdbusplus::asio::connection::read_immediate()::{lambda()#1}, sdbusplus::asio::connection::read_immediate()::{lambda()#1}>(sdbusplus::asio::connection::read_immediate()::{lambda()#1}&, sdbusplus::asio::connection::read_immediate()::{lambda()#1}&) (context=..., function=...)
    at /extra/leiyu/openbmc/build/tmp/work/arm1176jzs-openbmc-linux-gnueabi/bmcweb/1.0+gitAUTOINC+fe4b30937d-r0/recipe-sysroot/usr/include/boost/asio/detail/handler_invoke_helpers.hpp:42
#16 boost::asio::detail::executor_op<sdbusplus::asio::connection::read_immediate()::{lambda()#1}, std::allocator<void>, boost::asio::detail::scheduler_operation>::do_complete(void*, boost::asio::detail::scheduler_operation*, boost::system::error_code const&, unsigned int) (owner=owner@entry=0x1efe678, base=base@entry=0x1fae0d0)
    at /extra/leiyu/openbmc/build/tmp/work/arm1176jzs-openbmc-linux-gnueabi/bmcweb/1.0+gitAUTOINC+fe4b30937d-r0/recipe-sysroot/usr/include/boost/asio/detail/executor_op.hpp:70
#17 0x00456a7c in boost::asio::detail::scheduler_operation::complete (bytes_transferred=0, ec=..., owner=0x1efe678, this=0x1fae0d0)
    at /extra/leiyu/openbmc/build/tmp/work/arm1176jzs-openbmc-linux-gnueabi/bmcweb/1.0+gitAUTOINC+fe4b30937d-r0/recipe-sysroot/usr/include/boost/asio/detail/scheduler_operation.hpp:40
#18 boost::asio::detail::scheduler::do_run_one (ec=..., this_thread=..., lock=..., this=<optimized out>)
    at /extra/leiyu/openbmc/build/tmp/work/arm1176jzs-openbmc-linux-gnueabi/bmcweb/1.0+gitAUTOINC+fe4b30937d-r0/recipe-sysroot/usr/include/boost/asio/detail/impl/scheduler.ipp:486
#19 boost::asio::detail::scheduler::run (ec=..., this=0x1efe678)
    at /extra/leiyu/openbmc/build/tmp/work/arm1176jzs-openbmc-linux-gnueabi/bmcweb/1.0+gitAUTOINC+fe4b30937d-r0/recipe-sysroot/usr/include/boost/asio/detail/impl/scheduler.ipp:204
#20 boost::asio::io_context::run (this=<optimized out>, this=<optimized out>)
    at /extra/leiyu/openbmc/build/tmp/work/arm1176jzs-openbmc-linux-gnueabi/bmcweb/1.0+gitAUTOINC+fe4b30937d-r0/recipe-sysroot/usr/include/boost/asio/impl/io_context.ipp:63
#21 main () at ../git/src/webserver_main.cpp:139
edtanous commented 3 years ago

Please list the system type this was found on, as is asked in the bug template.

leiyu-bytedance commented 3 years ago

It's a similar case as https://github.com/openbmc/bmcweb/issues/218 that it happens on a downstream system. @edtanous You could close this bug as you want, but I believe such issue occurs on upstream bmcweb as well, it's just not reported.

edtanous commented 3 years ago

If you reproduce it on an upstream system (including qemu) please let me know and I'll be happy to reopen this, but it's very difficult to debug issues when we don't have the code or can see the configuration for your system.