obsproject / obsproject/obs-studio

OBS crashes with explicit sync on wayland

Open
#11,022 32 comments 20 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

issue/confirmed platform/linux
Dominant language
C
Stars
76.4k
Forks
10.2k
Avg merge
4d 23h
Merged PRs (30d)
12

Description

Operating System Info

Other

Other OS

Arch Linux

OBS Studio Version

30.1.2

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/WQGyYH2S1OMk7op4

OBS Studio Crash Log URL

No response

Expected Behavior

OBS does not crash.

Current Behavior

OBS crashes.

Steps to Reproduce

Start OBS under a wayland compositor that supports explicit sync and with graphics drivers that support explicit sync. With up-to-date nvidia drivers, that should always be the case. With mesa, you will also have to set the environment variable MESA_LOADER_DRIVER_OVERRIDE=zink to ensure that vulkan is being used under the hood.

After starting OBS, right click on the preview and select Windowed Projector (Preview). You might have to repeat this several times.

OBS crashes.

Anything else we should know?

I am reasonably certain that this is caused by the following series of events:

  1. OBS creates a QT window.
  2. OBS extracts the underlying wl_surface.
  3. OBS uses that wl_surface to create an OpenGL context.
  4. Later, QT tries to commit a SHM buffer to that wl_surface. Possibly due to a resize event. Since QT does not know anything about the OpenGL context, this crashes.

The last step is unsound. QT must not not manipulate the surface buffer while the surface is owned by an OpenGL or Vulkan context. I believe that that much is required by the OpenGL and Vulkan specifications.

The question is if QT is in the wrong here (although I don't see how, QT seems to know nothing about OBS creating on OpenGL context) or if this is an OBS bug because OBS creates an OpenGL context without properly informing QT about this.

@davidedmundson can you comment on the above?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked OBS log and reproduce the crash using Windowed Projector (Preview) under a Wayland compositor with explicit sync enabled. Investigate the reported Qt wl_surface and OpenGL context interaction, then verify that repeated preview-projector creation no longer crashes.

Written by the indexing model from the issue text.

Assessment

Tech stack
arch-linux, linux
Domain
computer-graphics, desktop, operating-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.