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

[Bug] java.lang.IndexOutOfBoundsException: setSpan crash in Editor #15465

Closed
@holecekp

Description

Description

I am using AppCenter for reporting crashes in my app. It has reported a crash caused by the Editor. The issue is very similar to the one that has already been fixed for Entry: #12762
It is very likely that those two are the same bug and that it could help to copy the fix for Entry also to Editor.

Error message:
java.lang.IndexOutOfBoundsException: setSpan (15 ... 71) ends beyond length 15

Stack traces:

    android.text.SpannableStringBuilder.checkRange SpannableStringBuilder.java:1321
    android.text.SpannableStringBuilder.setSpan SpannableStringBuilder.java:682
    android.text.SpannableStringBuilder.setSpan SpannableStringBuilder.java:674
    android.widget.Editor$SuggestionsPopupWindow.updateSuggestions Editor.java:4422
    android.widget.Editor$SuggestionsPopupWindow.show Editor.java:4257
    android.widget.Editor.replace Editor.java:556
    android.widget.-$$Lambda$DZXn7FbDDFyBvNjI-iG9_hfa7kw.run
    android.os.Handler.handleCallback Handler.java:873
    android.os.Handler.dispatchMessage Handler.java:99
    android.os.Looper.loop Looper.java:216
    android.app.ActivityThread.main ActivityThread.java:7211
    java.lang.reflect.Method.invoke Method.java
    com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run RuntimeInit.java:494
    com.android.internal.os.ZygoteInit.main ZygoteInit.java:975

Steps to Reproduce

I am not able to reproduce it locally.

Expected Behavior

No crashes

Actual Behavior

Occasional crash

Basic Information

  • Version with issue: reported for 5.0.0.2401 and 5.0.0.2125
  • Last known good version: -
  • Platform Target Frameworks:
    • Android: 12
  • NuGet Packages: Microsoft.AppCenter.Crashes (4.5.1), sqlite-net-pcl (1.8.116), System.Text.Json (4.7.2), Xamarin.CommunityToolkit (2.0.1), Xamarin.Essentials (1.7.2), Xamarin.Forms (5.0.0.240)
  • Affected Devices: reported for Samsung Galaxy J3 (Android 9) and NOTE 8i (Android 10)

Environment

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

Installed Version: Community

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

.NET Core Debugging with WSL   1.0
.NET Core Debugging with WSL

ASP.NET and Web Tools 2019   17.2.393.26812
ASP.NET and Web Tools 2019

Azure App Service Tools v3.0.0   17.2.393.26812
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools   17.2.393.26812
Azure Functions and Web Jobs Tools

C# Tools   4.2.0-4.22281.5+8d3180e5f00d42f0f0295165f756f368f0cbfa44
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.2.6 (master@34d6af2)
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.2.20 (482eb2a)
Support for debugging Mono processes with Visual Studio.

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

Razor (ASP.NET Core)   17.0.0.2218101+885a343b00bcab620a90c1550c37dafd730ce984
Provides languages services for ASP.NET Core Razor.

SQL Server Data Tools   17.0.62204.01010
Microsoft SQL Server Data Tools

TypeScript Tools   17.0.10418.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   4.2.0-4.22281.5+8d3180e5f00d42f0f0295165f756f368f0cbfa44
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.1.0-beta.22274.4+211fd760c2315d73cfa0d375fe64abb346bc1096
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.2.0.177 (d17-2@2f6c881)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   17.2.0.244 (remotes/origin/d17-2@197e1a0b7)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates   17.2.15 (2e3b60e)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK   12.3.3.3 (d17-2/4e061b7)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: dffa5ab
    Java.Interop: xamarin/java.interop/d17-2@9760f0a9
    ProGuard: Guardsquare/proguard/v7.0.1@912d149
    SQLite: xamarin/sqlite/3.38.2@7b1e016
    Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-2@fc3c2ac


Xamarin.iOS and Xamarin.Mac SDK   15.10.0.5 (96b3edb6d)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

Reproduction Link

I am not able to reproduce the issue. The crash is reported by AppCenter on devices that I do not have access to.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions