-
Notifications
You must be signed in to change notification settings - Fork 546
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] macOS native crashes in gr_backendrendertarget_get_gl_framebufferinfo #1188
Comments
With this crash, are you using the Also, are you running the updates to the SkiaSharp.Views package? That is where the bug was. Finally, did you clean and rebuild? Sometimes the old assemblies are used. But I am assuming that you did and this is more for the native binaries. But, maybe straws need to be clutched earlier on? :) |
i'm not using |
I bet it is related to #1137 which is still the root cause of #1121. Something is being disposed incorrectly. And this happens with the GL bits which is usually with more threads. So, I am looking at that still. I worked around the main crash in #1180, but the underlying issue is still there. I believe I have a repro case as well. |
thanks for your hard work. i'm happy to share more details and code in a private session because it's a big and closed source project i'm working on right now. |
Awesome, thanks. Let me see what I can do with what I have right now and then if that doesn't work we can talk about your code. |
I think I found the cause and fix of the issue. It was due to concurrency with the construction and destruction of objects with the same native handle. As soon as PR #1200 is complete, then I'll push to the preview feed for testing. |
sounds great! thanks for the fix :-) |
@nor0x I have pushed what I think is now a good version to the preview feed: https://aka.ms/skiasharp-eap/index.json Let me know how it goes. |
Hey folks, it has been a long time coming and thanks to all the folks with your repros, samples and stack traces I think we have finally managed to fix those pesky crashes - at least the ones we know about. I have just pushed 1.68.2-preview.50 to NuGet so let me know if this fixes all the crashes you have ever had 😄 |
thanks for the preview build! works great for me 🎉 |
All good? Awesome! |
Oh no, too early. In my first quick tests everything was fine, but now after more intense testing i'm experiencing random native crashes / freezes again. I really don't wanted to reopen this 🙈 @mattleibow not sure if it helps, but if if i go back to preview .43 these crashes seems to happen less often 🤷♂️
|
At this point I don't think this is the concurrency anymore. It may be that the GC is collection things that are no longer used on the managed side. This is gonna be crazy, but try using a void OnPaint() {
var paint = new SKPaint();
...
GC.KeepAlive(paint);
} void OnPaint() {
var objects = new List<SKObject>();
var paint = new SKPaint();
objects.Add(paint);
...
} Basically, you want to keep these objects alive as long as possible. But, if this is gonna be to crazy to do on your codebase, then we can talk over a private connection and maybe I can have a look at the drawing code. Maybe something will pop out. |
alright i have added try the |
seems to be fixed by #1224. after a lot of testing i don't get any crashes so i'm closing this now, hopefully for good |
Description
i using SkiaSharp in a Xamarin.Forms app on macOS, after following the discussion in #1144 i have updated to the latest preview .45 which unfortunately doesn't solve the issue with native crashes for me (
gr_backendrendertarget_get_gl_framebufferinfo
). I have a different issue open which is related toSKImage
#1164 but i'm not sure if this is the same - so here is a new open issue 🤓I'm using an
SKGLView
to draw several shapes and images which lead to a freeze and the following native crash.Code
in my case it might be related with
GRContext.GetResourceCacheUsage
🤷♂️Expected Behavior
SKGLView should render without any problems+
Actual Behavior
random freezes and stuck app - only force close or
killall lldb
helps in my caseBasic Information
Version with issue: 1.68.2-preview.45
IDE: Visual Studio for Mac 8.5 (build 3183)
Platform Target Frameworks:
Target Devices:
Reproduction Link
The text was updated successfully, but these errors were encountered: