Wayland: crash when resizing secondary window and GNOME desktop has fractional scaling #103000

Open
opened 2022-12-07 23:48:39 +01:00 by Markus · 4 comments

System Information
Operating system: Ubuntu 22.04
Graphics card: Radeon 6800XT

Blender Version
Broken: 3.4.0, branch: blender-v3.4-release, commit date: 2022-12-06 18:46, hash: a95bf1ac01, type: release
Worked: 3.3.1, branch: master, commit date: 2022-10-04 18:35, hash: b292cfe5a9, type: release

Short description of error
When performing a window resize operation by dragging the bottom right corner of a secondary Blender window (e.g. Window -> New Window) with the corner resize mouse cursor so that window width and height are changed at the same time, Blender has a high chance of crashing, i.e. repeating the resize operation multiple times will lead to a crash, sometimes already on the first resize.

Also the resize operation is really slow, taking around one second for the resized window to render after releasing the mouse button. When setting display scaling to 100%, I could no longer crash Blender but the resize operation was still very slow.

This is running under a vanilla Ubuntu GNOME session with GNOME 42.5. Display server is Wayland with 125% fractional scaling. Screen resolution is 5120x2160 pixels.

This was never an issue with Blender 3.3.1.

Exact steps for others to reproduce the error

  1. Log in to a vanilla GNOME desktop session using Wayland under Ubuntu 22.04
  2. Under GNOME settings -> Displays turn on "Fractional scaling" and set the scaling value to 125%
  3. Launch Blender 3.4.0
  4. Open a secondary window with Window -> New Window
  5. Resize the window by dragging the bottom right corner resize window handle
  6. Repeat 5. until Blender crashes
**System Information** Operating system: Ubuntu 22.04 Graphics card: Radeon 6800XT **Blender Version** Broken: 3.4.0, branch: blender-v3.4-release, commit date: 2022-12-06 18:46, hash: a95bf1ac01be, type: release Worked: 3.3.1, branch: master, commit date: 2022-10-04 18:35, hash: b292cfe5a936, type: release **Short description of error** When performing a window resize operation by dragging the bottom right corner of a secondary Blender window (e.g. Window -> New Window) with the corner resize mouse cursor so that window width and height are changed at the same time, Blender has a high chance of crashing, i.e. repeating the resize operation multiple times will lead to a crash, sometimes already on the first resize. Also the resize operation is really slow, taking around one second for the resized window to render after releasing the mouse button. When setting display scaling to 100%, I could no longer crash Blender but the resize operation was still very slow. This is running under a vanilla Ubuntu GNOME session with GNOME 42.5. Display server is Wayland with 125% fractional scaling. Screen resolution is 5120x2160 pixels. This was never an issue with Blender 3.3.1. **Exact steps for others to reproduce the error** 1. Log in to a vanilla GNOME desktop session using Wayland under Ubuntu 22.04 2. Under GNOME settings -> Displays turn on "Fractional scaling" and set the scaling value to 125% 3. Launch Blender 3.4.0 4. Open a secondary window with Window -> New Window 5. Resize the window by dragging the bottom right corner resize window handle 6. Repeat 5. until Blender crashes
Author

Added subscriber: @rasterizer

Added subscriber: @rasterizer

Added subscriber: @ideasman42

Added subscriber: @ideasman42

I'm unable to redo this in gnome-shell 43.1. although resizing does seem to be unreasonably slow.

Fractional scaling is an experimental feature in gnome, I needed to run:

gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']"

... then restart gnome-shell to access fractional scaling.


Otherwise Blender's Wayland support should work well as I used fractional-scaling during most of it's development with the "river" wl-roots based compositor (with each monitor set to a different scale at times).

I'm unable to redo this in gnome-shell 43.1. although resizing does seem to be unreasonably slow. Fractional scaling is an experimental feature in gnome, I needed to run: ``` gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']" ``` ... then restart gnome-shell to access fractional scaling. ---- Otherwise Blender's Wayland support should work well as I used fractional-scaling during most of it's development with the "river" wl-roots based compositor (with each monitor set to a different scale at times).
Campbell Barton changed title from Blender crashes when resizing secondary window and GNOME desktop has fractional scaling applied to [Wayland] crash when resizing secondary window and GNOME desktop has fractional scaling 2022-12-08 06:23:27 +01:00
Author

As discovered in #102997, it is libdecor which is causing the performance issue. An open bug ticket exists for this under https://gitlab.freedesktop.org/libdecor/libdecor/-/issues/37 . On vanilla Ubuntu 22.04, when I install package libdecor-tests and then run libdecor-demo, I can reproduce these slow resizes. On a display with ~5kx2k resolution (with and without fractional scaling enabled), resizing this demo window to roughly more than half of my screen, the window resize repaints start taking around one second each, with some even taking 15 seconds to complete a single repaint.

Now for Blender, these long hangs appear to trigger the crashes for me most of the time in two ways:

  • While waiting for the repaint to render after triggering a resize by dragging the bottom right Blender window corner, I release the mouse button and then scroll the mouse wheel with the cursor within the Blender window area
  • While waiting for the repaint to render, I keep quickly dragging the window corner even though the Blender window has not updated yet

In both cases, Blender crashes and the following output appears on the shell where I started Blender:

GHOST/Wayland: Error sending request: Broken pipe
The Wayland connection broke. Did the Wayland compositor die?
Error: Not freed memory blocks: 95670, total unfreed memory 22.589180 MB
Freeing memory after the leak detector has run. This can happen when using static variables in C++ that are defined outside of functions. To fix this error, use the 'construct on first use' idiom.
Freeing memory after the leak detector has run. This can happen when using static variables in C++ that are defined outside of functions. To fix this error, use the 'construct on first use' idiom.
blender: ../external_epoxy/src/dispatch_common.c:872: epoxy_get_proc_address: Assertion `0 && "Couldn't find current GLX or EGL context.\n"' failed.
Freeing memory after the leak detector has run. This can happen when using static variables in C++ that are defined outside of functions. To fix this error, use the 'construct on first use' idiom.
Aborted (core dumped)

I assume comment https://gitlab.freedesktop.org/libdecor/libdecor/-/issues/37#note_1656985 ff. point towards the underlying issue causing this crash.

As discovered in #102997, it is libdecor which is causing the performance issue. An open bug ticket exists for this under https://gitlab.freedesktop.org/libdecor/libdecor/-/issues/37 . On vanilla Ubuntu 22.04, when I install package `libdecor-tests` and then run `libdecor-demo`, I can reproduce these slow resizes. On a display with ~5kx2k resolution (with and without fractional scaling enabled), resizing this demo window to roughly more than half of my screen, the window resize repaints start taking around one second each, with some even taking 15 seconds to complete a single repaint. Now for Blender, these long hangs appear to trigger the crashes for me most of the time in two ways: * While waiting for the repaint to render after triggering a resize by dragging the bottom right Blender window corner, I release the mouse button and then scroll the mouse wheel with the cursor within the Blender window area * While waiting for the repaint to render, I keep quickly dragging the window corner even though the Blender window has not updated yet In both cases, Blender crashes and the following output appears on the shell where I started Blender: ``` GHOST/Wayland: Error sending request: Broken pipe The Wayland connection broke. Did the Wayland compositor die? Error: Not freed memory blocks: 95670, total unfreed memory 22.589180 MB Freeing memory after the leak detector has run. This can happen when using static variables in C++ that are defined outside of functions. To fix this error, use the 'construct on first use' idiom. Freeing memory after the leak detector has run. This can happen when using static variables in C++ that are defined outside of functions. To fix this error, use the 'construct on first use' idiom. blender: ../external_epoxy/src/dispatch_common.c:872: epoxy_get_proc_address: Assertion `0 && "Couldn't find current GLX or EGL context.\n"' failed. Freeing memory after the leak detector has run. This can happen when using static variables in C++ that are defined outside of functions. To fix this error, use the 'construct on first use' idiom. Aborted (core dumped) ``` I assume comment https://gitlab.freedesktop.org/libdecor/libdecor/-/issues/37#note_1656985 ff. point towards the underlying issue causing this crash.
Campbell Barton changed title from [Wayland] crash when resizing secondary window and GNOME desktop has fractional scaling to Wayland: crash when resizing secondary window and GNOME desktop has fractional scaling 2023-03-16 03:33:57 +01:00
Campbell Barton added the
Interest
Wayland
label 2023-03-21 10:21:37 +01:00
Iliya Katushenock added
Interest
Platforms, Builds & Tests
and removed
Module
Platforms, Builds & Tests
labels 2023-08-24 17:34:06 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#103000
No description provided.