[Payments] Crash in ServiceWorkerPaymentApp |
|||
Issue descriptionStarting the new Canary on Android: I try to load https://rsolomakhin.github.io/pr/bob and get the following crash. Please let me know if this is relevant. 09-05 09:07:33.150 30704 30704 W System.err: java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Collection java.util.Map.values()' on a null object reference 09-05 09:07:33.155 30704 30704 W System.err: at org.chromium.chrome.browser.payments.ServiceWorkerPaymentApp.getInstruments(ServiceWorkerPaymentApp.java:20) 09-05 09:07:33.155 30704 30704 W System.err: at org.chromium.chrome.browser.payments.PaymentRequestImpl.onAllPaymentAppsCreated(PaymentRequestImpl.java:277) 09-05 09:07:33.155 30704 30704 W System.err: at org.chromium.chrome.browser.payments.PaymentAppFactory$1.onAllPaymentAppsCreated(PaymentAppFactory.java:5) 09-05 09:07:33.155 30704 30704 W System.err: at org.chromium.chrome.browser.payments.ServiceWorkerPaymentAppBridge.onAllPaymentAppsCreated(ServiceWorkerPaymentAppBridge.java:35) 09-05 09:07:33.155 30704 30704 W System.err: at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method) 09-05 09:07:33.155 30704 30704 W System.err: at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:9) 09-05 09:07:33.155 30704 30704 W System.err: at android.os.Handler.dispatchMessage(Handler.java:106) 09-05 09:07:33.155 30704 30704 W System.err: at android.os.Looper.loop(Looper.java:164) 09-05 09:07:33.155 30704 30704 W System.err: at android.app.ActivityThread.main(ActivityThread.java:6494) 09-05 09:07:33.155 30704 30704 W System.err: at java.lang.reflect.Method.invoke(Native Method) 09-05 09:07:33.155 30704 30704 W System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 09-05 09:07:33.155 30704 30704 W System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
,
Sep 5 2017
Note that this is during the canMakePayment phase, not when I'm trying to pay. Signs would point to https://cs.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/payments/ServiceWorkerPaymentApp.java?rcl=f9a1c376926cd86ccc42459cc28b8cf78a24711b&l=103
,
Sep 6 2017
Uploaded a patch: https://chromium-review.googlesource.com/652093
,
Sep 6 2017
Did this happen in M-62?
,
Sep 6 2017
Jinho.bang can confirm but I believe it was introduced in M63, this change. https://chromium.googlesource.com/chromium/src/+/8cea359402fa83e048b585a89c3de33cae78daae
,
Sep 6 2017
I've noticed that this happens only for ServiceWorkerPaymentApp, which is behind a flag, so no need to merge either way.
,
Sep 6 2017
Jinho.bang: it is very easy to crash Chrome simply by going to https://rsolomakhin.github.io/pr/bob and not doing anything else. Please add more test coverage so that we do not introduce such crashes that could be avoided.
,
Sep 6 2017
Jinho.bang: Let me know whether you need guidance for running or writing a test. I am happy to help.
,
Sep 7 2017
rouslan@, mathp@, I agree that we should write more tests for payment handler on Android. Current android side tests don't install actual service workers unlike content side tests. So, it's difficult to write more tests such as triggering payment request event under current implementation. So, I'd like to change the test structure (for ServiceWorkerPaymentApp) so that we cover some cases what requires actual service worker. However, this is a crash issue and it might be a little bit urgent although the feature is behind runtime flag. So, I'll update the codes to cover java side codes fully. and then I'll change the test structure.
,
Sep 7 2017
,
Sep 11 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/6ca7aa54df7ac46add71edbbd9bb007d576c8517 commit 6ca7aa54df7ac46add71edbbd9bb007d576c8517 Author: Jinho Bang <jinho.bang@samsung.com> Date: Mon Sep 11 11:59:02 2017 PaymentHandler: Fix a crash when canMakePayment() is called. It happens when |mModifiers| variable is null. Bug: 762003 Change-Id: I37a9837afc80aa239f742ae4c648f05eeb5ca0f9 Reviewed-on: https://chromium-review.googlesource.com/652093 Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org> Commit-Queue: Jinho Bang <jinho.bang@samsung.com> Cr-Commit-Position: refs/heads/master@{#500889} [modify] https://crrev.com/6ca7aa54df7ac46add71edbbd9bb007d576c8517/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java [modify] https://crrev.com/6ca7aa54df7ac46add71edbbd9bb007d576c8517/chrome/android/java/src/org/chromium/chrome/browser/payments/ServiceWorkerPaymentApp.java [modify] https://crrev.com/6ca7aa54df7ac46add71edbbd9bb007d576c8517/chrome/android/java/src/org/chromium/chrome/browser/payments/ServiceWorkerPaymentAppBridge.java [modify] https://crrev.com/6ca7aa54df7ac46add71edbbd9bb007d576c8517/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestServiceWorkerPaymentAppTest.java
,
Sep 13 2017
Issue 764705 has been merged into this issue.
,
Sep 24 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by ma...@chromium.org
, Sep 5 2017