ThinkGeo.com    |     Documentation    |     Premium Support

Random SkiaSharp exception

Hi Simo,

We just released v14.4.3, but we didn’t include this change. During testing, we found it could make the peak memory too high. We have an idea to fix both the memory and AccessViolationException, we’ll do it in the beta branch, run more testing, and then bring it into a future stable release once it’s ready. At latest you can have it in v14.5.

Your other request is included in v14.4.3: OgcApiFeatureLayer and LayerOverlay - ThinkGeo UI for Desktop / WPF - ThinkGeo Discussion Forums

Thanks,
Ben

Hi,

OK, thanks for the info.

Br, Simo

Hi,

What is the status of that new attempt to fix this one ? Just wondering that would it be possible to get it to coming v14.4.4 hotfix ?

Br, Simo

Hi,

Any updates on this ?

Br, Simo

Hi Simo,

Sorry for the late reply. Sure, we will add this one as well.

Thanks,
Ben

1 Like

Hi,

Great, Thanks !

Is the schedule “end of the month” still valid for v14.4.4 ?

Br, Simo

Yep, you will see it within this week.

1 Like

Hi Simo, v14.4.4 is out.

1 Like

Hi,

This kind of SkiaSharp exception was seen with v14.4.4:

System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
at SkiaSharp.SKImage.FromBitmap(SKBitmap bitmap)
at SkiaSharp.SKCanvas.DrawBitmap(SKBitmap bitmap SKRect dest SKPaint paint)
at 9hQ=.RRU=.WBU=(GeoImage image Single x Single y Single width Single height Single canvasWidth Single canvasHeight)
at 9hQ=.RRU=.WRU=(GeoImage image Int32 x Int32 y Single canvasWidth Single canvasHeight)
at ThinkGeo.Core.SkiaGeoCanvas.FlushCore()
at ThinkGeo.Core.SkiaGeoCanvas.EndDrawingCore()
at ThinkGeo.UI.Wpf.AdornmentOverlay.<DrawAsyncCore>d__8.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ThinkGeo.UI.Wpf.Overlay.<DrawAsync>d__65.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at ThinkGeo.UI.Wpf.Overlay.x0U=(Exception e String memberName)
at ThinkGeo.UI.Wpf.Overlay.<DrawAsync>d__65.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ThinkGeo.UI.Wpf.MapViewBase.<DrawOverlayAsync>d__357.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ThinkGeo.UI.Wpf.MapViewBase.<DrawOverlaysAsync>d__351.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ThinkGeo.UI.Wpf.MapViewBase.<ZoomToAsync2>d__288.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ThinkGeo.UI.Wpf.MapViewBase.<ZoomToAsync>d__312.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

So far this has happened only once and did not happen again when we tried to re-produce it.

Could you please check it ?

Br, Simo

We are digging in. Is this exception catchable? or it would crash the application?

Hi,

I think that this time it happened actually in place (when ZoomToAsync was called by our app) where we could catch it. But this was the first time this happened in this place so we did not have catch for it so app crashed.

Br, Simo

Hi Simo,

  1. This is a related but different issue. It occurs intermittently due to a race condition.
  2. We have identified and fixed it in the latest beta. The fix will also be included in the upcoming v14.4.5 hotfix.
  3. In the latest beta and the upcoming v14.5 release, AdornmentOverlay has been significantly improved. For a quick preview, please see: Recommended way of having static elements on pannable background

Thanks,
Ben

1 Like

Hi,

This kind of random SkiaSharp related crash was also seen on test automation:

Exception Info: System.AccessViolationException
at SkiaSharp.SKBitmap.CopyTo(SkiaSharp.SKBitmap, SkiaSharp.SKColorType)
at SkiaSharp.SKBitmap.Copy(SkiaSharp.SKColorType)
at Y0c=.EEc=.EUc=(ThinkGeo.Core.GeoImage)
at ThinkGeo.UI.Wpf.TileView.8UY=(ThinkGeo.Core.GeoCanvas)
at ThinkGeo.UI.Wpf.TileOverlay+d__109.MoveNext()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
at System.Threading.ThreadPoolWorkQueue.Dispatch()

Please check this also.

Br, Simo

We didn’t aware SKBitmap.CopyTo was not thread-safe. Let us dig in and will keep you posted.

Hi,

Any updates to this latest SKBitmap.CopyTo exception ?

Br, Simo

Hi Simo,

We are pretty much done and now reviewing the changes. The new version will once and for all fix it without any performance penalty. It will be available in beta builds next week, and it will be available in the next major release.

We still haven’t decided it yet but given the changes we’ve made, most likely we cannot put it into a hotfix release. I’ll let you know by mid next week.

Thanks,
Ben

1 Like

Hi Simo,

I don’t think we can include this change in the hotfix release next week, it will for sure be included in the major release in May.

Thanks,
Ben

Hi Simo, just FYI the fix has been applied to beta package(beta099).

Hi,

Thanks for the info.

Br, Simo

Hi Simo, just FYI v14.4.5 is now available.

1 Like