Skip to content
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

Clear current GLX context before destroying the current context #867

Merged

Conversation

jix
Copy link
Contributor

@jix jix commented Mar 29, 2023

PR Description

What type of PR is this? (Check one of the boxes below)

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (non-breaking change which does not add functionality nor fixes a bug but improves Natron in some way)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • My change requires a change to the documentation
    • I have updated the documentation accordingly

What does this pull request do?

On Linux systems using GLX, it clears the current GLX context before destroying the current context, which fixes a crash-on-startup on my system (Arch Linux, Qt 5.15.8, using an NVIDIA GPU with vendor drivers).

Have you tested your changes (if applicable)? If so, how?

I only tested it as far as that Natron doesn't crash right away anymore. Since I don't know how to use Natron yet, not having gotten to the point where I can try it before having fixed this, I haven't really performed more testing. Since I found others being affected by the same bug (#863) I wanted to share my potential fix rather sooner than later.

Futher details of this pull request

Without this, on my system, Qt somehow ends up using a GLX context that Natron already destroyed, causing a GLXBadContext crash on startup. That much I verified using GDB. I have no idea how Qt ends up using that context at all and how it ends up using it at that point. I assume it just uses the current context and somehow ends up getting a destroyed context when querying the current context, but that's just a guess based on this fix working for me.

I have no clue who of Natron, Qt or NVIDIA's GLX implementation are at really at fault, nor have I tested this beyond verifying that Natron doesn't crash on startup anymore.

Without this, on my system, Qt somehow ends up using a GLX context that
Natron already destroyed, causing a GLXBadContext crash on startup. That
much I verified using GDB. I have no idea how Qt ends up using that
context at all and how it ends up using it at that point. I assume it
just uses the current context and somehow ends up getting a destroyed
context when querying the current context, but that's just a guess based
on this fix working for me.

I have no clue who of Natron, Qt or NVIDIA's GLX implementation are at
really at fault, nor have I tested this beyond verifying that Natron
doesn't crash on startup anymore.
Copy link
Member

@devernay devernay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Thank you!

@devernay devernay merged commit d3073ce into NatronGitHub:RB-2.5 Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants