-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
bug: Segmentation fault while closing window #347
Comments
Hey! What Linux distribution do you use? |
NixOS 23.05 |
I am not very familiar with NixOS but looks like the error is coming from Skia (the renderer that Freya uses). I wonder if NixOS might have something disabled and that made it crash... I have never experienced this in other distros, I'll open an issue asap in rust-skia to see if they can help ✌️ |
@marc2332 Thanks! Also I have added some info about my env and hw. |
Thanks! I appreciate that 😄 |
I don’t know if this helps much, but there are two things I’ve learned while using skia in Slint with GL: (1) we call flush() in the context before swapping Gl buffers Your stack trace shows that Skia wants to call glFinish in the destructor - that doesn’t seem like a great idea. I think ideally it would be merely glDeleteXxx calls to free various GPU buffers and handles. |
Hey Simon! Thanks for the tips!
Thanks! 😄 ✌️ |
By the way, I tested #355, but it doesn't solve the problem with segfault for me. |
Yes, almost: I think instead of just checking I suggest to also make the context current. I see another issue though: The order of fields also affects how the different Drop implementations / destructors are called. Right now I see: surface: Surface,
gl_surface: GlutinSurface<WindowSurface>,
gr_context: DirectContext,
gl_context: PossiblyCurrentContext, That means that the surface is destroyed first, then the surface, and then the skia context. I suggest to make the DirectContext the first field, so that it is dropped first while the surface is still existent. |
@marc2332 I fetched and tested it again but it still crashes. GDB shows same backtrace. |
When I try to close window by click
(x)
button I have a segmentation fault.GDB shows the following backtrace:
Seems something wrong with finalizing.
The text was updated successfully, but these errors were encountered: