Skip to content

GBoard emoji crash #19523

Closed
Closed
@kelset

Description

@kelset

Environment

Environment:
  OS: macOS High Sierra 10.13.4
  Node: 10.3.0
  Yarn: 1.7.0
  npm: 6.1.0
  Watchman: 4.9.0
  Xcode: Xcode 9.2 Build version 9C40b
  Android Studio: 3.1 AI-173.4720617

Packages: (wanted => installed)
  react: 16.3.1 => 16.3.1
  react-native: 0.55.4 => 0.55.4

Description

A quite precise kind of issue, that I basically found thanks to our manual testing team. It's quite the weird bug, caused by the GBoard only in Android env (tested on iOS without repro the issue).

The weirdest part is that not all emojis trigger it. In fact, aside night:

  • "cat" 🐈 -> crash
  • "rainbow" 🌈 -> crash
  • "cloud" ☁️ -> no crash
  • "sun" ⛅️ -> no crash

Btw there the words that 'trigger' emoji suggestions are different, the only one that triggers the same emoji on both platforms is "piano" 🎹 (and on iOS it doesn't crash, on Android yes) (ok maybe not the only one, but the only one I found quickly).

And it doesn't happen with remote debugger on.

Same stacktrace as #10756 and similar to #19129 (which was closed by the bot) and #18126 (which was closed linking to PR #18114 by @joshyhargreaves) by @hramos. So this is potentially a regression? (I am not sure, I feel like it's not strictly related to that one)

Steps to Reproduce

  1. clone the repo & cd into it
  2. react-native run-android
  3. make sure the device on which you run it has the Google GBoard installed
  4. tap on the textinput and write "night"
  5. the GBoard will suggest in the bar the night with stars emoji 🌃
  6. click on the suggestion
  7. crash

(the repro is the standard react-native init project with a textinput just like the example in the docs)

Expected Behavior

The emoji appears without troubles in the textinput field.

Actual Behavior

App crashes with the following stacktrace:

Fatal Exception: java.lang.RuntimeException
Error calling RCTEventEmitter.receiveEvent

Caused by com.facebook.jni.CppException
Failed to create Value from JSON:

<...stacktrace>

If logging via LogCat, there are some extra info:

05-31 14:39:29.044 12953-13205/com.nightcrash I/ReactNativeJS: 'yo', 'Night'
05-31 14:39:30.163 12953-12953/com.nightcrash E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
    SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
05-31 14:39:30.197 12953-13205/com.nightcrash I/ReactNativeJS: 'yo', '🌃'
05-31 14:39:30.247 12953-13205/com.nightcrash E/unknown:ReactNative: Exception in native call
    java.lang.RuntimeException: Error calling RCTEventEmitter.receiveEvent
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:751)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
        at android.os.Looper.loop(Looper.java:154)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
        at java.lang.Thread.run(Thread.java:762)
     Caused by: com.facebook.jni.CppException: Failed to create Value from JSON: 
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 
        at android.os.Handler.handleCallback(Handler.java:751) 
        at android.os.Handler.dispatchMessage(Handler.java:95) 
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29) 
        at android.os.Looper.loop(Looper.java:154) 
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192) 
        at java.lang.Thread.run(Thread.java:762) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugComponent: TextInputRelated to the TextInput component.Impact: RegressionDescribes a behavior that used to work on a prior release, but stopped working recently.Platform: AndroidAndroid applications.Resolution: FixedA PR that fixes this issue has been merged.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions