Hi all,
We’ve been encountering an unhandled AccessViolationException in our automated test environment every now and then. The rate of occurrence is very low though, less than 1%. It is happening across different test machines so failing memory hardware is probably ruled out.
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at SkiaSharp.SKPath.GetBounds(SkiaSharp.SKRect ByRef)
at 7BQ=.MxU=.SxU=(System.String, ThinkGeo.Core.GeoFont)
at ThinkGeo.Core.ScaleLineAdornmentLayer.HiA=(System.String, ThinkGeo.Core.GeoFont, Int32, ThinkGeo.Core.GeoCanvas)
at ThinkGeo.Core.ScaleLineAdornmentLayer.HSA=(ThinkGeo.Core.GeoCanvas)
at ThinkGeo.Core.ScaleLineAdornmentLayer.DrawCore(ThinkGeo.Core.GeoCanvas, System.Collections.ObjectModel.Collection`1<ThinkGeo.Core.SimpleCandidate>)
at ThinkGeo.Core.Layer.Rh8=(ThinkGeo.Core.GeoCanvas, System.Collections.ObjectModel.Collection`1<ThinkGeo.Core.SimpleCandidate>)
at ThinkGeo.Core.Layer.Draw(ThinkGeo.Core.GeoCanvas, System.Collections.ObjectModel.Collection`1<ThinkGeo.Core.SimpleCandidate>)
at System.Threading.Tasks.Task.Execute()
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.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef)
at System.Threading.Tasks.Task.ExecuteEntry(Boolean)
at System.Threading.ThreadPoolWorkQueue.Dispatch()
The problem comes from the start of the application when user first navigates to the map. I think we have narrowed down where the problem probably originates from. Here’s a simplified code snippet of how the ScaleLineAdornmentLayer is added.
MapView.AdornmentOverlay.Layers.Clear();
var scale = new ScaleLineAdornmentLayer
{
Name = ScaleName,
UnitSystem = ScaleUnitSystem,
Location = ScaleLocation,
XOffsetInPixel = scaleXOffset,
YOffsetInPixel = scaleYOffset
};
scale.TextStyle.Font.Size = ScaleFontSize;
scale.Projection = ProjectionService.CurrentProjectionConverter.ExternalProjection;
MapView.AdornmentOverlay.Layers.Add(adornmentOverlay);
MapView.Overlays.Clear();
await MapView.RefreshAsync();
We are still using ThinkGeo 13.2 and for now cannot yet upgrade to 14.0 to try whether it still happens, for reasons we might be covering in another post. But does anyone have any ideas why this might be happening? Something in the way ScaleLineAdornmentLayer uses the fonts maybe?
Best Regards,
Jarno