-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
UI: Fix crash on *nix caused by OBSQTDisplay destruction after draw surface invalidation #4576
Conversation
Very cool find! I dont think this is the fix but it seems there is some issue with our sync between the UI and the libobs. |
1c8f91b
to
1f953e0
Compare
I've updated the PR with a more updated and direct patch to the issue. Testing on both of my PCs, I could not get any GLXBadDrawable errors or crashes. One PC is running nvidia-440 drivers and a tesla t4, one is running nvidia-450 and an rtx 4000. On 440.100, the problem usually manifests itself as:
|
1f953e0
to
cf3644c
Compare
On my System it used to crash every time after closing the v4l2 video properties Dialog. |
Just wanted to make sure you didn't forget about this PR. Seems some people have been testing it. |
I haven't forgotten about it, but I'm unsure what direction to proceed in. This seems to fix the issue, but it feels more like a patch. The graphics thread is still susceptible to failed context switches. I don't remember which particular call was the problem, but my idea was to turn it into a boolean return, to be able to know if the GLX context is valid. Implementing my PR in its current form does not guard against this same issue cropping up in future features using OBSQTDisplay. |
Just making sure, is this still in the works? The problem is ongoing, and if this fixes it, it would be great to have available for production use. |
@leohoe Last time I brought it up to OBS project devs, I was told to wait to ask questions about the direction I should take until 27.1 is out, so that's the current status of this PR. |
Since we're on 27.1.3 now, how are things looking for this PR? |
a8c841e
to
deec83f
Compare
When a window with an OBSQTDisplay is closed, the surface can be destroyed before the display is, opening a gap for OBS to attempt to draw to the invalid surface. This deletes the underlying OBSDisplay object when the actual surface is destroyed, closing that gap. Note: This appears to have been an issue previously with Wayland, as hinted by the existing ifdefs.
deec83f
to
b6b124c
Compare
Update for those subscribed: This is slated to be released with 27.2. Thank you for your patience! |
Description
Deletes the underlying
obs_display_t
object when the window draw surface is destroyed (X11 and Wayland), preventing OBS from attempting to switch to invalid GLX context on draw.Closes #4185
Motivation and Context
Currently: This issue is mainly caused by the behavior of Qt's
DeleteLater
. When a window using OBSQTDisplay is closed, there is an indeterminate delay until the Qt object for it is deleted, allowing for a race.With this: The
OBSQTDisplay
object is deleted before the draw surface is, preventing the race condition. No longer reports any X errors, let alone crashes.How Has This Been Tested?
This issue can be most easily reproduced by doing:
Close
button)Expect X errors to be logged, and if lucky enough, a crash. It varies system to system, but if you have the bug (like me), it's usually very easy to reproduce.
Types of changes
Checklist: