Skip to content
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

GBoard emoji crash #19523

Closed
5 tasks done
kelset opened this issue May 31, 2018 · 6 comments
Closed
5 tasks done

GBoard emoji crash #19523

kelset opened this issue May 31, 2018 · 6 comments
Labels
Bug Component: TextInput Related to the TextInput component. Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. Platform: Android Android applications. Resolution: Fixed A PR that fixes this issue has been merged. Resolution: Locked This issue was locked by the bot.

Comments

@kelset
Copy link
Contributor

kelset commented May 31, 2018

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) 
@kelset kelset added Component: TextInput Related to the TextInput component. Platform: Android Android applications. labels May 31, 2018
@joshjhargreaves
Copy link
Contributor

@kelset I am almost 100% sure that this is a regression caused by the onKeyPress logic (I shall be submitting a fix for the logic itself as soon as I can).

I would build from source before and after the merged PR and test in the RNTester app to verify.

@kelset
Copy link
Contributor Author

kelset commented May 31, 2018

Ok, thanks for the swift response :) Let me know if there is anything extra I can do to help! It's really really weird that it only happens for some emojis 🧐


EDIT: oh wow didn't see the PR #18443, maybe it will fix, let me double check against the test repo

@kelset
Copy link
Contributor Author

kelset commented May 31, 2018

Ok tested the PR locally, and I can confirm it fixes this issue. As soon as a new react-native release includes that commit I'll close this issue.

@react-native-bot react-native-bot added Core Team Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. labels May 31, 2018
@hramos
Copy link
Contributor

hramos commented Jun 15, 2018

Fixed in 0.56.0.

@hramos hramos closed this as completed Jun 15, 2018
@hramos hramos added 🐛Bug Fix Resolution: Fixed A PR that fixes this issue has been merged. labels Jun 15, 2018
@malonguwa
Copy link

malonguwa commented Jun 24, 2018

@hramos is that possible you can cherry pick this commit (41975f7) into the 0.55 release? I am not quite understand how to change my local react native android native java file.... and do not quite want to upgrade to the 0.56 just for this one issue currently in my project.

@hramos
Copy link
Contributor

hramos commented Jun 25, 2018

@malonguwa please route any cherry-pick requests to the relevant issue in the releases repository: https://github.com/react-native-community/react-native-releases/issues

We're unlikely to cherry-pick this into 0.55, though. There's quite a lot of other fixes in 0.56 and not being willing to upgrade to 0.56 does not seem like a good enough reason to add this to 0.55.

@facebook facebook locked as resolved and limited conversation to collaborators Jun 25, 2018
@hramos hramos added the Bug label May 6, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jun 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Component: TextInput Related to the TextInput component. Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. Platform: Android Android applications. Resolution: Fixed A PR that fixes this issue has been merged. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants