-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug(android/engine): StringIndexOutOfBoundsException when end > length #11160
Comments
Investigation of the issue yields something potentially enlightening: this first started showing up with 17.0.280-beta. The thing most likely to have affected this: #10885, which landed then. Someone (could be me, could be @darcywong00) would need to dig into where the underlying assumptions are invalid in order to get a solid fix, I think. |
Happy for you to spelunk on this one. afict The consistent crash is the keyman/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboard.java Lines 166 to 192 in 93dc41e
Is |
Handing off to @jahorton for spelunking |
Well, I found the invalid assumption. We have ourselves a concurrency issue. It is possible for the object returned by
Same call, but checking the values available via the As the |
Fixed by #11188 |
Relates to #11128 which fixed StringIndexOutOfBoundsException when the selection was reversed
@mcdurdin triggered this similar crash while repeatedly holding down backspace. It's the same area of code, but where the substring end is > length
I think we should catch this, but also add a limit
end = (end > length) ? length : end;
And if possible add some unit test
The text was updated successfully, but these errors were encountered: