obsproject / obsproject/obs-studio
OBS crashes with explicit sync on wayland
Nobody has claimed this yet.
- 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:
- OBS creates a QT window.
- OBS extracts the underlying wl_surface.
- OBS uses that wl_surface to create an OpenGL context.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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