Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] ArgumentOutOfRangeException crash on UWP in TextBlockExtensions.RecalculateSpanPositions #15732

Open
holecekp opened this issue May 3, 2023 · 0 comments
Labels
a/label p/UWP s/unverified New report that has yet to be verified t/bug 🐛

Comments

@holecekp
Copy link

holecekp commented May 3, 2023

Description

I have received a crash report by AppCenter. The crash is on user's computer and I am not able to reproduce it locally. However, I am sending the error message and stack traces including the lines where the crash happened.

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

Last Exception Backtrace:
0   System.Collections.Generic           0x7fff8f376ac8   System.Collections.Generic.List`1.get_Item(Int32) + 0x38
1   Xamarin.Forms.Platform.UWP           0x7fff7a394cdf   Xamarin.Forms.Platform.UWP.TextBlockExtensions.RecalculateSpanPositions($TextBlock control, $Label element, IList$1<Double> inlineHeights) in D:\a\1\s\Xamarin.Forms.Platform.UAP\TextBlockExtensions.cs at 59:5
2   Xamarin.Forms.Platform.UWP           0x7fff7a664e30   Xamarin.Forms.Platform.UWP.LabelRenderer.ArrangeOverride($Size finalSize) in D:\a\1\s\Xamarin.Forms.Platform.UAP\LabelRenderer.cs at 90:4
3   Windows.UI.Xaml.FrameworkElement.global.Windows.UI.Xaml0x7fff79fd554a   Windows.UI.Xaml.FrameworkElement.global.Windows.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride($Size finalSize) in global::Windows.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride at 16707566:0
4   __Interop                            0x7fff79e18830   __Interop.ReverseComStubs.Stub_31(Object __this, $Size unsafe_availableSize, $Size* unsafe_result__retval, IntPtr __methodPtr) in Stub_31 at 15732480:0
5   System.Runtime.InteropServices       0x7fff8f38ef71   System.Runtime.InteropServices.McgMarshal.ThrowOnExternalCallFailed(Int32, RuntimeTypeHandle) + 0x21
6   __Interop                            0x7fff79bf6747   __Interop.ComCallHelpers.Call($__ComObject __this, RuntimeTypeHandle __typeHnd, Int32 __targetIndex, $Rect arg0) in Call at 15732480:0
7   __Interop.ForwardComStubs            0x7fff79bf6678   __Interop.ForwardComStubs.Stub_18<System.__Canon>(Void* InstParam, $__ComObject __this, $Rect value, Int32 __targetIndex) in Stub_18 at 16707566:0
8   Xamarin.Forms.Platform.UWP           0x7fff7a664790   Xamarin.Forms.Platform.UWP.ScrollViewRenderer.ArrangeOverride($Size finalSize) in D:\dotNET\MorseCode\MorseCode\MorseCode.UWP\Renderers\ScrollViewRenderer.cs at 39:4
9   Windows.UI.Xaml.FrameworkElement.global.Windows.UI.Xaml0x7fff79fd554a   Windows.UI.Xaml.FrameworkElement.global.Windows.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride($Size finalSize) in global::Windows.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride at 16707566:0
10  __Interop                            0x7fff79e18830   __Interop.ReverseComStubs.Stub_31(Object __this, $Size unsafe_availableSize, $Size* unsafe_result__retval, IntPtr __methodPtr) in Stub_31 at 15732480:0
11  System.Runtime.InteropServices       0x7fff8f38ef71   System.Runtime.InteropServices.McgMarshal.ThrowOnExternalCallFailed(Int32, RuntimeTypeHandle) + 0x21
12  __Interop                            0x7fff79bf6747   __Interop.ComCallHelpers.Call($__ComObject __this, RuntimeTypeHandle __typeHnd, Int32 __targetIndex, $Rect arg0) in Call at 15732480:0
13  __Interop.ForwardComStubs            0x7fff79bf6678   __Interop.ForwardComStubs.Stub_18<System.__Canon>(Void* InstParam, $__ComObject __this, $Rect value, Int32 __targetIndex) in Stub_18 at 16707566:0
14  Xamarin.Forms.Platform.UWP.VisualElementRenderer$2<System.__Canon,System0x7fff79bb2bf7   Xamarin.Forms.Platform.UWP.VisualElementRenderer$2<System.__Canon,System.__Canon>.ArrangeOverride($Size finalSize) in D:\a\1\s\Xamarin.Forms.Platform.UAP\VisualElementRenderer.cs at 230:5
15  Windows.UI.Xaml.FrameworkElement.global.Windows.UI.Xaml0x7fff79fd554a   Windows.UI.Xaml.FrameworkElement.global.Windows.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride($Size finalSize) in global::Windows.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride at 16707566:0
16  __Interop                            0x7fff79e18830   __Interop.ReverseComStubs.Stub_31(Object __this, $Size unsafe_availableSize, $Size* unsafe_result__retval, IntPtr __methodPtr) in Stub_31 at 15732480:0
17  System.Runtime.InteropServices       0x7fff8f38ef71   System.Runtime.InteropServices.McgMarshal.ThrowOnExternalCallFailed(Int32, RuntimeTypeHandle) + 0x21
18  __Interop                            0x7fff79bf6747   __Interop.ComCallHelpers.Call($__ComObject __this, RuntimeTypeHandle __typeHnd, Int32 __targetIndex, $Rect arg0) in Call at 15732480:0
19  __Interop.ForwardComStubs            0x7fff79bf6678   __Interop.ForwardComStubs.Stub_18<System.__Canon>(Void* InstParam, $__ComObject __this, $Rect value, Int32 __targetIndex) in Stub_18 at 16707566:0
20  Xamarin.Forms.Platform.UWP.VisualElementRenderer$2<System.__Canon,System0x7fff79bb2bf7   Xamarin.Forms.Platform.UWP.VisualElementRenderer$2<System.__Canon,System.__Canon>.ArrangeOverride($Size finalSize) in D:\a\1\s\Xamarin.Forms.Platform.UAP\VisualElementRenderer.cs at 230:5
21  Windows.UI.Xaml.FrameworkElement.global.Windows.UI.Xaml0x7fff79fd554a   Windows.UI.Xaml.FrameworkElement.global.Windows.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride($Size finalSize) in global::Windows.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride at 16707566:0
22  __Interop                            0x7fff79e18830   __Interop.ReverseComStubs.Stub_31(Object __this, $Size unsafe_availableSize, $Size* unsafe_result__retval, IntPtr __methodPtr) in Stub_31 at 15732480:0
23  System.Runtime.InteropServices       0x7fff8f38ef71   System.Runtime.InteropServices.McgMarshal.ThrowOnExternalCallFailed(Int32, RuntimeTypeHandle) + 0x21
24  __Interop                            0x7fff79bf6747   __Interop.ComCallHelpers.Call($__ComObject __this, RuntimeTypeHandle __typeHnd, Int32 __targetIndex, $Rect arg0) in Call at 15732480:0
25  __Interop.ForwardComStubs            0x7fff79bf6678   __Interop.ForwardComStubs.Stub_18<System.__Canon>(Void* InstParam, $__ComObject __this, $Rect value, Int32 __targetIndex) in Stub_18 at 16707566:0
26  Xamarin.Forms.Platform.UWP.VisualElementRenderer$2<System.__Canon,System0x7fff79bb2bf7   Xamarin.Forms.Platform.UWP.VisualElementRenderer$2<System.__Canon,System.__Canon>.ArrangeOverride($Size finalSize) in D:\a\1\s\Xamarin.Forms.Platform.UAP\VisualElementRenderer.cs at 230:5
27  Windows.UI.Xaml.FrameworkElement.global.Windows.UI.Xaml0x7fff79fd554a   Windows.UI.Xaml.FrameworkElement.global.Windows.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride($Size finalSize) in global::Windows.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride at 16707566:0
28  __Interop                            0x7fff79e18830   __Interop.ReverseComStubs.Stub_31(Object __this, $Size unsafe_availableSize, $Size* unsafe_result__retval, IntPtr __methodPtr) in Stub_31 at 15732480:0
29  System.Runtime.InteropServices       0x7fff8f38ef71   System.Runtime.InteropServices.McgMarshal.ThrowOnExternalCallFailed(Int32, RuntimeTypeHandle) + 0x21
30  __Interop                            0x7fff79bf6747   __Interop.ComCallHelpers.Call($__ComObject __this, RuntimeTypeHandle __typeHnd, Int32 __targetIndex, $Rect arg0) in Call at 15732480:0
31  __Interop.ForwardComStubs            0x7fff79bf6678   __Interop.ForwardComStubs.Stub_18<System.__Canon>(Void* InstParam, $__ComObject __this, $Rect value, Int32 __targetIndex) in Stub_18 at 16707566:0
32  Xamarin.Forms.Platform.UWP.VisualElementRenderer$2<System.__Canon,System0x7fff79bb2bf7   Xamarin.Forms.Platform.UWP.VisualElementRenderer$2<System.__Canon,System.__Canon>.ArrangeOverride($Size finalSize) in D:\a\1\s\Xamarin.Forms.Platform.UAP\VisualElementRenderer.cs at 230:5
33  Windows.UI.Xaml.FrameworkElement.global.Windows.UI.Xaml0x7fff79fd554a   Windows.UI.Xaml.FrameworkElement.global.Windows.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride($Size finalSize) in global::Windows.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride at 16707566:0
34  __Interop                            0x7fff79e18830   __Interop.ReverseComStubs.Stub_31(Object __this, $Size unsafe_availableSize, $Size* unsafe_result__retval, IntPtr __methodPtr) in Stub_31 at 15732480:0
35  System.Runtime.InteropServices       0x7fff8f38ef71   System.Runtime.InteropServices.McgMarshal.ThrowOnExternalCallFailed(Int32, RuntimeTypeHandle) + 0x21
36  __Interop                            0x7fff79e226de   __Interop.ComCallHelpers.Call($__ComObject __this, RuntimeTypeHandle __typeHnd, Int32 __targetIndex, $Size arg0, Void* arg1) in Call at 15732480:0
37  __Interop.ForwardComStubs            0x7fff79e28cc7   __Interop.ForwardComStubs.Stub_87<System.__Canon>(Void* InstParam, $__ComObject __this, $Size availableSize, Int32 __targetIndex) in Stub_87 at 16707566:0
38  Windows.UI.Xaml                      0x7fff79fd558e   Windows.UI.Xaml.FrameworkElement.ArrangeOverride($Size finalSize) in ArrangeOverride at 16707566:0
39  Windows.UI.Xaml.FrameworkElement.global.Windows.UI.Xaml0x7fff79fd554a   Windows.UI.Xaml.FrameworkElement.global.Windows.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride($Size finalSize) in global::Windows.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride at 16707566:0
40  __Interop                            0x7fff79e18830   __Interop.ReverseComStubs.Stub_31(Object __this, $Size unsafe_availableSize, $Size* unsafe_result__retval, IntPtr __methodPtr) in Stub_31 at 15732480:0
41  System.Runtime.InteropServices       0x7fff8f38ef71   System.Runtime.InteropServices.McgMarshal.ThrowOnExternalCallFailed(Int32, RuntimeTypeHandle) + 0x21
42  __Interop                            0x7fff79bf9768   __Interop.ComCallHelpers.Call($__ComObject __this, RuntimeTypeHandle __typeHnd, Int32 __targetIndex) in Call at 15732480:0
43  __Interop.ForwardComStubs            0x7fff79bf96a4   __Interop.ForwardComStubs.Stub_15<System.__Canon>(Void* InstParam, $__ComObject __this, Int32 __targetIndex) in Stub_15 at 16707566:0
44  Microsoft.AppCenter.Utils            0x7fff79d48ead   Microsoft.AppCenter.Utils.ApplicationLifecycleHelper.<.ctor>b__17_1(Object sender, $UnhandledErrorDetectedEventArgs eventArgs)

Steps to Reproduce

Unfortunatelly, I am not able to reproduce it. I have only information from AppCenter that the app crashes.

Expected Behavior

No crashes

Actual Behavior

Occasional crash is reported

Basic Information

  • Version with issue: 5.0.0.2578 (currently the latest one)
  • Last known good version: -
  • Platform Target Frameworks:
    • UWP: 19041
  • NuGet Packages: Xamarin.Essentials, Xamarin.CommunityToolkit, AppCenter.Crashes, sqllite-net-pcl, System.Text.Json
  • Affected Devices: The crash is reported for Windows version 110.0.22621 (10.0.22621.1555)

Environment

Show/Hide Visual Studio info
Microsoft Visual Studio Community 2022
Version 17.5.4
VisualStudio.17.Release/17.5.4+33530.505
Microsoft .NET Framework
Version 4.8.04084

Installed Version: Community

Visual C++ 2022   00482-90000-00000-AA019
Microsoft Visual C++ 2022

ASP.NET and Web Tools   17.5.318.41597
ASP.NET and Web Tools

Azure App Service Tools v3.0.0   17.5.318.41597
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools   17.5.318.41597
Azure Functions and Web Jobs Tools

C# Tools   4.5.2-3.23171.7+d17f741546fad2786cbd6394d08619544e53a36d
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus   1.4.3 (main@2a4517a)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Mono Debugging for Visual Studio   17.5.9 (11975e6)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   6.5.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Razor (ASP.NET Core)   17.5.2.2316603+9f1b6856460af1e592d387ebef416eadddac453f
Provides languages services for ASP.NET Core Razor.

SQL Server Data Tools   17.2.40120.0
Microsoft SQL Server Data Tools

Test Adapter for Boost.Test   1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test.  The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test   1.0
Enables Visual Studio's testing tools with unit tests written for Google Test.  The use terms and Third Party Notices are available in the extension installation directory.

TypeScript Tools   17.0.20105.2003
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   4.5.2-3.23171.7+d17f741546fad2786cbd6394d08619544e53a36d
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools   17.5.0-beta.23053.5+794b7c259d9646a7eb685dad865aa27da7940a21
Microsoft Visual F# Tools

Visual Studio IntelliCode   2.2
AI-assisted development for Visual Studio.

VisualStudio.DeviceLog   1.0
Information about my package

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

VSPackage Extension   1.0
VSPackage Visual Studio Extension Detailed Info

Xamarin   17.5.0.173 (d17-5@33e727c)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   17.5.3.46 (remotes/origin/d17-5@e4dd80b2bb)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates   17.5.41 (ba80d05)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK   13.2.0.0 (d17-5/797e2e1)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: 6dd9def
    Java.Interop: xamarin/java.interop/main@149d70fe
    SQLite: xamarin/sqlite/3.40.0@fdc1e34
    Xamarin.Android Tools: xamarin/xamarin-android-tools/main@9f02d77


Xamarin.iOS and Xamarin.Mac SDK   16.2.0.5 (7738c90c9)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/label p/UWP s/unverified New report that has yet to be verified t/bug 🐛
Projects
None yet
Development

No branches or pull requests

3 participants
@jsuarezruiz @holecekp and others