Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash under dnf5daemon::DownloadCB::create_signal_download() #2015

Open
mcrha opened this issue Jan 20, 2025 · 0 comments
Open

Crash under dnf5daemon::DownloadCB::create_signal_download() #2015

mcrha opened this issue Jan 20, 2025 · 0 comments

Comments

@mcrha
Copy link
Contributor

mcrha commented Jan 20, 2025

This is with git main at commit 50e84a8. I tried to install a gnucash through the dnf5daemon's session and it crashed with the following backtrace:

Thread 51 "dnf5daemon-serv" received signal SIGSEGV, Segmentation fault.

#0  0x00007ffff413a209 in message_append_basic.lto_priv () at /lib64/libsystemd.so.0
#1  0x00007ffff7f7c153 in sdbus::Message::operator<<(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () at /lib64/libsdbus-c++.so.1
#2  0x000000000046098d in dnf5daemon::DownloadCB::create_signal_download (this=this@entry=0x7fffe43bdef0, signal_name="download_end", user_data=user_data@entry=0x7fffb8455060)
    at .../dnf5/dnf5daemon-server/callbacks.cpp:52
#3  0x0000000000461564 in dnf5daemon::DownloadCB::end (this=0x7fffe43bdef0, user_cb_data=0x7fffb8455060, status=libdnf5::repo::DownloadCallbacks::TransferStatus::ERROR, msg=0x7ffff6b6706f "Interrupted")
    at .../dnf5/dnf5daemon-server/callbacks.cpp:86
#4  0x00007ffff646f637 in libdnf5::repo::PackageTarget::~PackageTarget (this=0x7fffb8011fa0, __in_chrg=<optimized out>) at .../dnf5/libdnf5/repo/package_downloader.cpp:61
#5  std::destroy_at<libdnf5::repo::PackageTarget> (__location=0x7fffb8011fa0) at /usr/include/c++/14/bits/stl_construct.h:88
#6  std::_Destroy<libdnf5::repo::PackageTarget> (__pointer=0x7fffb8011fa0) at /usr/include/c++/14/bits/stl_construct.h:149
#7  std::_Destroy_aux<false>::__destroy<libdnf5::repo::PackageTarget*> (__first=0x7fffb8011fa0, __last=0x7fffb80128a0) at /usr/include/c++/14/bits/stl_construct.h:163
#8  std::_Destroy<libdnf5::repo::PackageTarget*> (__first=<optimized out>, __last=0x7fffb80128a0) at /usr/include/c++/14/bits/stl_construct.h:196
#9  std::_Destroy<libdnf5::repo::PackageTarget*, libdnf5::repo::PackageTarget> (__first=<optimized out>, __last=0x7fffb80128a0) at /usr/include/c++/14/bits/alloc_traits.h:944
#10 std::vector<libdnf5::repo::PackageTarget, std::allocator<libdnf5::repo::PackageTarget> >::~vector (this=0x7fffb80138b0, __in_chrg=<optimized out>) at /usr/include/c++/14/bits/stl_vector.h:735
#11 libdnf5::repo::PackageDownloader::Impl::~Impl (this=0x7fffb80138a0, __in_chrg=<optimized out>) at .../dnf5/libdnf5/repo/package_downloader.cpp:107
#12 std::default_delete<libdnf5::repo::PackageDownloader::Impl>::operator() (this=0x7fffce9ff6f0, __ptr=0x7fffb80138a0) at /usr/include/c++/14/bits/unique_ptr.h:93
#13 std::default_delete<libdnf5::repo::PackageDownloader::Impl>::operator() (this=0x7fffce9ff6f0, __ptr=0x7fffb80138a0) at /usr/include/c++/14/bits/unique_ptr.h:87
#14 std::unique_ptr<libdnf5::repo::PackageDownloader::Impl, std::default_delete<libdnf5::repo::PackageDownloader::Impl> >::~unique_ptr (this=0x7fffce9ff6f0, __in_chrg=<optimized out>) at /usr/include/c++/14/bits/unique_ptr.h:398
#15 libdnf5::repo::PackageDownloader::~PackageDownloader (this=this@entry=0x7fffce9ff6f0, __in_chrg=<optimized out>) at .../dnf5/libdnf5/repo/package_downloader.cpp:125
#16 0x00000000004238c2 in Session::download_transaction_packages (this=this@entry=0x7fffe4001d80) at /usr/include/c++/14/bits/allocator.h:182
#17 0x00000000004fc2a9 in Goal::do_transaction (this=0x7fffe43aa330, call=...) at .../dnf5/dnf5daemon-server/services/goal/goal.cpp:313
#18 0x000000000051514f in ThreadsManager::handle_method<Goal>(Goal&, sdbus::MethodReply (Goal::*)(sdbus::MethodCall&), sdbus::MethodCall&, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >)::{lambda(Goal&, sdbus::MethodReply (Goal::*)(sdbus::MethodCall&), sdbus::MethodCall, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >)#1}::operator()(Goal&, sdbus::MethodReply (Goal::*)(sdbus::MethodCall&), sdbus::MethodCall, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >) const
    (__closure=__closure@entry=0x8bb758, service=..., method=<optimized out>, call=..., thread_locale=std::optional [no contained value]) at .../dnf5/dnf5daemon-server/./threads_manager.hpp:68
#19 0x000000000051684b in std::__invoke_impl<void, ThreadsManager::handle_method<Goal>(Goal&, sdbus::MethodReply (Goal::*)(sdbus::MethodCall&), sdbus::MethodCall&, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >)::{lambda(Goal&, sdbus::MethodReply (Goal::*)(sdbus::MethodCall&), sdbus::MethodCall, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >)#1}, std::reference_wrapper<Goal>, sdbus::MethodReply (Goal::*)(sdbus::MethodCall&), sdbus::MethodCall, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >(std::__invoke_other, ThreadsManager::handle_method<Goal>(Goal&, sdbus::MethodReply (Goal::*)(sdbus::MethodCall&), sdbus::MethodCall&, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >)::{lambda(Goal&, sdbus::MethodReply (Goal::*&&)(sdbus::MethodCall&), sdbus::MethodCall, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >)#1}, std::reference_wrapper<Goal>&&, sdbus::MethodReply (Goal::*&&)(sdbus::MethodCall&), sdbus::MethodCall&&, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&&) (__f=...) at /usr/include/c++/14/bits/invoke.h:61
#20 std::__invoke<ThreadsManager::handle_method<Goal>(Goal&, sdbus::MethodReply (Goal::*)(sdbus::MethodCall&), sdbus::MethodCall&, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >)::{lambda(Goal&, sdbus::MethodReply (Goal::*)(sdbus::MethodCall&), sdbus::MethodCall, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >)#1}, std::reference_wrapper<Goal>, sdbus::MethodReply (Goal::*)(sdbus::MethodCall&), sdbus::MethodCall, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >(Goal&&, std::reference_wrapper<Goal>&&, sdbus::MethodReply (Goal::*&&)(sdbus::MethodCall&), sdbus::MethodCall&&, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&&) (__fn=...) at /usr/include/c++/14/bits/invoke.h:96
#21 std::thread::_Invoker<std::tuple<ThreadsManager::handle_method<Goal>(Goal&, sdbus::MethodReply (Goal::*)(sdbus::MethodCall&), sdbus::MethodCall&, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >)::{lambda(Goal&, sdbus::MethodReply (Goal::*)(sdbus::MethodCall&), sdbus::MethodCall, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >)#1}, std::reference_wrapper<Goal>, sdbus::MethodReply (Goal::*)(sdbus::MethodCall&), sdbus::MethodCall, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::_M_invoke<0ul, 1ul, 2ul, 3ul, 4ul>(std::_Index_tuple<0ul, 1ul, 2ul, 3ul, 4ul>)
    (this=0x8bb6f8) at /usr/include/c++/14/bits/std_thread.h:301
#22 std::thread::_Invoker<std::tuple<ThreadsManager::handle_method<Goal>(Goal&, sdbus::MethodReply (Goal::*)(sdbus::MethodCall&), sdbus::MethodCall&, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >)::{lambda(Goal&, sdbus::MethodReply (Goal::*)(sdbus::MethodCall&), sdbus::MethodCall, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >)#1}, std::reference_wrapper<Goal>, sdbus::MethodReply (Goal::*)(sdbus::MethodCall&), sdbus::MethodCall, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::operator()() (this=0x8bb6f8) at /usr/include/c++/14/bits/std_thread.h:308
#23 std::thread::_State_impl<std::thread::_Invoker<std::tuple<ThreadsManager::handle_method<Goal>(Goal&, sdbus::MethodReply (Goal::*)(sdbus::MethodCall&), sdbus::MethodCall&, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >)::{lambda(Goal&, sdbus::MethodReply (Goal::*)(sdbus::MethodCall&), sdbus::MethodCall, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >)#1}, std::reference_wrapper<Goal>, sdbus::MethodReply (Goal::*)(sdbus::MethodCall&), sdbus::MethodCall, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >::_M_run() (this=0x8bb6f0)
    at /usr/include/c++/14/bits/std_thread.h:253
#24 0x00007ffff3ee7564 in execute_native_thread_routine () at /lib64/libstdc++.so.6
#25 0x00007ffff3ca91b7 in start_thread () at /lib64/libc.so.6
#26 0x00007ffff3d2b39c in clone3 () at /lib64/libc.so.6

(gdb) f 2
#2  0x000000000046098d in dnf5daemon::DownloadCB::create_signal_download (this=this@entry=0x7fffe43bdef0, signal_name="download_end", user_data=user_data@entry=0x7fffb8455060)
    at .../dnf5/dnf5daemon-server/callbacks.cpp:52
52	        signal << data->download_id;
(gdb) p data
$1 = (dnf5daemon::DownloadUserData *) 0x7fffb8455060
(gdb) p *data
$2 = {download_id = <error: Cannot access memory at address 0x7ff847becbc5>}
(gdb) l
47	
48	sdbus::Signal DownloadCB::create_signal_download(const std::string & signal_name, void * user_data) {
49	    auto signal = create_signal(dnfdaemon::INTERFACE_BASE, signal_name);
50	    if (user_data) {
51	        auto * data = reinterpret_cast<DownloadUserData *>(user_data);
52	        signal << data->download_id;
53	    }
54	    return signal;
55	}
56	
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant