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 in wayfire-shell plugin when unplugging external monitor #2212

Closed
lcolitti opened this issue Mar 13, 2024 · 5 comments
Closed

Crash in wayfire-shell plugin when unplugging external monitor #2212

lcolitti opened this issue Mar 13, 2024 · 5 comments
Labels

Comments

@lcolitti
Copy link
Contributor

Using wayfire from git at commit 27ddca3 . I opened my laptop and noticed wayfire had crashed. Looks like it happened when unplugging my external monitor. Simplified log below.

I notice that most of the methods in wfs_output check whether this->output is null. Should a null check be added to wfs_output::create_hotspot as well?

II 13-03-24 12:52:07.842 - [backend/drm/drm.c:1631] 'DP-3' disconnected
II 13-03-24 12:52:07.842 - [src/core/output-layout.cpp:1177] remove output: DP-3
II 13-03-24 12:52:07.842 - [src/core/output-layout.cpp:1090] new output: NOOP-1
II 13-03-24 12:52:07.842 - [src/core/output-layout.cpp:442] loaded mode auto
II 13-03-24 12:52:07.842 - [src/core/output-layout.cpp:615] Couldn't find matching mode 1280x720@0 for output NOOP-1. Trying to use custom mode(might not work)
...
EE 13-03-24 12:52:07.855 - [src/core/output-layout.cpp:514] disabling output: DP-3
II 13-03-24 12:52:07.859 - [src/core/output-layout.cpp:145] transfer views from DP-3 -> NOOP-1
II 13-03-24 12:52:07.971 - [backend/drm/drm.c:786] connector DP-3: Turning off
...
II 13-03-24 12:52:08.228 - [src/core/output-layout.cpp:1090] new output: NOOP-1
II 13-03-24 12:52:08.228 - [src/core/output-layout.cpp:442] loaded mode auto
II 13-03-24 12:52:08.228 - [src/core/output-layout.cpp:615] Couldn't find matching mode 1280x720@0 for output NOOP-1. Trying to use custom mode(might not work)
II 13-03-24 12:52:08.236 - [backend/drm/drm.c:782] connector eDP-1: Modesetting with 3840x2400 @ 60.000 Hz
...
II 13-03-24 12:52:09.550 - [src/core/output-layout.cpp:1130] remove output: NOOP-1
EE 13-03-24 12:52:09.550 - [src/core/output-layout.cpp:514] disabling output: NOOP-1
II 13-03-24 12:52:09.659 - [src/core/output-layout.cpp:145] transfer views from NOOP-1 -> eDP-1
II 13-03-24 12:52:10.068 - [backend/drm/drm.c:782] connector eDP-1: Modesetting with 3840x2400 @ 60.000 Hz
EE 13-03-24 12:52:10.235 - [src/main.cpp:131] Fatal error: Segmentation fault
EE 13-03-24 12:52:10.375 - #1  signal_handler(int) ../src/main.cpp:133
EE 13-03-24 12:52:11.196 - #2  __restore_rt libc_sigaction.c:?
EE 13-03-24 12:52:12.622 - #3  wf::output_t::get_layout_geometry() const ../src/output/output.cpp:182
EE 13-03-24 12:52:12.678 - #4  wfs_hotspot::calculate_hotspot_geometry(wf::output_t*, unsigned int, unsigned int) const ../plugins/protocols/wayfire-shell.cpp:108
EE 13-03-24 12:52:12.732 - #5  wfs_hotspot::wfs_hotspot(wf::output_t*, unsigned int, unsigned int, unsigned int, wl_client*, unsigned int) ../plugins/protocols/wayfire-shell.cpp:145
EE 13-03-24 12:52:12.785 - #6  wfs_output::create_hotspot(unsigned int, unsigned int, unsigned int, unsigned int) ../plugins/protocols/wayfire-shell.cpp:317 (discriminator 1)
EE 13-03-24 12:52:12.836 - #7  handle_zwf_output_create_hotspot(wl_client*, wl_resource*, unsigned int, unsigned int, unsigned int, unsigned int) ../plugins/protocols/wayfire-shell.cpp:339
EE 13-03-24 12:52:12.844 - #8  ffi_prep_go_closure ??:?
@lcolitti lcolitti added the bug label Mar 13, 2024
@ammen99
Copy link
Member

ammen99 commented Mar 13, 2024

We have recently had some fixes related to this, please test with latest master.

@ammen99
Copy link
Member

ammen99 commented Mar 13, 2024

Oh, I think I misread the stack trace. We had a similar problem in core, not in this plugin. I assume that yes, probably we ought to check for the output. Note however that we still have to create the hotspot object (otherwise we're violating the wayland protocol) but that object simply should be 'inert' - all requests to it should be ignored. I think it should be possible to adapt the wfs_hotspot object to support that.

@mark-herbert42
Copy link

Maybe the same issue is crashing wf-backround as it is also shell component...

ammen99 added a commit that referenced this issue Mar 13, 2024
@ammen99
Copy link
Member

ammen99 commented Mar 13, 2024

This is a race condition which I could reproduce with a specially crafted client, https://github.com/ammen99/wleird/blob/e0a81e4dd4c8df002016e60fffad03b908091ee5/wfshell-tester.c

I pushed a fix in #2211

@ammen99
Copy link
Member

ammen99 commented Mar 13, 2024

@mark-herbert42 That is a separate bug in the application (wf-background), please post your log there, not in the wayfire issue.

ammen99 added a commit that referenced this issue Mar 13, 2024
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

3 participants