-
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
SIGSEGV when using SKCanvas.DrawText() and then SKCanvas.Flush() #647
Comments
After doing some more research, I found out several things:
As a result, there appears to be something going wrong for ARM when the optimizations are at However, this does incur a penalty with the size no longer being the main point. As a result, the size increases by about 800KB-1200KB depending on the architecture. For this release, I will go with a larger binary that works over a smaller one that can't do GPU. I have reported the issue to Google along with all the information I could find. Hopefully, they can find out exactly what the issue is and provide a real fix. |
I found this issue on google because I'm experiencing a similar bug on a Flutter app. See flutter/flutter#29751 and my comment There seem to be many common denominators (Pixel 2, Android 8.1, drawing text, SIGSEGV during SKCanvas.Flush()) so I was wondering if these things could be related. Unfortunately, I can't see the Skia issue 8425 that @mattleibow linked. It's giving me "Permission denied" so I can't dig deeper into this. |
I am getting this error even in debug builds using 1.68.0 and above when targeting Android 10 as a build target. It happens every time and is repeatable. If I remove all calls to DrawText there is no crash. Even a single DrawText will cause a crash with a "Could not allocate vertices" message. Is there any news on this? Here is the managed stack trace:
|
@apaatsio, I had a look at that issue on the Google bug list, no feedback at all. The only comment a long while back was:
@blimkemann could you create a test/repo project for your example. It was working when I reduced the optimization level a while back. Maybe this is a slightly different case that I can start testing on.
|
SkiaTextBug.zip |
Thanks! I'll have a look. |
This has been some time, I will try using the new v2.80 packages. Have you still been having this issue? |
Yes, still having this issue.
|
Not sure how I missed it, but the issue with your code is that you are drawing outside of the main render loop. This code: MainThread.BeginInvokeOnMainThread(() => {
// drawing code
}); The Just remove those blocks and draw directly. |
Thanks. That fixed that issue. I am now always wrapping InvalidateSurface in MainThread.BeginInvokeOnMainThread.
However, as I use some commands on the page and drawing happens, after about 4 calls to InvalidateSurface, the whole SKGLView appears as a black rectangle (only on Android) and then randomly comes back after a few more redraws. Am I still missing something?
|
Are there any errors in the log? Is there something you are doing just before it happens? |
Each time, I call Canvas.Clear(), Canvas.Flush(), do my drawing, and Canvas.Flush() again. Other than that, exactly the same thing happens between drawings.
The logs show only this:
Time
Device Name
Type
PID
Tag
Message
07-02 11:26:07.704
moto_g7
Info
24845
.redbook.mobil
Explicit concurrent copying GC freed 10877(367KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 3MB/6MB, paused 311us total 7.868ms
07-02 11:26:07.707
moto_g7
Debug
24845
Mono
GC_TAR_BRIDGE bridges 7 objects 95968 opaque 280479 colors 7 colors-bridged 7 colors-visible 7 xref 0 cache-hit 0 cache-semihit 0 cache-miss 0 setup 0.02ms tarjan 16.60ms scc-setup 0.02ms gather-xref 0.01ms xref-setup 0.01ms cleanup 2.08ms
07-02 11:26:07.707
moto_g7
Debug
24845
Mono
GC_BRIDGE: Complete, was running for 10.88ms
07-02 11:26:07.707
moto_g7
Debug
24845
Mono
GC_MINOR: (Nursery full) time 20.11ms, stw 21.25ms promoted 676K major size: 55024K in use: 50942K los size: 4096K in use: 2560K
From: Matthew Leibowitz <notifications@github.com>
Sent: Wednesday, July 1, 2020 3:27 PM
To: mono/SkiaSharp <SkiaSharp@noreply.github.com>
Cc: Brian Limkemann <brian@decisivecomputing.com>; Mention <mention@noreply.github.com>
Subject: Re: [mono/SkiaSharp] SIGSEGV when using SKCanvas.DrawText() and then SKCanvas.Flush() (#647)
Are there any errors in the log? Is there something you are doing just before it happens?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#647 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACPIWVO4Q7FNZJ276AENGYLRZOEXRANCNFSM4FX2OECQ>.
|
@blimkemann Is this still happening? Have you tried the v2 of SkiaSharp? |
It is not still happening. Turns out is was a threading issue
From: Matthew Leibowitz <notifications@github.com>
Sent: Tuesday, October 13, 2020 7:08 PM
To: mono/SkiaSharp <SkiaSharp@noreply.github.com>
Cc: Brian Limkemann <brian@decisivecomputing.com>; Mention <mention@noreply.github.com>
Subject: Re: [mono/SkiaSharp] SIGSEGV when using SKCanvas.DrawText() and then SKCanvas.Flush() (#647)
@blimkemann<https://github.com/blimkemann> Is this still happening? Have you tried the v2 of SKiaSharp?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#647 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACPIWVM2DFMHHOTPZ2AWDVDSKTMV7ANCNFSM4FX2OECQ>.
|
Thanks for the feedback. I'm closing it now. If things start happening, then feel free to open a new issue and link to this for context. |
Description
The app crashes when drawing text and then flushing the canvas. Waiting on a response from Google to address this.
Basic Information
Links
The text was updated successfully, but these errors were encountered: