brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.96k stars 2.35k forks source link

Crash (sometimes) when tapping on a text field (autofill related?) (NPE) #41185

Open cowcatfox opened 2 months ago

cowcatfox commented 2 months ago

Description

When you tap on the text field on some sites (like archive.is, brave search, many other sites), the browser can suddenly crash. This doesnt happen everytime, but it does happen often enough to be annoying.

Logcat:

FATAL EXCEPTION: main
Process: com.brave.browser, PID: 23514
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.autofill.AutofillId.setSessionId(int)' on a null object reference
    at android.os.Parcel.createExceptionOrNull(Parcel.java:2383)
    at android.os.Parcel.createException(Parcel.java:2361)
    at android.os.Parcel.readException(Parcel.java:2344)
    at android.os.Parcel.readException(Parcel.java:2286)
    at android.app.IActivityTaskManager$Stub$Proxy.reportAssistContextExtras(IActivityTaskManager.java:5434)
    at android.app.ActivityThread.handleRequestAssistContextExtras(ActivityThread.java:3925)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2171)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:236)
    at android.app.ActivityThread.main(ActivityThread.java:8097)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:620)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1011)
Caused by: android.os.RemoteException: Remote stack trace:
    at com.android.server.autofill.Session$AssistDataReceiverImpl.onHandleAssistData(Session.java:463)
    at com.android.server.wm.ActivityTaskManagerService.reportAssistContextExtras(ActivityTaskManagerService.java:3542)
    at android.app.IActivityTaskManager$Stub.onTransact(IActivityTaskManager.java:2506)
    at android.os.Binder.execTransactInternal(Binder.java:1154)
    at android.os.Binder.execTransact(Binder.java:1123)

Steps to reproduce

  1. Open a site like archive.is in a new tab. Tap on any text field.
  2. Probably won't crash immediately. Keep browsing the web in another tab, occasionally coming back to this tab to tap on a text field.
  3. At some point tapping on the text field will cause it to crash. (On libgen.rs, I got this crash quite reliably after a minute or so.)

Actual result

Crash to launcher/home screen

Expected result

No crash

Reproduces how often

Intermittent issue

Brave version

1.69.164

Device

Channel information

Reproducibility

Miscellaneous information

Keyboard: Microsoft SwiftKey 9.10.44

SergeyZhukovsky commented 1 month ago

@cowcatfox I have hard time reproducing it. I don't have a real device running Android 11, but I tried an emulator on Android 11 and installed the Microsoft SwiftKey keyboard there. I can't open libgen.rs though, so I tried on archive.is only. Could you tell more?