Closed gulafaran closed 6 months ago
i sometimes see a coredump has appeared from xdg-desktop-portal-hyprland
Core was generated by `/usr/libexec/xdg-desktop-portal-hyprland'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007ffff7f36415 in ?? () from /usr/lib64/libsdbus-c++.so.1 >>> bt #0 0x00007ffff7f36415 in ?? () from /usr/lib64/libsdbus-c++.so.1 #1 0x00007ffff7f3cde8 in ?? () from /usr/lib64/libsdbus-c++.so.1 #2 0x00007ffff7f3bfcb in ?? () from /usr/lib64/libsdbus-c++.so.1 #3 0x00007ffff7f3ab2d in ?? () from /usr/lib64/libsdbus-c++.so.1 #4 0x00007ffff7f4069f in std::function<void (void*)>::operator()(void*) const () from /usr/lib64/libsdbus-c++.so.1 #5 0x00007ffff7f3ea82 in std::unique_ptr<void, std::function<void (void*)> >::~unique_ptr() () from /usr/lib64/libsdbus-c++.so.1 #6 0x00007ffff7f572f4 in sdbus::internal::Object::InterfaceData::~InterfaceData() () from /usr/lib64/libsdbus-c++.so.1 #7 0x00007ffff7f57352 in std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sdbus::internal::Object::InterfaceData>::~pair() () from /usr/lib64/libsdbus-c++.so.1 #8 0x00007ffff7f54900 in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sdbus::internal::Object::InterfaceData>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sdbus::internal::Object::InterfaceData> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sdbus::internal::Object::InterfaceData> > >::_M_destroy_node(std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sdbus::internal::Object::InterfaceData> >*) () from /usr/lib64/libsdbus-c++.so.1 #9 0x00007ffff7f525bd in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sdbus::internal::Object::InterfaceData>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sdbus::internal::Object::InterfaceData> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sdbus::internal::Object::InterfaceData> > >::_M_drop_node(std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sdbus::internal::Object::InterfaceData> >*) () from /usr/lib64/libsdbus-c++.so.1 #10 0x00007ffff7f513f3 in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sdbus::internal::Object::InterfaceData>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sdbus::internal::Object::InterfaceData> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sdbus::internal::Object::InterfaceData> > >::_M_erase(std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sdbus::internal::Object::InterfaceData> >*) () from /usr/lib64/libsdbus-c++.so.1 #11 0x00007ffff7f4f9f8 in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sdbus::internal::Object::InterfaceData>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sdbus::internal::Object::InterfaceData> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sdbus::internal::Object::InterfaceData> > >::~_Rb_tree() () from /usr/lib64/libsdbus-c++.so.1 #12 0x00007ffff7f4f166 in std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, sdbus::internal::Object::InterfaceData, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sdbus::internal::Object::InterfaceData> > >::~map() () from /usr/lib64/libsdbus-c++.so.1 #13 0x00007ffff7f522d0 in sdbus::internal::Object::~Object() () from /usr/lib64/libsdbus-c++.so.1 #14 0x00007ffff7f52308 in sdbus::internal::Object::~Object() () from /usr/lib64/libsdbus-c++.so.1 #15 0x0000555555576e94 in std::default_delete<sdbus::IObject>::operator() (this=0x5555556657e0, __ptr=0x55555564cfb0) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/unique_ptr.h:99 #16 0x0000555555571718 in std::unique_ptr<sdbus::IObject, std::default_delete<sdbus::IObject> >::~unique_ptr (this=0x5555556657e0, __in_chrg=<optimized out>) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/unique_ptr.h:404 #17 0x0000555555577f18 in CScreenshotPortal::~CScreenshotPortal (this=0x5555556657e0, __in_chrg=<optimized out>) at /var/tmp/portage/gui-libs/xdg-desktop-portal-hyprland-9999/work/xdg-desktop-portal-hyprland-9999/src/core/../portals/Screenshot.hpp:6 #18 0x0000555555577f3e in std::default_delete<CScreenshotPortal>::operator() (this=0x55555564b2f0, __ptr=0x5555556657e0) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/unique_ptr.h:99 #19 0x0000555555572474 in std::unique_ptr<CScreenshotPortal, std::default_delete<CScreenshotPortal> >::~unique_ptr (this=0x55555564b2f0, __in_chrg=<optimized out>) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/unique_ptr.h:404 #20 0x000055555556ef80 in CPortalManager::{unnamed type#2}::~CPortalManager() (this=0x55555564b2e8, __in_chrg=<optimized out>) at /var/tmp/portage/gui-libs/xdg-desktop-portal-hyprland-9999/work/xdg-desktop-portal-hyprland-9999/src/core/PortalManager.hpp:48 #21 0x0000555555582a4a in CPortalManager::~CPortalManager (this=0x55555564b2e0, __in_chrg=<optimized out>) at /var/tmp/portage/gui-libs/xdg-desktop-portal-hyprland-9999/work/xdg-desktop-portal-hyprland-9999/src/core/PortalManager.hpp:32 #22 0x0000555555582a70 in std::default_delete<CPortalManager>::operator() (this=0x5555556387b0 <g_pPortalManager>, __ptr=0x55555564b2e0) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/unique_ptr.h:99 #23 0x0000555555581f66 in std::unique_ptr<CPortalManager, std::default_delete<CPortalManager> >::~unique_ptr (this=0x5555556387b0 <g_pPortalManager>, __in_chrg=<optimized out>) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/unique_ptr.h:404 #24 0x00007ffff783e8e5 in ?? () from /usr/lib64/libc.so.6 #25 0x00007ffff783ea2a in exit () from /usr/lib64/libc.so.6 #26 0x00007ffff7826e3e in ?? () from /usr/lib64/libc.so.6 #27 0x00007ffff7826ef7 in __libc_start_main () from /usr/lib64/libc.so.6 #28 0x0000555555567f61 in _start ()
its inside libsdbus-c++ but i wonder if it isnt because PortalManager is destructed and the unique_ptr for m_pConnection is freed, and that creates some kind of race/stale ptr because its used here https://github.com/hyprwm/xdg-desktop-portal-hyprland/blob/master/src/portals/Screenshot.cpp#L104 and i think calling https://github.com/Kistler-Group/sdbus-cpp/blob/e62472b210d9e7f06a5e611c23471d414c99a99c/src/Object.cpp#L80 would help however portalmanager is destructed before the portals, so some kind of destruction logic needs a bit of an rewrite
i sometimes see a coredump has appeared from xdg-desktop-portal-hyprland
its inside libsdbus-c++ but i wonder if it isnt because PortalManager is destructed and the unique_ptr for m_pConnection is freed, and that creates some kind of race/stale ptr because its used here https://github.com/hyprwm/xdg-desktop-portal-hyprland/blob/master/src/portals/Screenshot.cpp#L104 and i think calling https://github.com/Kistler-Group/sdbus-cpp/blob/e62472b210d9e7f06a5e611c23471d414c99a99c/src/Object.cpp#L80 would help however portalmanager is destructed before the portals, so some kind of destruction logic needs a bit of an rewrite