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

Graphics modules are sometimes freed before their last usage #3768

Open
tarek-y-ismail opened this issue Feb 21, 2025 · 0 comments
Open

Graphics modules are sometimes freed before their last usage #3768

tarek-y-ismail opened this issue Feb 21, 2025 · 0 comments

Comments

@tarek-y-ismail
Copy link
Contributor

How to reproduce:

  1. Checkout and build MIRENG-883/support-mouse-keys
  2. Run Mir in gdb
  3. Exit
  4. You should get a SIGSEGV sometime during TouchspotController's destruction

This issue is that TouchspotController doesn't hold on to a reference to the allocator it created its graphics buffer with. So after it creates a buffer and some time before the buffer is destroyed, the module is unloaded. Once we try to destroy TouchspotController and try to destroy the buffer, it tries to call unloaded code, blowing up the whole thing.

The quickest workaround is to keep a reference to the allocator, which itself keeps the module alive. The better solution would be to tie the lifetime of the module to the lifetime of whatever is using it.

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

No branches or pull requests

1 participant