-
Notifications
You must be signed in to change notification settings - Fork 343
Segfault in drm_connector_set_mode
#1874
Comments
Can you compile manually to disable optimizations? Compiling with ASan ( |
Sure!
|
When surf->gbm was previously set, we destroy it without setting it to NULL. Later on, we only create the GBM surface if surf->gbm is NULL. This result in a use-after-free when we start using surf->gbm. Closes: swaywm#1868 Closes: swaywm#1874 Closes: swaywm/sway#4785 Closes: swaywm/sway#4717 Closes: swaywm/sway#4730 Fixes: 2bdd1d0 ("backend/drm: use modifiers for our GBM buffers")
When surf->gbm was previously set, we destroy it without setting it to NULL. Later on, we only create the GBM surface if surf->gbm is NULL. This result in a use-after-free when we start using surf->gbm. Closes: #1868 Closes: #1874 Closes: swaywm/sway#4785 Closes: swaywm/sway#4717 Closes: swaywm/sway#4730 Fixes: 2bdd1d0 ("backend/drm: use modifiers for our GBM buffers")
@emersion I'm sure it's not the correct solution, but adding a When I start sway with this I still have the second external monitor turn on and display essentially garbage (the last terminal output), but then switching back and forth between virtual terminals stops sending output to the second external monitor (the way it probably should be). I'm thinking there's an issue with properly cleaning up this input when there's a failure in |
When surf->gbm was previously set, we destroy it without setting it to NULL. Later on, we only create the GBM surface if surf->gbm is NULL. This result in a use-after-free when we start using surf->gbm. Closes: swaywm#1868 Closes: swaywm#1874 Closes: swaywm/sway#4785 Closes: swaywm/sway#4717 Closes: swaywm/sway#4730 Fixes: 2bdd1d0 ("backend/drm: use modifiers for our GBM buffers")
When surf->gbm was previously set, we destroy it without setting it to NULL. Later on, we only create the GBM surface if surf->gbm is NULL. This result in a use-after-free when we start using surf->gbm. Closes: swaywm#1868 Closes: swaywm#1874 Closes: swaywm/sway#4785 Closes: swaywm/sway#4717 Closes: swaywm/sway#4730 Fixes: 2bdd1d0 ("backend/drm: use modifiers for our GBM buffers")
When surf->gbm was previously set, we destroy it without setting it to NULL. Later on, we only create the GBM surface if surf->gbm is NULL. This result in a use-after-free when we start using surf->gbm. Closes: swaywm#1868 Closes: swaywm#1874 Closes: swaywm/sway#4785 Closes: swaywm/sway#4717 Closes: swaywm/sway#4730 Fixes: 2bdd1d0 ("backend/drm: use modifiers for our GBM buffers")
When surf->gbm was previously set, we destroy it without setting it to NULL. Later on, we only create the GBM surface if surf->gbm is NULL. This result in a use-after-free when we start using surf->gbm. Closes: swaywm#1868 Closes: swaywm#1874 Closes: swaywm/sway#4785 Closes: swaywm/sway#4717 Closes: swaywm/sway#4730 Fixes: 2bdd1d0 ("backend/drm: use modifiers for our GBM buffers")
When surf->gbm was previously set, we destroy it without setting it to NULL. Later on, we only create the GBM surface if surf->gbm is NULL. This result in a use-after-free when we start using surf->gbm. Closes: swaywm#1868 Closes: swaywm#1874 Closes: swaywm/sway#4785 Closes: swaywm/sway#4717 Closes: swaywm/sway#4730 Fixes: 2bdd1d0 ("backend/drm: use modifiers for our GBM buffers")
This fixes a segfault in drm_connector_set_mode (mode = NULL). This happens because we set wlr_output.enabled to true if the connector is attached to the CRTC. When the user disables an output in the wlroots-based compositor, switches to another VT (enabling the output), then switches back, wlroots sets wlr_output.enabled to true but wlr_output.current_mode is NULL. We should consider not reading properties from KMS after a TTY switch, disabling all connectors. However this may result in flickering (outputs being disabled then re-enabled). Closes: swaywm#1874
Can you try #1971? |
This fixes a segfault in drm_connector_set_mode (mode = NULL). This happens because we set wlr_output.enabled to true if the connector is attached to the CRTC. When the user disables an output in the wlroots-based compositor, switches to another VT (enabling the output), then switches back, wlroots sets wlr_output.enabled to true but wlr_output.current_mode is NULL. We should consider not reading properties from KMS after a TTY switch, disabling all connectors. However this may result in flickering (outputs being disabled then re-enabled). Closes: #1874
@emersion I can confirm that the segfault issue is fixed. This still an issue with the second monitor not starting correctly, and a difference in what that monitor shows depending if it's plugged in to start with or after starting sway, but no crashes either way. Thank you! |
When surf->gbm was previously set, we destroy it without setting it to NULL. Later on, we only create the GBM surface if surf->gbm is NULL. This result in a use-after-free when we start using surf->gbm. Closes: swaywm#1868 Closes: swaywm#1874 Closes: swaywm/sway#4785 Closes: swaywm/sway#4717 Closes: swaywm/sway#4730 Fixes: 2bdd1d0 ("backend/drm: use modifiers for our GBM buffers")
This fixes a segfault in drm_connector_set_mode (mode = NULL). This happens because we set wlr_output.enabled to true if the connector is attached to the CRTC. When the user disables an output in the wlroots-based compositor, switches to another VT (enabling the output), then switches back, wlroots sets wlr_output.enabled to true but wlr_output.current_mode is NULL. We should consider not reading properties from KMS after a TTY switch, disabling all connectors. However this may result in flickering (outputs being disabled then re-enabled). Closes: swaywm#1874
When switching from another virtual console back I get the following segfault:
with the following logs:
The text was updated successfully, but these errors were encountered: