dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.17k stars 4.72k forks source link

Runtime Crash (SIGSEGV) on iOS #98410

Closed divil5000 closed 3 months ago

divil5000 commented 8 months ago

Description

We use a polygon clipping library (Clipper2) which is available as a NuGet package and whose source is here on Github. When calling a method in the library to inflate a large polygon, the .net runtime crashes. It appears to be a native crash - the Visual Studio debugger does not intercept it, and I therefore cannot get a helpful stack trace for the crash. The native stuff that is dumped to the output window is below.

I am no expert on this low-level stuff and would appreciate any help from looking at the debug output as to where things might be going wrong. The library is mostly doing number-crunching. Its full source can be forked at https://github.com/AngusJohnson/Clipper2/.

Reproduction Steps

This code creates a large polygon and calls the InflatePaths method in the library to expand the polygon.

var paths = new PathsD();
var polygon = new PathD();
polygon.AddRange(new PointD[]
        { new PointD(-8470.4501953125, -42813.28125), new PointD(-8460.7470703125, -42814.30078125), new PointD(-8440.5146484375, -42820.4609375), new PointD(-8420.0205078125, -42825.6875), new PointD(-8399.310546875, -42829.984375), new PointD(-8378.4248046875, -42833.3359375), new PointD(-8357.4091796875, -42835.73046875), new PointD(-8336.3046875, -42837.17578125), new PointD(-8315.15625, -42837.65234375), new PointD(-8294.0087890625, -42837.17578125), new PointD(-8272.904296875, -42835.73046875), new PointD(-8251.8876953125, -42833.3359375), new PointD(-8231.001953125, -42829.984375), new PointD(-8210.2919921875, -42825.6875), new PointD(-8189.798828125, -42820.4609375), new PointD(-8169.56591796875, -42814.30078125), new PointD(-8149.63525390625, -42807.234375), new PointD(-8130.0478515625, -42799.26953125), new PointD(-8110.84375, -42790.42578125), new PointD(-8092.0634765625, -42780.71484375), new PointD(-8073.74462890625, -42770.1640625), new PointD(-8055.92626953125, -42758.80078125), new PointD(-8038.64501953125, -42746.63671875), new PointD(-8021.93505859375, -42733.69921875)
, new PointD(-8005.83203125, -42720.02734375), new PointD(-7990.3681640625, -42705.63671875), new PointD(-7975.576171875, -42690.55859375), new PointD(-7961.4853515625, -42674.8359375), new PointD(-7948.12451171875, -42658.48828125), new PointD(-7935.52099609375, -42641.5546875), new PointD(-7923.7001953125, -42624.0703125), new PointD(-7912.68603515625, -42606.078125), new PointD(-7902.5, -42587.6015625), new PointD(-7893.16357421875, -42568.69140625), new PointD(-7884.6953125, -42549.3828125), new PointD(-7877.11181640625, -42529.70703125), new PointD(-7870.42822265625, -42509.71875), new PointD(-7864.65673828125, -42489.45703125), new PointD(-7859.8095703125, -42468.94921875), new PointD(-7855.8955078125, -42448.2578125), new PointD(-7852.92236328125, -42427.41015625), new PointD(-7850.8955078125, -42406.453125), new PointD(-7849.81884765625, -42385.43359375), new PointD(-7849.0029296875, -42371.94921875), new PointD(-7849.0029296875, -42012.6640625), new PointD(-7849.0029296875, -41318.671875), new PointD(-8224.318359375, -40734.03125), new PointD(-8492.20703125, -40526.49609375), new PointD(-8609.970703125, -40434.828125), new PointD(-8811.7705078125, -40277.3125), new PointD(-9790.8564453125, -40277.3125), new PointD(-9026.5986328125, -40790.921875), new PointD(-9027.2783203125, -40791.44140625), new PointD(-9029.970703125, -40792.84765625), new PointD(-9027.005859375, -40794.21875), new PointD(-9027.822265625, -40795.77734375), new PointD(-9026.9111328125, -40796.8046875), new PointD(-9028.0400390625, -40796.8359375), new PointD(-9024.7216796875, -40798.8203125), new PointD(-9025.673828125, -40802.96875), new PointD(-9022.1513671875, -40804.66796875), new PointD(-9025.197265625, -40807.984375), new PointD(-9025.224609375, -40809.875), new PointD(-9017.21484375, -40822.0625), new PointD(-9017.9501953125, -40826.51953125), new PointD(-9014.9580078125, -40830.203125), new PointD(-9013.326171875, -40836.69921875), new PointD(-9009.1923828125, -40838.5390625), new PointD(-9009.369140625, -40841.125), new PointD(-9006.486328125, -40842.79296875), new PointD(-9006.5673828125, -40846.52734375), new PointD(-9001.658203125, -40853.26171875), new PointD(-9047.294921875, -41015.08984375), new PointD(-9048.568359375, -41014.8203125), new PointD(-9066.6923828125, -41005.09765625), new PointD(-9085.611328125, -40997.03125), new PointD(-9105.1748046875, -40990.69140625), new PointD(-9125.2265625, -40986.125), new PointD(-9145.6025390625, -40983.375), new PointD(-9166.14453125, -40982.453125), new PointD(-9186.6865234375, -40983.375), new PointD(-9207.0634765625, -40986.125), new PointD(-9227.1142578125, -40990.69140625), new PointD(-9246.677734375, -40997.03125)
, new PointD(-9265.59765625, -41005.09765625), new PointD(-9283.7216796875, -41014.8203125), new PointD(-9300.9052734375, -41026.125), new PointD(-9317.009765625, -41038.9296875), new PointD(-9331.9091796875, -41053.12109375), new PointD(-9345.478515625, -41068.59375), new PointD(-9357.611328125, -41085.22265625), new PointD(-9368.2099609375, -41102.87109375), new PointD(-9377.1875, -41121.40234375), new PointD(-9384.470703125, -41140.671875), new PointD(-9390, -41160.51171875), new PointD(-9393.73046875, -41180.78125), new PointD(-9395.6298828125, -41201.30078125), new PointD(-9395.6826171875, -41221.91796875), new PointD(-9393.88671875, -41242.45703125), new PointD(-9390.255859375, -41262.76171875), new PointD(-9388.34375, -41269.80859375), new PointD(-9254.806640625, -41225.50390625), new PointD(-9246.5263671875, -41223.62109375), new PointD(-9230.2265625, -41220.1015625), new PointD(-9213.6455078125, -41218.3359375), new PointD(-9196.970703125, -41218.3359375), new PointD(-9180.3896484375, -41220.1015625), new PointD(-9164.08984375, -41223.62109375), new PointD(-9148.2548828125, -41228.8515625), new PointD(-9133.0615234375, -41235.73046875), new PointD(-9118.6845703125, -41244.1875), new PointD(-9105.2841796875, -41254.12109375), new PointD(-9093.8017578125, -41264.2265625), new PointD(-9093.013671875, -41265.421875), new PointD(-9082.009765625, -41277.9609375), new PointD(-9072.3984375, -41291.60546875), new PointD(-9064.2890625, -41306.1953125), new PointD(-9061.708984375, -41311.69140625), new PointD(-8998.6123046875, -41463.6875), new PointD(-8992.357421875, -41478.72265625), new PointD(-8900.16015625, -41700.05078125), new PointD(-8731.5400390625, -41968.6875), new PointD(-8534.0908203125, -42289.3125), new PointD(-8437.814453125, -42444.76171875), new PointD(-8470.4501953125, -42813.28125) });
paths.Add(polygon);
var solutionPolygons = Clipper2Lib.Clipper.InflatePaths(paths, 0.5, Clipper2Lib.JoinType.Round, Clipper2Lib.EndType.Polygon);

Expected behavior

No crash

Actual behavior

=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

An error has occurred in the native fault reporting. Some diagnostic information will be unavailable.

=================================================================
    Native stacktrace:
=================================================================
    0x104c2e38c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions
    0x104c19488 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions
    0x104bfd9e4 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative
94732C290A0/appname6.app/appname6 : 
    0x1028929b8 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x1028a3a84 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x1028a3d10 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x1028acb48 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x1028c6e6c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x1028f7634 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x1047c91f8 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x104c009d0 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : Globalizat
    Native stacktrace:
=================================================================
    0x104c2e38c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions
    0x104c19488 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions
    0x104bfd9e4 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions
    0x21a0ad214 - /usr/lib/system/libsystem_platform.dylib : <redacted>
    0x104644024 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x104643670 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x104643478 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x104642ce0 - /private/var/c

=================================================================
    Native Crash Reporting
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

=================================================================

    0x1bd081500 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>

    0x1bd76ea68 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>

    0x1bd081634 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>

    0x1bcf2ec70 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>

    0x1bd1cf850 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>

    0x1bd081c5c - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>

    0x1bce91664 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : _UIScenePerformActionsWithLifecycleActionMask

    0x1bd80d074 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion

- /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions
    0x104c6d618 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions
    0x1bd14b054 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
    0x1bd14a78c - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
    0x1bd149768 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
    0x1bd1493b4 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>

    0x1bd3a01ac - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>

BC70-A94732C290A0/appname6.app/appname6 : 
    0x1028c6e6c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x1028f7634 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x1047c91f8 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x104c009d0 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions
    0x104b4ff80 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : _ZNK3icu6number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode
    0x104b53620 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : _ZNK3icu6number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode
    0x104c6d964 
    0x1d0e04120 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
    0x1d0e3fcc0 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
    0x1c2253eac - /usr/lib/system/libdispatch.dylib : <redacted>
    0x1c225791c - /usr/lib/system/libdispatch.dylib : <redacted>
    0x1d0e0e24c - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
    0x1d0e0dde8 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
    0x1d0e10694 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
    0x1bae5a128 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
    0x1bae667b4 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
    0x1badeb648 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
    0x1bae010d4 - /System/Library/Frameworks/CoreFoundation.framewor
    0x1bd081a84 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>

ontainers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x10440b33c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x104658c2c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x104658b80 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x10289aae4 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x1028929b8 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x1028a3a84 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x1028a3d10 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x1028acb48 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-
    0x1bcfffc60 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
    0x1bcfffad0 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>

    0x1bcfffad0 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>

    0x1bd80d074 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion
    0x1bcf2ec70 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>

    0x1bd3a01ac - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
    0x1bcfffc60 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>

ionNative_InitICUFunctions
    0x104b4ff80 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : _ZNK3icu6number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode
    0x104b53620 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : _ZNK3icu6number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode
    0x104c6d964 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions
    0x104c6d618 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions
    0x1bd14b054 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
    0x1bd14a78c - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
    0x1bd149768 - /System/Library/PrivateFrameworks/UIKitC
    0x1bd76ea68 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>

    0x1bd081500 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>

ore.framework/UIKitCore : <redacted>
    0x1bd1493b4 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
    0x1bce91664 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : _UIScenePerformActionsWithLifecycleActionMask
    0x1bd1cf850 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
    0x1bd081c5c - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
    0x1bd081a84 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
    0x1bd081634 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>

_InitICUFunctions
    0x21a0ad214 - /usr/lib/system/libsystem_platform.dylib : <redacted>
    0x104644024 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x104643670 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x104643478 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x104642ce0 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x10440b33c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x104658c2c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x104658b80 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x10289aae4 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A
kyDemon6.app/appname6 : xamarin_log
    0x104c6bf48 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions
    0x1da328dec - /usr/lib/dyld : <redacted>

=================================================================
    Basic Fault Address Reporting
=================================================================
instruction pointer is NULL, skip dumping
=================================================================
    Managed Stacktrace:
=================================================================
      at <unknown> <0xffffffff>
      at UIKit.UIApplication:xamarin_UIApplicationMain <0x00007>
      at UIKit.UIApplication:UIApplicationMain <0x00063>
      at UIKit.UIApplication:Main <0x0013b>
      at appname.appname.Application:Main <0x00273>
      at System.Object:runtime_invoke_dynamic <0x00127>
=================================================================

=================================================================
    N
E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x1047c91f8 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x104c009d0 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions
    0x104b4ff80 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : _ZNK3icu6number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode
    0x104b56828 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : _ZNK3icu6number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode
    0x104c05aa4 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions
    0x104997140 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/S
rks/CoreFoundation.framework/CoreFoundation : <redacted>
    0x1bae667b4 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
    0x1badeb648 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
    0x1bae010d4 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
    0x1bae063ec - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : CFRunLoopRunSpecific
    0x1f5a1435c - /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices : GSEventRunModal
    0x1bd192f58 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>

80 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : _ZNK3icu6number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode
    0x104b56828 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : _ZNK3icu6number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode
    0x104c05aa4 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions
    0x104997140 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : xamarin_log
    0x104c6bf48 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions
    0x1da328dec - /usr/lib/dyld : <redacted>

Exiting early due to double fault.

    0x1bd192bbc - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : UIApplicationMain
    0x10498046c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : xamarin_UIApplicationMain
    0x10493a990 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x1048c61a4 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x1048c63bc - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x1028f8344 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x1047c91f8 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 
    0x104c009d0 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions
    0x104b4ff
    0x1bcfff028 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>

    0x1bcffedb4 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
    0x1d0e002e4 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
    0x1d0e40068 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
    0x1d0e04120 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
    0x1d0e3fcc0 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
    0x1c2253eac - /usr/lib/system/libdispatch.dylib : <redacted>
    0x1c225791c - /usr/lib/system/libdispatch.dylib : <redacted>
    0x1d0e0e24c - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
    0x1d0e0dde8 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
    0x1d0e10694 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
    0x1bae5a128 - /System/Library/Framewo
The app has been terminated.

Regression?

No response

Known Workarounds

So far I have not been able to devise a workaround.

Configuration

The code is currently being compiled for net7-ios. We cannot move to .net8-ios because that seems to have a minimum iOS version of 11, and we need to support 10.

Other information

No response

ghost commented 8 months ago

Tagging subscribers to 'os-ios': @steveisok, @akoeplinger, @kotlarmilos See info in area-owners.md if you want to be subscribed.

Issue Details
### Description We use a polygon clipping library (Clipper2) which is available as a NuGet package and whose source is here on Github. When calling a method in the library to inflate a large polygon, the .net runtime crashes. It appears to be a native crash - the Visual Studio debugger does not intercept it, and I therefore cannot get a helpful stack trace for the crash. The native stuff that is dumped to the output window is below. I am no expert on this low-level stuff and would appreciate any help from looking at the debug output as to where things might be going wrong. The library is mostly doing number-crunching. Its full source can be forked at https://github.com/AngusJohnson/Clipper2/. ### Reproduction Steps This code creates a large polygon and calls the InflatePaths method in the library to expand the polygon. var paths = new PathsD(); var polygon = new PathD(); polygon.AddRange(new PointD[] { new PointD(-8470.4501953125, -42813.28125), new PointD(-8460.7470703125, -42814.30078125), new PointD(-8440.5146484375, -42820.4609375), new PointD(-8420.0205078125, -42825.6875), new PointD(-8399.310546875, -42829.984375), new PointD(-8378.4248046875, -42833.3359375), new PointD(-8357.4091796875, -42835.73046875), new PointD(-8336.3046875, -42837.17578125), new PointD(-8315.15625, -42837.65234375), new PointD(-8294.0087890625, -42837.17578125), new PointD(-8272.904296875, -42835.73046875), new PointD(-8251.8876953125, -42833.3359375), new PointD(-8231.001953125, -42829.984375), new PointD(-8210.2919921875, -42825.6875), new PointD(-8189.798828125, -42820.4609375), new PointD(-8169.56591796875, -42814.30078125), new PointD(-8149.63525390625, -42807.234375), new PointD(-8130.0478515625, -42799.26953125), new PointD(-8110.84375, -42790.42578125), new PointD(-8092.0634765625, -42780.71484375), new PointD(-8073.74462890625, -42770.1640625), new PointD(-8055.92626953125, -42758.80078125), new PointD(-8038.64501953125, -42746.63671875), new PointD(-8021.93505859375, -42733.69921875) , new PointD(-8005.83203125, -42720.02734375), new PointD(-7990.3681640625, -42705.63671875), new PointD(-7975.576171875, -42690.55859375), new PointD(-7961.4853515625, -42674.8359375), new PointD(-7948.12451171875, -42658.48828125), new PointD(-7935.52099609375, -42641.5546875), new PointD(-7923.7001953125, -42624.0703125), new PointD(-7912.68603515625, -42606.078125), new PointD(-7902.5, -42587.6015625), new PointD(-7893.16357421875, -42568.69140625), new PointD(-7884.6953125, -42549.3828125), new PointD(-7877.11181640625, -42529.70703125), new PointD(-7870.42822265625, -42509.71875), new PointD(-7864.65673828125, -42489.45703125), new PointD(-7859.8095703125, -42468.94921875), new PointD(-7855.8955078125, -42448.2578125), new PointD(-7852.92236328125, -42427.41015625), new PointD(-7850.8955078125, -42406.453125), new PointD(-7849.81884765625, -42385.43359375), new PointD(-7849.0029296875, -42371.94921875), new PointD(-7849.0029296875, -42012.6640625), new PointD(-7849.0029296875, -41318.671875), new PointD(-8224.318359375, -40734.03125), new PointD(-8492.20703125, -40526.49609375), new PointD(-8609.970703125, -40434.828125), new PointD(-8811.7705078125, -40277.3125), new PointD(-9790.8564453125, -40277.3125), new PointD(-9026.5986328125, -40790.921875), new PointD(-9027.2783203125, -40791.44140625), new PointD(-9029.970703125, -40792.84765625), new PointD(-9027.005859375, -40794.21875), new PointD(-9027.822265625, -40795.77734375), new PointD(-9026.9111328125, -40796.8046875), new PointD(-9028.0400390625, -40796.8359375), new PointD(-9024.7216796875, -40798.8203125), new PointD(-9025.673828125, -40802.96875), new PointD(-9022.1513671875, -40804.66796875), new PointD(-9025.197265625, -40807.984375), new PointD(-9025.224609375, -40809.875), new PointD(-9017.21484375, -40822.0625), new PointD(-9017.9501953125, -40826.51953125), new PointD(-9014.9580078125, -40830.203125), new PointD(-9013.326171875, -40836.69921875), new PointD(-9009.1923828125, -40838.5390625), new PointD(-9009.369140625, -40841.125), new PointD(-9006.486328125, -40842.79296875), new PointD(-9006.5673828125, -40846.52734375), new PointD(-9001.658203125, -40853.26171875), new PointD(-9047.294921875, -41015.08984375), new PointD(-9048.568359375, -41014.8203125), new PointD(-9066.6923828125, -41005.09765625), new PointD(-9085.611328125, -40997.03125), new PointD(-9105.1748046875, -40990.69140625), new PointD(-9125.2265625, -40986.125), new PointD(-9145.6025390625, -40983.375), new PointD(-9166.14453125, -40982.453125), new PointD(-9186.6865234375, -40983.375), new PointD(-9207.0634765625, -40986.125), new PointD(-9227.1142578125, -40990.69140625), new PointD(-9246.677734375, -40997.03125) , new PointD(-9265.59765625, -41005.09765625), new PointD(-9283.7216796875, -41014.8203125), new PointD(-9300.9052734375, -41026.125), new PointD(-9317.009765625, -41038.9296875), new PointD(-9331.9091796875, -41053.12109375), new PointD(-9345.478515625, -41068.59375), new PointD(-9357.611328125, -41085.22265625), new PointD(-9368.2099609375, -41102.87109375), new PointD(-9377.1875, -41121.40234375), new PointD(-9384.470703125, -41140.671875), new PointD(-9390, -41160.51171875), new PointD(-9393.73046875, -41180.78125), new PointD(-9395.6298828125, -41201.30078125), new PointD(-9395.6826171875, -41221.91796875), new PointD(-9393.88671875, -41242.45703125), new PointD(-9390.255859375, -41262.76171875), new PointD(-9388.34375, -41269.80859375), new PointD(-9254.806640625, -41225.50390625), new PointD(-9246.5263671875, -41223.62109375), new PointD(-9230.2265625, -41220.1015625), new PointD(-9213.6455078125, -41218.3359375), new PointD(-9196.970703125, -41218.3359375), new PointD(-9180.3896484375, -41220.1015625), new PointD(-9164.08984375, -41223.62109375), new PointD(-9148.2548828125, -41228.8515625), new PointD(-9133.0615234375, -41235.73046875), new PointD(-9118.6845703125, -41244.1875), new PointD(-9105.2841796875, -41254.12109375), new PointD(-9093.8017578125, -41264.2265625), new PointD(-9093.013671875, -41265.421875), new PointD(-9082.009765625, -41277.9609375), new PointD(-9072.3984375, -41291.60546875), new PointD(-9064.2890625, -41306.1953125), new PointD(-9061.708984375, -41311.69140625), new PointD(-8998.6123046875, -41463.6875), new PointD(-8992.357421875, -41478.72265625), new PointD(-8900.16015625, -41700.05078125), new PointD(-8731.5400390625, -41968.6875), new PointD(-8534.0908203125, -42289.3125), new PointD(-8437.814453125, -42444.76171875), new PointD(-8470.4501953125, -42813.28125) }); paths.Add(polygon); var solutionPolygons = Clipper2Lib.Clipper.InflatePaths(paths, 0.5, Clipper2Lib.JoinType.Round, Clipper2Lib.EndType.Polygon); ### Expected behavior No crash ### Actual behavior `================================================================= Got a SIGSEGV while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. ================================================================= An error has occurred in the native fault reporting. Some diagnostic information will be unavailable. ================================================================= Native stacktrace: ================================================================= 0x104c2e38c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x104c19488 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x104bfd9e4 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative 94732C290A0/appname6.app/appname6 : 0x1028929b8 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1028a3a84 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1028a3d10 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1028acb48 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1028c6e6c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1028f7634 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1047c91f8 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104c009d0 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : Globalizat Native stacktrace: ================================================================= 0x104c2e38c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x104c19488 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x104bfd9e4 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x21a0ad214 - /usr/lib/system/libsystem_platform.dylib : 0x104644024 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104643670 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104643478 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104642ce0 - /private/var/c ================================================================= Native Crash Reporting ================================================================= Got a SIGSEGV while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. ================================================================= ================================================================= 0x1bd081500 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd76ea68 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd081634 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bcf2ec70 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd1cf850 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd081c5c - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bce91664 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : _UIScenePerformActionsWithLifecycleActionMask 0x1bd80d074 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x104c6d618 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x1bd14b054 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd14a78c - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd149768 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd1493b4 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd3a01ac - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : BC70-A94732C290A0/appname6.app/appname6 : 0x1028c6e6c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1028f7634 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1047c91f8 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104c009d0 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x104b4ff80 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : _ZNK3icu6number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode 0x104b53620 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : _ZNK3icu6number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode 0x104c6d964 0x1d0e04120 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : 0x1d0e3fcc0 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : 0x1c2253eac - /usr/lib/system/libdispatch.dylib : 0x1c225791c - /usr/lib/system/libdispatch.dylib : 0x1d0e0e24c - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : 0x1d0e0dde8 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : 0x1d0e10694 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : 0x1bae5a128 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : 0x1bae667b4 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : 0x1badeb648 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : 0x1bae010d4 - /System/Library/Frameworks/CoreFoundation.framewor 0x1bd081a84 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : ontainers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x10440b33c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104658c2c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104658b80 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x10289aae4 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1028929b8 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1028a3a84 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1028a3d10 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1028acb48 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7- 0x1bcfffc60 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bcfffad0 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bcfffad0 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd80d074 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion 0x1bcf2ec70 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd3a01ac - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bcfffc60 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : ionNative_InitICUFunctions 0x104b4ff80 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : _ZNK3icu6number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode 0x104b53620 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : _ZNK3icu6number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode 0x104c6d964 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x104c6d618 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x1bd14b054 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd14a78c - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd149768 - /System/Library/PrivateFrameworks/UIKitC 0x1bd76ea68 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd081500 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : ore.framework/UIKitCore : 0x1bd1493b4 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bce91664 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : _UIScenePerformActionsWithLifecycleActionMask 0x1bd1cf850 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd081c5c - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd081a84 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd081634 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : _InitICUFunctions 0x21a0ad214 - /usr/lib/system/libsystem_platform.dylib : 0x104644024 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104643670 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104643478 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104642ce0 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x10440b33c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104658c2c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104658b80 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x10289aae4 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A kyDemon6.app/appname6 : xamarin_log 0x104c6bf48 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x1da328dec - /usr/lib/dyld : ================================================================= Basic Fault Address Reporting ================================================================= instruction pointer is NULL, skip dumping ================================================================= Managed Stacktrace: ================================================================= at <0xffffffff> at UIKit.UIApplication:xamarin_UIApplicationMain <0x00007> at UIKit.UIApplication:UIApplicationMain <0x00063> at UIKit.UIApplication:Main <0x0013b> at appname.appname.Application:Main <0x00273> at System.Object:runtime_invoke_dynamic <0x00127> ================================================================= ================================================================= N E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1047c91f8 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104c009d0 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x104b4ff80 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : _ZNK3icu6number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode 0x104b56828 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : _ZNK3icu6number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode 0x104c05aa4 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x104997140 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/S rks/CoreFoundation.framework/CoreFoundation : 0x1bae667b4 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : 0x1badeb648 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : 0x1bae010d4 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : 0x1bae063ec - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : CFRunLoopRunSpecific 0x1f5a1435c - /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices : GSEventRunModal 0x1bd192f58 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 80 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : _ZNK3icu6number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode 0x104b56828 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : _ZNK3icu6number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode 0x104c05aa4 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x104997140 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : xamarin_log 0x104c6bf48 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x1da328dec - /usr/lib/dyld : Exiting early due to double fault. 0x1bd192bbc - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : UIApplicationMain 0x10498046c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : xamarin_UIApplicationMain 0x10493a990 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1048c61a4 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1048c63bc - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1028f8344 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1047c91f8 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104c009d0 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x104b4ff 0x1bcfff028 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bcffedb4 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1d0e002e4 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : 0x1d0e40068 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : 0x1d0e04120 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : 0x1d0e3fcc0 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : 0x1c2253eac - /usr/lib/system/libdispatch.dylib : 0x1c225791c - /usr/lib/system/libdispatch.dylib : 0x1d0e0e24c - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : 0x1d0e0dde8 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : 0x1d0e10694 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : 0x1bae5a128 - /System/Library/Framewo The app has been terminated. ` ### Regression? _No response_ ### Known Workarounds So far I have not been able to devise a workaround. ### Configuration The code is currently being compiled for net7-ios. We cannot move to .net8-ios because that seems to have a minimum iOS version of 11, and we need to support 10. ### Other information _No response_
Author: divil5000
Assignees: -
Labels: `untriaged`, `os-ios`, `needs-area-label`
Milestone: -
filipnavara commented 8 months ago

This seems to be a crash in GlobalizationNative_InitICUFunctions, possibly due to missing ICU files in the application bundle.

divil5000 commented 8 months ago

Today is the first time I've read about ICU files. I am unaware of ever having needed to include any with our app on any platform, certainly. What (in the code) would trigger the need for an ICU file?

filipnavara commented 8 months ago

Any string functions that deal with globalization require the ICU libraries and data files. They are normally bundled as part of the net7.0-ios app bundle when building the app but it seems that it may have failed for your app somewhere in the process.

divil5000 commented 8 months ago

It's hard to imagine, given that our app works perfectly without the use of this library, and this function we are calling only really does number-crunching. Is it possible that an exception is about to be thrown, and .net is trying to use ICU libraries to format the exception message or similar?

Edit to say: the function we are calling almost certainly does not concern itself with strings!

akoeplinger commented 8 months ago

Hm not really since it's trying to initialize ICU which probably should've already happened at that point, unless you're not doing culture-sensitive string operations (but the library might).

Can you please try running on net8.0-ios to see if it reproduces there?

ghost commented 8 months ago

Tagging subscribers to this area: @dotnet/area-system-globalization See info in area-owners.md if you want to be subscribed.

Issue Details
### Description We use a polygon clipping library (Clipper2) which is available as a NuGet package and whose source is here on Github. When calling a method in the library to inflate a large polygon, the .net runtime crashes. It appears to be a native crash - the Visual Studio debugger does not intercept it, and I therefore cannot get a helpful stack trace for the crash. The native stuff that is dumped to the output window is below. I am no expert on this low-level stuff and would appreciate any help from looking at the debug output as to where things might be going wrong. The library is mostly doing number-crunching. Its full source can be forked at https://github.com/AngusJohnson/Clipper2/. ### Reproduction Steps This code creates a large polygon and calls the InflatePaths method in the library to expand the polygon. ```csharp var paths = new PathsD(); var polygon = new PathD(); polygon.AddRange(new PointD[] { new PointD(-8470.4501953125, -42813.28125), new PointD(-8460.7470703125, -42814.30078125), new PointD(-8440.5146484375, -42820.4609375), new PointD(-8420.0205078125, -42825.6875), new PointD(-8399.310546875, -42829.984375), new PointD(-8378.4248046875, -42833.3359375), new PointD(-8357.4091796875, -42835.73046875), new PointD(-8336.3046875, -42837.17578125), new PointD(-8315.15625, -42837.65234375), new PointD(-8294.0087890625, -42837.17578125), new PointD(-8272.904296875, -42835.73046875), new PointD(-8251.8876953125, -42833.3359375), new PointD(-8231.001953125, -42829.984375), new PointD(-8210.2919921875, -42825.6875), new PointD(-8189.798828125, -42820.4609375), new PointD(-8169.56591796875, -42814.30078125), new PointD(-8149.63525390625, -42807.234375), new PointD(-8130.0478515625, -42799.26953125), new PointD(-8110.84375, -42790.42578125), new PointD(-8092.0634765625, -42780.71484375), new PointD(-8073.74462890625, -42770.1640625), new PointD(-8055.92626953125, -42758.80078125), new PointD(-8038.64501953125, -42746.63671875), new PointD(-8021.93505859375, -42733.69921875) , new PointD(-8005.83203125, -42720.02734375), new PointD(-7990.3681640625, -42705.63671875), new PointD(-7975.576171875, -42690.55859375), new PointD(-7961.4853515625, -42674.8359375), new PointD(-7948.12451171875, -42658.48828125), new PointD(-7935.52099609375, -42641.5546875), new PointD(-7923.7001953125, -42624.0703125), new PointD(-7912.68603515625, -42606.078125), new PointD(-7902.5, -42587.6015625), new PointD(-7893.16357421875, -42568.69140625), new PointD(-7884.6953125, -42549.3828125), new PointD(-7877.11181640625, -42529.70703125), new PointD(-7870.42822265625, -42509.71875), new PointD(-7864.65673828125, -42489.45703125), new PointD(-7859.8095703125, -42468.94921875), new PointD(-7855.8955078125, -42448.2578125), new PointD(-7852.92236328125, -42427.41015625), new PointD(-7850.8955078125, -42406.453125), new PointD(-7849.81884765625, -42385.43359375), new PointD(-7849.0029296875, -42371.94921875), new PointD(-7849.0029296875, -42012.6640625), new PointD(-7849.0029296875, -41318.671875), new PointD(-8224.318359375, -40734.03125), new PointD(-8492.20703125, -40526.49609375), new PointD(-8609.970703125, -40434.828125), new PointD(-8811.7705078125, -40277.3125), new PointD(-9790.8564453125, -40277.3125), new PointD(-9026.5986328125, -40790.921875), new PointD(-9027.2783203125, -40791.44140625), new PointD(-9029.970703125, -40792.84765625), new PointD(-9027.005859375, -40794.21875), new PointD(-9027.822265625, -40795.77734375), new PointD(-9026.9111328125, -40796.8046875), new PointD(-9028.0400390625, -40796.8359375), new PointD(-9024.7216796875, -40798.8203125), new PointD(-9025.673828125, -40802.96875), new PointD(-9022.1513671875, -40804.66796875), new PointD(-9025.197265625, -40807.984375), new PointD(-9025.224609375, -40809.875), new PointD(-9017.21484375, -40822.0625), new PointD(-9017.9501953125, -40826.51953125), new PointD(-9014.9580078125, -40830.203125), new PointD(-9013.326171875, -40836.69921875), new PointD(-9009.1923828125, -40838.5390625), new PointD(-9009.369140625, -40841.125), new PointD(-9006.486328125, -40842.79296875), new PointD(-9006.5673828125, -40846.52734375), new PointD(-9001.658203125, -40853.26171875), new PointD(-9047.294921875, -41015.08984375), new PointD(-9048.568359375, -41014.8203125), new PointD(-9066.6923828125, -41005.09765625), new PointD(-9085.611328125, -40997.03125), new PointD(-9105.1748046875, -40990.69140625), new PointD(-9125.2265625, -40986.125), new PointD(-9145.6025390625, -40983.375), new PointD(-9166.14453125, -40982.453125), new PointD(-9186.6865234375, -40983.375), new PointD(-9207.0634765625, -40986.125), new PointD(-9227.1142578125, -40990.69140625), new PointD(-9246.677734375, -40997.03125) , new PointD(-9265.59765625, -41005.09765625), new PointD(-9283.7216796875, -41014.8203125), new PointD(-9300.9052734375, -41026.125), new PointD(-9317.009765625, -41038.9296875), new PointD(-9331.9091796875, -41053.12109375), new PointD(-9345.478515625, -41068.59375), new PointD(-9357.611328125, -41085.22265625), new PointD(-9368.2099609375, -41102.87109375), new PointD(-9377.1875, -41121.40234375), new PointD(-9384.470703125, -41140.671875), new PointD(-9390, -41160.51171875), new PointD(-9393.73046875, -41180.78125), new PointD(-9395.6298828125, -41201.30078125), new PointD(-9395.6826171875, -41221.91796875), new PointD(-9393.88671875, -41242.45703125), new PointD(-9390.255859375, -41262.76171875), new PointD(-9388.34375, -41269.80859375), new PointD(-9254.806640625, -41225.50390625), new PointD(-9246.5263671875, -41223.62109375), new PointD(-9230.2265625, -41220.1015625), new PointD(-9213.6455078125, -41218.3359375), new PointD(-9196.970703125, -41218.3359375), new PointD(-9180.3896484375, -41220.1015625), new PointD(-9164.08984375, -41223.62109375), new PointD(-9148.2548828125, -41228.8515625), new PointD(-9133.0615234375, -41235.73046875), new PointD(-9118.6845703125, -41244.1875), new PointD(-9105.2841796875, -41254.12109375), new PointD(-9093.8017578125, -41264.2265625), new PointD(-9093.013671875, -41265.421875), new PointD(-9082.009765625, -41277.9609375), new PointD(-9072.3984375, -41291.60546875), new PointD(-9064.2890625, -41306.1953125), new PointD(-9061.708984375, -41311.69140625), new PointD(-8998.6123046875, -41463.6875), new PointD(-8992.357421875, -41478.72265625), new PointD(-8900.16015625, -41700.05078125), new PointD(-8731.5400390625, -41968.6875), new PointD(-8534.0908203125, -42289.3125), new PointD(-8437.814453125, -42444.76171875), new PointD(-8470.4501953125, -42813.28125) }); paths.Add(polygon); var solutionPolygons = Clipper2Lib.Clipper.InflatePaths(paths, 0.5, Clipper2Lib.JoinType.Round, Clipper2Lib.EndType.Polygon); ``` ### Expected behavior No crash ### Actual behavior ``` ================================================================= Got a SIGSEGV while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. ================================================================= An error has occurred in the native fault reporting. Some diagnostic information will be unavailable. ================================================================= Native stacktrace: ================================================================= 0x104c2e38c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x104c19488 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x104bfd9e4 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative 94732C290A0/appname6.app/appname6 : 0x1028929b8 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1028a3a84 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1028a3d10 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1028acb48 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1028c6e6c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1028f7634 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1047c91f8 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104c009d0 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : Globalizat Native stacktrace: ================================================================= 0x104c2e38c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x104c19488 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x104bfd9e4 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x21a0ad214 - /usr/lib/system/libsystem_platform.dylib : 0x104644024 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104643670 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104643478 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104642ce0 - /private/var/c ================================================================= Native Crash Reporting ================================================================= Got a SIGSEGV while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. ================================================================= ================================================================= 0x1bd081500 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd76ea68 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd081634 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bcf2ec70 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd1cf850 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd081c5c - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bce91664 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : _UIScenePerformActionsWithLifecycleActionMask 0x1bd80d074 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x104c6d618 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x1bd14b054 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd14a78c - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd149768 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd1493b4 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd3a01ac - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : BC70-A94732C290A0/appname6.app/appname6 : 0x1028c6e6c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1028f7634 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1047c91f8 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104c009d0 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x104b4ff80 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : _ZNK3icu6number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode 0x104b53620 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : _ZNK3icu6number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode 0x104c6d964 0x1d0e04120 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : 0x1d0e3fcc0 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : 0x1c2253eac - /usr/lib/system/libdispatch.dylib : 0x1c225791c - /usr/lib/system/libdispatch.dylib : 0x1d0e0e24c - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : 0x1d0e0dde8 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : 0x1d0e10694 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : 0x1bae5a128 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : 0x1bae667b4 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : 0x1badeb648 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : 0x1bae010d4 - /System/Library/Frameworks/CoreFoundation.framewor 0x1bd081a84 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : ontainers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x10440b33c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104658c2c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104658b80 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x10289aae4 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1028929b8 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1028a3a84 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1028a3d10 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1028acb48 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7- 0x1bcfffc60 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bcfffad0 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bcfffad0 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd80d074 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion 0x1bcf2ec70 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd3a01ac - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bcfffc60 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : ionNative_InitICUFunctions 0x104b4ff80 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : _ZNK3icu6number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode 0x104b53620 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : _ZNK3icu6number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode 0x104c6d964 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x104c6d618 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x1bd14b054 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd14a78c - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd149768 - /System/Library/PrivateFrameworks/UIKitC 0x1bd76ea68 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd081500 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : ore.framework/UIKitCore : 0x1bd1493b4 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bce91664 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : _UIScenePerformActionsWithLifecycleActionMask 0x1bd1cf850 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd081c5c - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd081a84 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bd081634 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : _InitICUFunctions 0x21a0ad214 - /usr/lib/system/libsystem_platform.dylib : 0x104644024 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104643670 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104643478 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104642ce0 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x10440b33c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104658c2c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104658b80 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x10289aae4 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A kyDemon6.app/appname6 : xamarin_log 0x104c6bf48 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x1da328dec - /usr/lib/dyld : ================================================================= Basic Fault Address Reporting ================================================================= instruction pointer is NULL, skip dumping ================================================================= Managed Stacktrace: ================================================================= at <0xffffffff> at UIKit.UIApplication:xamarin_UIApplicationMain <0x00007> at UIKit.UIApplication:UIApplicationMain <0x00063> at UIKit.UIApplication:Main <0x0013b> at appname.appname.Application:Main <0x00273> at System.Object:runtime_invoke_dynamic <0x00127> ================================================================= ================================================================= N E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1047c91f8 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104c009d0 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x104b4ff80 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : _ZNK3icu6number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode 0x104b56828 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : _ZNK3icu6number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode 0x104c05aa4 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x104997140 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/S rks/CoreFoundation.framework/CoreFoundation : 0x1bae667b4 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : 0x1badeb648 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : 0x1bae010d4 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : 0x1bae063ec - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : CFRunLoopRunSpecific 0x1f5a1435c - /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices : GSEventRunModal 0x1bd192f58 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 80 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : _ZNK3icu6number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode 0x104b56828 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : _ZNK3icu6number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode 0x104c05aa4 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x104997140 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : xamarin_log 0x104c6bf48 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x1da328dec - /usr/lib/dyld : Exiting early due to double fault. 0x1bd192bbc - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : UIApplicationMain 0x10498046c - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : xamarin_UIApplicationMain 0x10493a990 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1048c61a4 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1048c63bc - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1028f8344 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x1047c91f8 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : 0x104c009d0 - /private/var/containers/Bundle/Application/12CD011F-D59A-49E7-BC70-A94732C290A0/appname6.app/appname6 : GlobalizationNative_InitICUFunctions 0x104b4ff 0x1bcfff028 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1bcffedb4 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : 0x1d0e002e4 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : 0x1d0e40068 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : 0x1d0e04120 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : 0x1d0e3fcc0 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : 0x1c2253eac - /usr/lib/system/libdispatch.dylib : 0x1c225791c - /usr/lib/system/libdispatch.dylib : 0x1d0e0e24c - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : 0x1d0e0dde8 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : 0x1d0e10694 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : 0x1bae5a128 - /System/Library/Framewo The app has been terminated. ``` ### Regression? _No response_ ### Known Workarounds So far I have not been able to devise a workaround. ### Configuration The code is currently being compiled for net7-ios. We cannot move to .net8-ios because that seems to have a minimum iOS version of 11, and we need to support 10. ### Other information _No response_
Author: divil5000
Assignees: -
Labels: `area-System.Globalization`, `untriaged`, `os-ios`, `needs-area-label`
Milestone: -
divil5000 commented 8 months ago

Confirmed reproduced on net8.0-ios. The native crash output is different, though.

537DBDB71C0/appname6.app/appname6 : 
    0x1072a1c70 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x105c89b34 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x105c819a0 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x105c92c5c - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x105c92ee0 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x105c9bf7c - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x105cb6a24 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x1061169a8 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x106128
 : 
    0x105cb6a24 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x1061169a8 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x106128c50 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x1061272d8 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x106120874 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x1062375ac - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x106239530 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x106236b3c - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x10719f6b0 - /private/var/containers/Bundl
e/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x1073ee758 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x1077faca0 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : AppleCryptoNative_DigestReset
    0x1077a2364 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : AppleCryptoNative_DigestReset
    0x1077b763c - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : AppleCryptoNative_DigestReset
    0x2296df6b8 - /usr/lib/system/libsystem_pthread.dylib : _pthread_start
    0x2296deb88 - /usr/lib/system/libsystem_pthread.dylib : thread_start

=================================================================
    Basic Fault Address Reporting
=================================================================
instruction pointer is NULL, skip dumping
=======================
undle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : AppleCryptoNative_DigestReset
    0x1077f7a20 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : AppleCryptoNative_DigestReset
    0x229649214 - /usr/lib/system/libsystem_platform.dylib : <redacted>
    0x10728db74 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x10728d16c - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x10728cf84 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x10728c798 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x107018954 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x1072a1d2c - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C
==========================================
    Managed Stacktrace:
=================================================================
=================================================================

=================================================================
    Native Crash Reporting
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

An error has occurred in the native fault reporting. Some diagnostic information will be unavailable.

=================================================================
    Native stacktrace:
=================================================================
    0x10782a7ac - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : AppleCryptoNative_DigestReset
    0x107815698 - /private/var/containers/B

=================================================================
    Native Crash Reporting
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

=================================================================
    Native stacktrace:

8-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x107018954 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x1072a1d2c - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x1072a1c70 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x105c89b34 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x105c819a0 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x105c92c5c - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x105c92ee0 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x105c9bf7c - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6
=================================================================
    0x10782a7ac - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : AppleCryptoNative_DigestReset
    0x107815698 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : AppleCryptoNative_DigestReset
    0x1077f7a20 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : AppleCryptoNative_DigestReset
    0x229649214 - /usr/lib/system/libsystem_platform.dylib : <redacted>
    0x10728db74 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x10728d16c - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x10728cf84 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x10728c798 - /private/var/containers/Bundle/Application/5AF5D644-9C3
c50 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x1061272d8 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x106120874 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x1062375ac - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x106239530 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x106236b3c - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x10719f6b0 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x1073ee758 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : 
    0x1077faca0 - /private/var/containers/Bundle/Application
/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : AppleCryptoNative_DigestReset
    0x1077a2364 - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : AppleCryptoNative_DigestReset
    0x1077b763c - /private/var/containers/Bundle/Application/5AF5D644-9C38-4125-8040-C537DBDB71C0/appname6.app/appname6 : AppleCryptoNative_DigestReset
    0x2296df6b8 - /usr/lib/system/libsystem_pthread.dylib : _pthread_start
    0x2296deb88 - /usr/lib/system/libsystem_pthread.dylib : thread_start

Exiting early due to double fault.

The app has been terminated.
divil5000 commented 8 months ago

I am not actually so sure that this output is helpful. I doubt very much that in the first output it's actually a string function that is the problem, as string functions are not being used. I doubt also that anything to do with encryption is being used, as the second output suggests. It seems the runtime is being thrown completely though.

matouskozak commented 8 months ago

I tried reproducing it with the latest main on a desktop running fullAOT-llvm (the configuration used for ios deployment) but wasn't able to reproduce it with the following code:

using System;
using Clipper2Lib;

var paths = new PathsD();
var polygon = new PathD();
polygon.AddRange(new PointD[]
    { new PointD(-8470.4501953125, -42813.28125), new PointD(-8460.7470703125, -42814.30078125), new PointD(-8440.5146484375, -42820.4609375), new PointD(-8420.0205078125, -42825.6875), new PointD(-8399.310546875, -42829.984375), new PointD(-8378.4248046875, -42833.3359375), new PointD(-8357.4091796875, -42835.73046875), new PointD(-8336.3046875, -42837.17578125), new PointD(-8315.15625, -42837.65234375), new PointD(-8294.0087890625, -42837.17578125), new PointD(-8272.904296875, -42835.73046875), new PointD(-8251.8876953125, -42833.3359375), new PointD(-8231.001953125, -42829.984375), new PointD(-8210.2919921875, -42825.6875), new PointD(-8189.798828125, -42820.4609375), new PointD(-8169.56591796875, -42814.30078125), new PointD(-8149.63525390625, -42807.234375), new PointD(-8130.0478515625, -42799.26953125), new PointD(-8110.84375, -42790.42578125), new PointD(-8092.0634765625, -42780.71484375), new PointD(-8073.74462890625, -42770.1640625), new PointD(-8055.92626953125, -42758.80078125), new PointD(-8038.64501953125, -42746.63671875), new PointD(-8021.93505859375, -42733.69921875), new PointD(-8005.83203125, -42720.02734375), new PointD(-7990.3681640625, -42705.63671875), new PointD(-7975.576171875, -42690.55859375), new PointD(-7961.4853515625, -42674.8359375), new PointD(-7948.12451171875, -42658.48828125), new PointD(-7935.52099609375, -42641.5546875), new PointD(-7923.7001953125, -42624.0703125), new PointD(-7912.68603515625, -42606.078125), new PointD(-7902.5, -42587.6015625), new PointD(-7893.16357421875, -42568.69140625), new PointD(-7884.6953125, -42549.3828125), new PointD(-7877.11181640625, -42529.70703125), new PointD(-7870.42822265625, -42509.71875), new PointD(-7864.65673828125, -42489.45703125), new PointD(-7859.8095703125, -42468.94921875), new PointD(-7855.8955078125, -42448.2578125), new PointD(-7852.92236328125, -42427.41015625), new PointD(-7850.8955078125, -42406.453125), new PointD(-7849.81884765625, -42385.43359375), new PointD(-7849.0029296875, -42371.94921875), new PointD(-7849.0029296875, -42012.6640625), new PointD(-7849.0029296875, -41318.671875), new PointD(-8224.318359375, -40734.03125), new PointD(-8492.20703125, -40526.49609375), new PointD(-8609.970703125, -40434.828125), new PointD(-8811.7705078125, -40277.3125), new PointD(-9790.8564453125, -40277.3125), new PointD(-9026.5986328125,
     -40790.921875), new PointD(-9027.2783203125, -40791.44140625), new PointD(-9029.970703125, -40792.84765625), new PointD(-9027.005859375, -40794.21875), new PointD(-9027.822265625, -40795.77734375), new PointD(-9026.9111328125, -40796.8046875), new PointD(-9028.0400390625, -40796.8359375), new PointD(-9024.7216796875, -40798.8203125), new PointD(-9025.673828125, -40802.96875), new PointD(-9022.1513671875, -40804.66796875), new PointD(-9025.197265625, -40807.984375), new PointD(-9025.224609375, -40809.875), new PointD(-9017.21484375, -40822.0625), new PointD(-9017.9501953125, -40826.51953125), new PointD(-9014.9580078125, -40830.203125), new PointD(-9013.326171875, -40836.69921875), new PointD(-9009.1923828125, -40838.5390625), new PointD(-9009.369140625, -40841.125), new PointD(-9006.486328125, -40842.79296875), new PointD(-9006.5673828125, -40846.52734375), new PointD(-9001.658203125, -40853.26171875), new PointD(-9047.294921875, -41015.08984375), new PointD(-9048.568359375, -41014.8203125), new PointD(-9066.6923828125, -41005.09765625), new PointD(-9085.611328125, -40997.03125), new PointD(-9105.1748046875, -40990.69140625), new PointD(-9125.2265625, -40986.125), new PointD(-9145.6025390625, -40983.375), new PointD(-9166.14453125, -40982.453125), new PointD(-9186.6865234375, -40983.375), new PointD(-9207.0634765625, -40986.125), new PointD(-9227.1142578125, -40990.69140625), new PointD(-9246.677734375, -40997.03125), new PointD(-9265.59765625, -41005.09765625), new PointD(-9283.7216796875, -41014.8203125),
      new PointD(-9300.9052734375, -41026.125), new PointD(-9317.009765625, -41038.9296875), new PointD(-9331.9091796875, -41053.12109375), new PointD(-9345.478515625, -41068.59375), new PointD(-9357.611328125, -41085.22265625), new PointD(-9368.2099609375, -41102.87109375), new PointD(-9377.1875, -41121.40234375), new PointD(-9384.470703125, -41140.671875), new PointD(-9390, -41160.51171875), new PointD(-9393.73046875, -41180.78125), new PointD(-9395.6298828125, -41201.30078125), new PointD(-9395.6826171875, -41221.91796875), new PointD(-9393.88671875, -41242.45703125), new PointD(-9390.255859375, -41262.76171875), new PointD(-9388.34375, -41269.80859375), new PointD(-9254.806640625, -41225.50390625), new PointD(-9246.5263671875, -41223.62109375), new PointD(-9230.2265625, -41220.1015625), new PointD(-9213.6455078125, -41218.3359375), new PointD(-9196.970703125, -41218.3359375), new PointD(-9180.3896484375, -41220.1015625), new PointD(-9164.08984375, -41223.62109375), new PointD(-9148.2548828125, -41228.8515625), new PointD(-9133.0615234375, -41235.73046875), new PointD(-9118.6845703125, -41244.1875), new PointD(-9105.2841796875, -41254.12109375), new PointD(-9093.8017578125, -41264.2265625), new PointD(-9093.013671875, -41265.421875), new PointD(-9082.009765625, -41277.9609375), new PointD(-9072.3984375, -41291.60546875), new PointD(-9064.2890625, -41306.1953125), new PointD(-9061.708984375, -41311.69140625), new PointD(-8998.6123046875, -41463.6875), new PointD(-8992.357421875, -41478.72265625), new PointD(-8900.16015625, -41700.05078125), new PointD(-8731.5400390625, -41968.6875), new PointD(-8534.0908203125, -42289.3125), new PointD(-8437.814453125, -42444.76171875), new PointD(-8470.4501953125, -42813.28125) });
paths.Add(polygon);
var solutionPolygons = Clipper2Lib.Clipper.InflatePaths(paths, 0.5, Clipper2Lib.JoinType.Round, Clipper2Lib.EndType.Polygon);

using Clipper2 1.3.0 (dotnet add package Clipper2 --version 1.3.0). As soon as I have an iOS device available, I will try reproducing it with net8.0-ios.

divil5000 commented 7 months ago

Is anyone actually going to test this? I've given a working reproduction here, and I can supply a simpler one if necessary. I do not believe it's anything to do with Globalization (that is a red herring) rather, this puts the runtime into an unstable state where virtually anything (perhaps on another thread) can appear to be the problem.

matouskozak commented 7 months ago

Is anyone actually going to test this? I've given a working reproduction here, and I can supply a simpler one if necessary. I do not believe it's anything to do with Globalization (that is a red herring) rather, this puts the runtime into an unstable state where virtually anything (perhaps on another thread) can appear to be the problem.

I am planning to look into it. Sorry for the delay.

I was able to reproduce it locally but so far I didn't find the root cause. I agree that it doesn't look to be connected with Globalization. Please, feel free to share a simpler repro if you have it, that could help us speed the investigation.

divil5000 commented 7 months ago

It isn't a blocking issue for us any more because I found a workaround:

https://github.com/AngusJohnson/Clipper2/issues/773#issuecomment-1966409912

If you've got the Clipper2 source, you'll see a HorzSegSorter struct, which is a struct whose only purpose is to have a method that performs a sort. It's a weird thing to do, but it seems to be that which is causing mayhem in the runtime. You'll see on that issue that I simply removed the type and made the sort method an instance method of the type that was calling it anyway. It does seem like quite the stability issue though.

Can you confirm it reproduces for you and so does the fix?

matouskozak commented 7 months ago

It isn't a blocking issue for us any more because I found a workaround:

AngusJohnson/Clipper2#773 (comment)

If you've got the Clipper2 source, you'll see a HorzSegSorter struct, which is a struct whose only purpose is to have a method that performs a sort. It's a weird thing to do, but it seems to be that which is causing mayhem in the runtime. You'll see on that issue that I simply removed the type and made the sort method an instance method of the type that was calling it anyway. It does seem like quite the stability issue though.

Can you confirm it reproduces for you and so does the fix?

Update: I can confirm that the error comes from the ConvertHorzSegsToJoins based on the obtained log

================================================================
        0x1150041a0 - /Users//Library/Developer/CoreSimulator/Devices/ADAE97FF-17E3-44F1-B701-55400C16D92B/data/Containers/Bundle/Application/2521F88B-3344-4CDF-8B10-5EB2749844B5/clipper2_crash.app/libmonosgen-2.0.dylib : mono_dump_native_crash_info
        0x114fb41c0 - /Users//Library/Developer/CoreSimulator/Devices/ADAE97FF-17E3-44F1-B701-55400C16D92B/data/Containers/Bundle/Application/2521F88B-3344-4CDF-8B10-5EB2749844B5/clipper2_crash.app/libmonosgen-2.0.dylib : mono_handle_native_crash
        0x114f1b778 - /Users//Library/Developer/CoreSimulator/Devices/ADAE97FF-17E3-44F1-B701-55400C16D92B/data/Containers/Bundle/Application/2521F88B-3344-4CDF-8B10-5EB2749844B5/clipper2_crash.app/libmonosgen-2.0.dylib : mono_sigsegv_signal_handler_debug
        0x1132cf7e0 - /usr/lib/system/libsystem_platform.dylib : _sigtramp
        0x1095ab174 - /Users//Library/Developer/CoreSimulator/Devices/ADAE97FF-17E3-44F1-B701-55400C16D92B/data/Containers/Bundle/Application/2521F88B-3344-4CDF-8B10-5EB2749844B5/clipper2_crash.app/clipper2_crash : System_Collections_Generic_ArraySortHelper_1_T_REF_InsertionSort_System_Span_1_T_REF_Syste
m_Comparison_1_T_REF                                                                                           (110.1s)
        0x1095aa76c - /Users//Library/Developer/CoreSimulator/Devices/ADAE97FF-17E3-44F1-B701-55400C16D92B/data/Containers/Bundle/Application/2521F88B-3344-4CDF-8B10-5EB2749844B5/clipper2_crash.app/clipper2_crash : System_Collections_Generic_ArraySortHelper_1_T_REF_IntroSort_System_Span_1_T_REF_int_System_Comparison_1_T_REF
        0x1095aa584 - /Users//Library/Developer/CoreSimulator/Devices/ADAE97FF-17E3-44F1-B701-55400C16D92B/data/Containers/Bundle/Application/2521F88B-3344-4CDF-8B10-5EB2749844B5/clipper2_crash.app/clipper2_crash : System_Collections_Generic_ArraySortHelper_1_T_REF_IntrospectiveSort_System_Span_1_T_REF_System_Comparison_1_T_REF
        0x1095a9d98 - /Users//Library/Developer/CoreSimulator/Devices/ADAE97FF-17E3-44F1-B701-55400C16D92B/data/Containers/Bundle/Application/2521F88B-3344-4CDF-8B10-5EB2749844B5/clipper2_crash.app/clipper2_crash : System_Collections_Generic_ArraySortHelper_1_T_REF_Sort_System_Span_1_T_REF_System_Collections_Generic_IComparer_1_T_REF
        0x108f672d4 - /Users//Library/Developer/CoreSimulator/Devices/ADAE97FF-17E3-44F1-B701-55400C16D92B/data/Containers/Bundle/Application/2521F88B-3344-4CDF-8B10-5EB2749844B5/clipper2_crash.app/clipper2_crash : System_Array_Sort_T_REF_T_REF___int_int_System_Collections_Generic_IComparer_1_T_REF
        0x1095c5ecc - /Users//Library/Developer/CoreSimulator/Devices/ADAE97FF-17E3-44F1-B701-55400C16D92B/data/Containers/Bundle/Application/2521F88B-3344-4CDF-8B10-5EB2749844B5/clipper2_crash.app/clipper2_crash : System_Collections_Generic_List_1_T_REF_Sort_int_int_System_Collections_Generic_IComparer_1_T_REF
        0x1095c5e10 - /Users//Library/Developer/CoreSimulator/Devices/ADAE97FF-17E3-44F1-B701-55400C16D92B/data/Containers/Bundle/Application/2521F88B-3344-4CDF-8B10-5EB2749844B5/clipper2_crash.app/clipper2_crash : System_Collections_Generic_List_1_T_REF_Sort_System_Collections_Generic_IComparer_1_T_REF
        0x106bc4b5c - /Users//Library/Developer/CoreSimulator/Devices/ADAE97FF-17E3-44F1-B701-55400C16D92B/data/Containers/Bundle/Application/2521F88B-3344-4CDF-8B10-5EB2749844B5/clipper2_crash.app/clipper2_crash : Clipper2Lib_ClipperBase_ConvertHorzSegsToJoins

I don't have a locally build version of Clipper2 so I wasn't able to confirm your fix but it seems that the library already implemented your fix as well (https://github.com/AngusJohnson/Clipper2/commit/f7c126460ea45d4541961c01a4db6f64c9008384).

Good news is that it seems that with .NET 9 preview version the sample no longer crashes. Bad news is that I was not able to reproduce it inside dotnet/runtime using the iOS sample app (i.e., without sdk), so at the moment I didn't manage to debug what is causing the segfault inside the InsertionSort method (https://github.com/matouskozak/runtime/blob/a103efd28d46af39fc22a77458a11d204226e8d4/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/ArraySortHelper.cs#L255)

divil5000 commented 7 months ago

It would be great to find out the root cause, because we have occasional other crash reports that look similar but are not easily reproducible. I think something is causing this instability in the runtime but this is the first time I've actually been able to reproduce it.

I put all the Clipper2 source into one .cs file for easy reproduction of the issue, I could upload that (with a repro) if that would help?

Edit to say: although it's good news that it appears fixed in .net 9, please bear in mind that .net 9 is entirely fictional for the purposes of anyone working on a real-world app that customers are using in production.

matouskozak commented 7 months ago

into one .cs file for easy reproduction of the issue, I could upload that (with a repro) if that would help?

Sure, if you have already done it feel free to share it together with repro steps and I can try if that helps reproducing it.

Edit to say: although it's good news that it appears fixed in .net 9, please bear in mind that .net 9 is entirely fictional for the purposes of anyone working on a real-world app that customers are using in production.

Yes, I understand that not everyone is (will be) on .NET 9. I'm happy that you have found a workaround to unblock yourself but I will still take a look to see what is the root cause. Especially since you are saying that your app is crashing similarly in other situations as well.

divil5000 commented 7 months ago

Sure, here you go. It's a single .cs file that contains all of Clipper2, and contains the buggy implementation of ConvertHorzSegsToJoins which uses a sorter method on a newly-initialised struct. Just include this one file in any project, and the few lines of code in my OP which will trigger the crash. I reproduced it on net7-ios and net8-ios.

clipper2.zip

lambdageek commented 3 months ago

This might be another instance of https://github.com/dotnet/runtime/issues/103569 (ie: we're still waiting for a .NET 8 servicing release that includes https://github.com/dotnet/runtime/pull/101491)

lambdageek commented 3 months ago

@matouskozak if you can get a servicing candidate from https://aka.ms/release-tracker you can try the repro there to see if we have a fix in already

matouskozak commented 3 months ago

@matouskozak if you can get a servicing candidate from https://aka.ms/release-tracker you can try the repro there to see if we have a fix in already

I've tried it on simulator and the servicing release didn't fix it for me.

lambdageek commented 3 months ago

@matouskozak I tried .net 8.0.7 just now and didn't get a crash:

  1. Take Clipper2.cs from https://github.com/dotnet/runtime/issues/98410#issuecomment-2011995461
  2. dotnet new maui
  3. Edit MainPage.xaml.cs to add a new public static void RunClipper() method with the code from the "Reproduction Steps", above, and call it from OnCounterClicked

        private void OnCounterClicked(object sender, EventArgs e)
    {
        count++;
    
                RunClipper();
    
        if (count == 1)
            CounterBtn.Text = $"Clicked {count} time";
        else
            CounterBtn.Text = $"Clicked {count} times";
    
        SemanticScreenReader.Announce(CounterBtn.Text);
    }
  4. dotnet build -f net8.0-ios -c Release -t:Run and click on the button
matouskozak commented 3 months ago

@matouskozak I tried .net 8.0.7 just now and didn't get a crash:

  1. Take Clipper2.cs from Runtime Crash (SIGSEGV) on iOS #98410 (comment)
  2. dotnet new maui
  3. Edit MainPage.xaml.cs to add a new public static void RunClipper() method with the code from the "Reproduction Steps", above, and call it from OnCounterClicked

      private void OnCounterClicked(object sender, EventArgs e)
    {
      count++;
    
                RunClipper();
    
      if (count == 1)
          CounterBtn.Text = $"Clicked {count} time";
      else
          CounterBtn.Text = $"Clicked {count} times";
    
      SemanticScreenReader.Announce(CounterBtn.Text);
    }
  4. dotnet build -f net8.0-ios -c Release -t:Run and click on the button

Thank you @lambdageek. You're right, MAUI app is not crashing for me either. In my previous comment https://github.com/dotnet/runtime/issues/98410#issuecomment-2202192429 I tried it on the old Xamarin App and I suppose it didn't use the 8.0.7 servicing even though I installed it before. Which is logical because Xamarin iOS is out of support already.

Closing this issue as resolved. @divil5000 let us know if you're still encountering issues even after installing the 8.0.7 runtime servicing release.

matouskozak commented 3 months ago

@matouskozak I tried .net 8.0.7 just now and didn't get a crash:

  1. Take Clipper2.cs from Runtime Crash (SIGSEGV) on iOS #98410 (comment)
  2. dotnet new maui
  3. Edit MainPage.xaml.cs to add a new public static void RunClipper() method with the code from the "Reproduction Steps", above, and call it from OnCounterClicked

      private void OnCounterClicked(object sender, EventArgs e)
    {
      count++;
    
                RunClipper();
    
      if (count == 1)
          CounterBtn.Text = $"Clicked {count} time";
      else
          CounterBtn.Text = $"Clicked {count} times";
    
      SemanticScreenReader.Announce(CounterBtn.Text);
    }
  4. dotnet build -f net8.0-ios -c Release -t:Run and click on the button

Thank you @lambdageek. You're right, MAUI app is not crashing for me either. In my previous comment https://github.com/dotnet/runtime/issues/98410#issuecomment-2202192429 I tried it on the old Xamarin App and I suppose it didn't use the 8.0.7 servicing even though I installed it before. Which is logical because Xamarin iOS is out of support already.

Closing this issue as resolved. @divil5000 let us know if you're still encountering issues even after installing the 8.0.7 runtime servicing release and using MAUI instead of Xamarin.

divil5000 commented 3 months ago

Assuming you were still checking out the old version of Clipper2 that triggered the problem, that's great news! I no longer have a test environment for this on my machine so will have to take your word for it.

We use neither Xamarin nor MAUI. We use net8.0-ios.