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

Closing windows with plugin decoration on touchscreen causes a segfault #2150

Closed
spl237 opened this issue Feb 19, 2024 · 3 comments
Closed
Labels

Comments

@spl237
Copy link

spl237 commented Feb 19, 2024

Describe the bug
If a window is decorated with the decoration plugin, and the 'close' button on the headerbar is tapped on a touchscreen, wayfire crashes

To Reproduce
Steps to reproduce the behavior:

  1. Enable decoration plugin
  2. Open an XWayland application such as VLC
  3. Move the application's window onto a touchscreen
  4. Touch the 'close' button on the headerbar
  5. Wayfire crashes

Expected behavior
The window should close cleanly

Screenshots or stacktrace
Thread 1 "wayfire" received signal SIGSEGV, Segmentation fault.
0x0000007ff7840d24 in __dynamic_cast ()
from target:/lib/aarch64-linux-gnu/libstdc++.so.6
(gdb) bt
#0 0x0000007ff7840d24 in __dynamic_cast ()
from target:/lib/aarch64-linux-gnu/libstdc++.so.6
#1 0x000000555583a3d4 in wf::compositor_surface_from_surface (
surface=0x5556c2d6f0) at ../src/view/view-impl.cpp:604
#2 0x000000555580fe6c in wf::touch_interface_t::set_touch_focus (
this=0x55559bccf0, surface=0x5556b229a8, id=0, time=161377, point=...)
at ../src/core/seat/touch.cpp:183
#3 0x0000005555810498 in wf::touch_interface_t::handle_touch_motion (
this=0x55559bccf0, id=0, time=161377, point=..., is_real_event=false,
mode=wf::input_event_processing_mode_t::FULL)
at ../src/core/seat/touch.cpp:313
#4 0x000000555580f548 in operator() (__closure=0x5556396850,
data=0x7fffffe120) at ../src/core/seat/touch.cpp:85
#5 0x0000005555812cf4 in std::__invoke_impl<void, wf::touch_interface_t::touch_interface_t(wlr_cursor*, wlr_seat*, wf::input_surface_selector_t)::<lambda(wf::signal_data_t*)>&, wf::signal_data_t*>(std::__invoke_other, struct {...} &) (
__f=...) at /usr/include/c++/12/bits/invoke.h:61
#6 0x00000055558124d4 in std::__invoke_r<void, wf::touch_interface_t::touch_interface_t(wlr_cursor*, wlr_seat*, wf::input_surface_selector_t)::<lambda(wf::signal_data_t*)>&, wf::signal_data_t*>(struct {...} &) (__fn=...)
at /usr/include/c++/12/bits/invoke.h:111
#7 0x0000005555811b3c in std::_Function_handler<void(wf::signal_data_t*), wf::touch_interface_t::touch_interface_t(wlr_cursor*, wlr_seat*, wf::input_surface_selector_t)::<lambda(wf::signal_data_t*)> >::_M_invoke(const std::_Any_data &, wf::signal_data_t &&) (__functor=..., __args#0=@0x7fffffdf10: 0x7fffffe120)
at /usr/include/c++/12/bits/std_function.h:290
#8 0x000000555579fd20 in std::function<void (wf::signal_data_t
)>::operator()(wf::signal_data_t*) const (this=0x5556396850, __args#0=0x7fffffe120)
at /usr/include/c++/12/bits/std_function.h:591
#9 0x000000555579d964 in wf::signal_connection_t::emit (this=0x55559bce80, data=0x7fffffe120) at ../src/core/object.cpp:47
#10 0x000000555579dde4 in operator()wf::signal_connection_t* (__closure=0x7fffffe0a0, call=0x55559bce80) at ../src/core/object.cpp:130
#11 0x000000555579f254 in std::__invoke_impl<void, wf::signal_provider_t::emit_signal(std::string, wf::signal_data_t*)::<lambda(auto:2)>&, wf::signal_connection_t*&>(std::__invoke_other, struct {...} &) (__f=...) at /usr/include/c++/12/bits/invoke.h:61
#12 0x000000555579ed6c in std::__invoke_r<void, wf::signal_provider_t::emit_signal(std::string, wf::signal_data_t*)::<lambda(auto:2)>&, wf::signal_connection_t*&>(struct {...} &) (__fn=...) at /usr/include/c++/12/bits/invoke.h:111
#13 0x000000555579e7bc in std::_Function_handler<void(wf::signal_connection_t*&), wf::signal_provider_t::emit_signal(std::string, wf::signal_data_t*)::<lambda(auto:2)> >::_M_invoke(const std::_Any_data &, wf::signal_connection_t &) (__functor=..., __args#0=@0x55563ce240: 0x55559bce80)
at /usr/include/c++/12/bits/std_function.h:290
#14 0x00000055557a1988 in std::function<void (wf::signal_connection_t
&)>::operator()(wf::signal_connection_t*&) const (this=0x7fffffe0a0,
__args#0=@0x55563ce240: 0x55559bce80) at /usr/include/c++/12/bits/std_function.h:591
#15 0x00000055557a0420 in wf::safe_list_twf::signal_connection_t*::for_each(std::function<void (wf::signal_connection_t*&)>) const (this=0x55563ce2c8, func=...)
at ../src/api/wayfire/nonstd/safe-list.hpp:203
#16 0x000000555579de74 in wf::signal_provider_t::emit_signal (this=0x55559718e0 wf::compositor_core_impl_t::get()::instance, name=..., data=0x7fffffe120)
at ../src/core/object.cpp:128
#17 0x00000055558883f8 in wf::workspace_manager::impl::emit_stack_order_changed (this=0x55569b49a0) at ../src/output/workspace-impl.cpp:979
#18 0x0000005555888648 in wf::workspace_manager::impl::update_promoted_views (this=0x55569b49a0) at ../src/output/workspace-impl.cpp:1014
#19 0x0000005555887934 in wf::workspace_manager::impl::on_view_state_updated::{lambda(wf::signal_data_t*)#1}::operator()(wf::workspace_manager::impl::on_view_state_updated) const (__closure=0x555682f6a0) at ../src/output/workspace-impl.cpp:884
#20 0x0000005555890e48 in std::__invoke_impl<void, wf::workspace_manager::impl::on_view_state_updated::{lambda(wf::signal_data_t*)#1}&, wf::workspace_manager::impl::on_view_state_updated>(std::__invoke_other, wf::workspace_manager::impl::on_view_state_updated::{lambda(wf::signal_data_t*)#1}&, wf::workspace_manager::impl::on_view_state_updated&&) (__f=...) at /usr/include/c++/12/bits/invoke.h:61
#21 0x000000555588fecc in std::__invoke_r<void, wf::workspace_manager::impl::on_view_state_updated::{lambda(wf::signal_data_t*)#1}&, wf::workspace_manager::impl::on_view_state_updated>(std::enable_if&&, (void&&)...) (__fn=...) at /usr/include/c++/12/bits/invoke.h:111
#22 0x000000555588e2b4 in std::_Function_handler<void (wf::signal_data_t*), wf::workspace_manager::impl::on_view_state_updated::{lambda(wf::signal_data_t*)#1}>::_M_invoke(std::_Any_data const&, wf::signal_data_t*&&) (__functor=..., __args#0=@0x7fffffe310: 0x7fffffe528) at /usr/include/c++/12/bits/std_function.h:290
#23 0x000000555579fd20 in std::function<void (wf::signal_data_t*)>::operator()(wf::signal_data_t*) const (this=0x555682f6a0, __args#0=0x7fffffe528)
at /usr/include/c++/12/bits/std_function.h:591
#24 0x000000555579d964 in wf::signal_connection_t::emit (this=0x55569b49f8, data=0x7fffffe528) at ../src/core/object.cpp:47
#25 0x000000555579dde4 in operator()wf::signal_connection_t* (__closure=0x7fffffe4a0, call=0x55569b49f8) at ../src/core/object.cpp:130
#26 0x000000555579f254 in std::__invoke_impl<void, wf::signal_provider_t::emit_signal(std::string, wf::signal_data_t*)::<lambda(auto:2)>&, wf::signal_connection_t*&>(std::__invoke_other, struct {...} &) (__f=...) at /usr/include/c++/12/bits/invoke.h:61
#27 0x000000555579ed6c in std::__invoke_r<void, wf::signal_provider_t::emit_signal(std::string, wf::signal_data_t*)::<lambda(auto:2)>&, wf::signal_connection_t*&>(struct {...} &) (__fn=...) at /usr/include/c++/12/bits/invoke.h:111
#28 0x000000555579e7bc in std::_Function_handler<void(wf::signal_connection_t*&), wf::signal_provider_t::emit_signal(std::string, wf::signal_data_t*)::<lambda(auto:2)> >::_M_invoke(const std::_Any_data &, wf::signal_connection_t &) (__functor=..., __args#0=@0x555682fdd0: 0x55569b49f8)
at /usr/include/c++/12/bits/std_function.h:290
#29 0x00000055557a1988 in std::function<void (wf::signal_connection_t
&)>::operator()(wf::signal_connection_t*&) const (this=0x7fffffe4a0,
__args#0=@0x555682fdd0: 0x55569b49f8) at /usr/include/c++/12/bits/std_function.h:591
#30 0x00000055557a0420 in wf::safe_list_twf::signal_connection_t*::for_each(std::function<void (wf::signal_connection_t*&)>) const (this=0x55568310a8, func=...)
at ../src/api/wayfire/nonstd/safe-list.hpp:203
#31 0x000000555579de74 in wf::signal_provider_t::emit_signal (this=0x555599c5d0, name=..., data=0x7fffffe528) at ../src/core/object.cpp:128
--Type for more, q to quit, c to continue without paging--
#32 0x00000055558395f4 in wf::view_interface_t::emit_view_unmap (this=0x5556b74e38) at ../src/view/view-impl.cpp:396
#33 0x00000055558392e8 in wf::wlr_view_t::unmap (this=0x5556b74d40) at ../src/view/view-impl.cpp:365
#34 0x000000555583d524 in operator() (__closure=0x5556b75090) at ../src/view/xdg-shell.cpp:208
#35 0x0000005555844698 in std::__invoke_impl<void, wayfire_xdg_view::initialize()::<lambda(void*)>&, void*>(std::__invoke_other, struct {...} &) (__f=...)
at /usr/include/c++/12/bits/invoke.h:61
#36 0x000000555584272c in std::__invoke_r<void, wayfire_xdg_view::initialize()::<lambda(void*)>&, void*>(struct {...} &) (__fn=...)
at /usr/include/c++/12/bits/invoke.h:111
#37 0x0000005555840684 in std::_Function_handler<void(void*), wayfire_xdg_view::initialize()::<lambda(void*)> >::_M_invoke(const std::_Any_data &, void &&) (
__functor=..., __args#0=@0x7fffffe6b0: 0x0) at /usr/include/c++/12/bits/std_function.h:290
#38 0x000000555577b7e0 in std::function<void (void
)>::operator()(void*) const (this=0x5556b75090, __args#0=0x0) at /usr/include/c++/12/bits/std_function.h:591
#39 0x000000555577b138 in wf::wl_listener_wrapper::emit (this=0x5556b75090, data=0x0) at ../src/util.cpp:526
#40 0x000000555577af50 in handle_wrapped_listener (listener=0x5556b750b0, data=0x0) at ../src/util.cpp:463
#41 0x0000007ff7ec930c in wl_signal_emit_mutable () from target:/lib/aarch64-linux-gnu/libwayland-server.so.0
#42 0x0000007ff7e151cc in ?? () from target:/lib/aarch64-linux-gnu/libwlroots.so.11
#43 0x0000007ff7e155c0 in ?? () from target:/lib/aarch64-linux-gnu/libwlroots.so.11
#44 0x0000007ff7ec7668 in ?? () from target:/lib/aarch64-linux-gnu/libwayland-server.so.0
#45 0x0000007ff7ec7d4c in wl_resource_destroy () from target:/lib/aarch64-linux-gnu/libwayland-server.so.0
#46 0x0000007ff74e63e0 in ?? () from target:/lib/aarch64-linux-gnu/libffi.so.8
#47 0x0000007ff74e5b24 in ?? () from target:/lib/aarch64-linux-gnu/libffi.so.8
#48 0x0000007ff7ecd46c in ?? () from target:/lib/aarch64-linux-gnu/libwayland-server.so.0
#49 0x0000007ff7ec8410 in ?? () from target:/lib/aarch64-linux-gnu/libwayland-server.so.0
#50 0x0000007ff7ecb488 in wl_event_loop_dispatch () from target:/lib/aarch64-linux-gnu/libwayland-server.so.0
#51 0x0000007ff7ec8cac in wl_display_run () from target:/lib/aarch64-linux-gnu/libwayland-server.so.0
#52 0x00000055557773ac in main (argc=1, argv=0x7ffffff458) at ../src/main.cpp:324
(gdb)

Wayfire version
0.7.5, Raspberry Pi build

@spl237 spl237 added the bug label Feb 19, 2024
@ammen99
Copy link
Member

ammen99 commented Feb 19, 2024

I'm quite certain the bug has long ago been fixed on the Wayfire master branch :)

@ammen99 ammen99 closed this as completed Feb 19, 2024
@spl237
Copy link
Author

spl237 commented Feb 19, 2024

Do you have any idea which particular commit or area of code the fix is in? We're not ready to move to 0.8 yet - still working out how to port our optimisations - so I'd need to cherry pick a fix for this in the meantime.

@ammen99
Copy link
Member

ammen99 commented Feb 19, 2024

Do you have any idea which particular commit or area of code the fix is in? We're not ready to move to 0.8 yet - still working out how to port our optimisations - so I'd need to cherry pick a fix for this in the meantime.

Unfortunately, no. As you probably already know, a large portion of the code was rewritten so the bug fix (even if it can be pinpointed to a single commit) probably will not apply to the old architecture anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants