Skip to content

Bug: Keyboard frequently crashes and/or messes up text (memory safety issues?) #1700

@codethief

Description

@codethief

Reproduction steps

I'm afraid I have no idea (yet) how to reproduce these issues. In any case, a number of issues of have shown up over the last week or two. Android says my app was last updated on Nov 2 to the version released on Oct 31 (according to the Play Store). Meanwhile, I haven't updated my OS for a number of weeks, so the only possible culprit can be one of the most recent app updates (e.g. the one on Oct 31 or maybe the one before that if that hasn't been too long ago).

The issues are the following:

  • The keyboard crashes (disappears) while typing on a regular basis. This seems to be a memory safety issue, see logs below.
  • When hitting a key (it seems to happen particularly often with the comma key), the keyboard sometimes deletes or messes up the text I just entered before.
  • After crashing, suggestions for autocompletion sometimes no longer work. In this case, every word I enter only produces a single suggestion, which is "<word I just entered>" (including the quotation marks). After a while (and closing/opening the keyboard again multiple times) suggestions start to work again.

I'm not sure in how far these issues are all related but I don't think it's far-fetched to think that the memory safety issues that produce the crashes might also cause random text deletion or mangling.

…which brings me to another issue which I have been observing for many months and which might be related, too: Sometimes, when tapping on an existing text (causing the keyboard to open) and hitting the very first keyboard key / entering the first character, the app would mess up some of the text surrounding the cursor (usually a few words or a line or two before where I placed the cursor). I.e. it would delete some words or characters and/or even paste/duplicate the word(s) that are near my cursor on the line above while overriding some characters there. It's very hard to describe and it happens randomly, but now that I know there might be memory safety issues, the symptoms seem rather plausible and consistent with those issues.

Actual result

The app crashes:

--------- switch to crash
11-08 23:48:20.927   334   389 F libc    : hardened_malloc: fatal allocator error: double free (quarantine)
11-08 23:48:20.930   334   387 F libc    : Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xc0e444faf170 in tid 387 (DefaultDispatch), pid 334 (latin.playstore)

Full logs:

FUTO Keyboard log 59f7324fbf04.txt

One time (the day before yesterday) I also got a notification by GrapheneOS that the app crashed due to a memory safety issue which hardened_malloc caught.

Expected result

The keyboard shouldn't crash nor mangle my text.

Keyboard Version

0.1.26.2-playstore

Which android version are you using?

Android 16

Which device are you using?

Google Pixel 8

Which operating system are you using?

GrapheneOS, with exploit protection (hardened_malloc etc.) enabled

References

No response

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions