ThinkGeo.com    |     Documentation    |     Premium Support

Random SkiaSharp exception

Hi,

We are currently using ThinkGeo version 14.3.1. We are still seeing random SkiaSharp exception on our automation similar to one which Jarno decribed in this old post A random SkiaSharp related unhandled exception

Actual exception is most of the time SEHException but also AccessViolationException is seen:

Exception Info: System.Runtime.InteropServices.SEHException
at SkiaSharp.SKImage.FromPixels(SkiaSharp.SKPixmap, SkiaSharp.SKImageRasterReleaseDelegate, System.Object)
at bkY=.9UU=.9kU=(ThinkGeo.Core.GeoImage)
at ThinkGeo.UI.Wpf.TileView.20U=(ThinkGeo.Core.GeoCanvas)
at ThinkGeo.UI.Wpf.TileOverlay+d__106.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()

Exception Info: System.AccessViolationException
at SkiaSharp.SKImage.FromPixels(SkiaSharp.SKPixmap, SkiaSharp.SKImageRasterReleaseDelegate, System.Object)
at bkY=.9UU=.9kU=(ThinkGeo.Core.GeoImage)
at ThinkGeo.UI.Wpf.TileView.20U=(ThinkGeo.Core.GeoCanvas)
at ThinkGeo.UI.Wpf.TileOverlay+d__106.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()

Do you have any idea what could cause that kind of issue ? Problem is that we cannot re-produce easily since it happens so randomly on automation…

Br, Simo

Hi Simo,

It seems this exception happens when converting a GeoImage to WriteableBitmap for display. It’s most likely be related to the tilecache, could because of a corrupted tile or a race condition under multi-threading.

  1. Can you locate which overlay which causes this issue, and disable TileOverlay.TileCache temporarily see if it still exists?
  2. what tilecache you are using? Just a standard FileTileCache or a custom one?

And here are something you can do on your side:

  1. Update to the latest version. we’ve made many internal stability improvements that may help, here you can see the change log:
    https://docs.thinkgeo.com/products/desktop-maps/changelog/#major-changes-for-thinkgeo-1432

  2. Enable internal logging to capture any underlying issues

ThinkGeoDebugger.LogType = ThinkGeoLogType.Rendering | ThinkGeoLogType.Caching | ThinkGeoLogType.Rendering;
ThinkGeoDebugger.LogLevel = ThinkGeoLogLevel.All;

Thanks,
Ben

Hi,

Problem with this exception is that it occurs like once in a month or two in our automation which runs lots of tests daily. So disabling cache temporarily would mean that we would need to disable it for months to see if it helps and that cannot be done. Same problem is with the enabling internal logging.

On our basic test setup we have two LayerOverlay’s both using FileRasterTileCache as tilecache. We also have ThrowingExceptionMode set to ThrowingExceptionMode.SuppressException on our overlays but still we get this crash.

Br, Simo