New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 714039 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Email to this user bounced
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug


Participants' hotlists:
NFC


Sign in to add a comment

[webnfc]Crash occurs when tap an NFC tag to device many times

Reported by canx....@intel.com, Apr 21 2017

Issue description

Steps to reproduce the problem:
Test Case: https://github.com/thewebera/web-test-suite/blob/gh-pages/web-nfc/nfc/nfc_push_arraybuffer-manual.https.html

1.Run the test case
2.Tap an NFC tag to the test device with NFC support
3.repeat the step 1 and 2.

What is the expected behavior?
All the function works fine, no crash.

What went wrong?
Repeat the steps to reproduce many times over, the browser crash happened.

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 60.0.3074.0  Channel: canary
OS Version: Nexus 7(Android 5.1)
Flash Version: Shockwave Flash 25.0 r0

The reappearance rate of crash was low, about run test case 10 times, the crash happened once.
Crash log  please refer to attachment.
 
crash.log
101 KB View Download

Comment 1 by canx....@intel.com, Apr 21 2017

Cc: wanming.lin@intel.com , alexander.shalamov@intel.com 
Please take a look. Thanks.
Components: Blink>NFC
Cc: reillyg@chromium.org
Owner: alexande...@intel.com
Status: Started (was: Unconfirmed)
Looks like tag is disconnected during read operation, https://developer.android.com/reference/android/nfc/tech/Ndef.html#getNdefMessage() should not throw IllegalStateException according to API documentation. I will try catching it to fix this issue.
Project Member

Comment 4 by bugdroid1@chromium.org, Apr 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2dd2610dc05678f182b268412a63150b5fd8eacb

commit 2dd2610dc05678f182b268412a63150b5fd8eacb
Author: alexander.shalamov <alexander.shalamov@intel.com>
Date: Thu Apr 27 06:55:06 2017

[webnfc] Handle IllegalStateException during read / write operations

Accodring to Android documentation [1] read and write operations for
Ndef technology, should not throw IllegalStateException, however, those
operations do throw exception that must be handled. Unit tests are
updated to check that exception is handled and correct error reported
to caller.

[1] https://developer.android.com/reference/android/nfc/tech/Ndef.html

BUG= 714039 

Review-Url: https://codereview.chromium.org/2845463004
Cr-Commit-Position: refs/heads/master@{#467610}

[modify] https://crrev.com/2dd2610dc05678f182b268412a63150b5fd8eacb/device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java
[modify] https://crrev.com/2dd2610dc05678f182b268412a63150b5fd8eacb/device/nfc/android/java/src/org/chromium/device/nfc/NfcTagHandler.java
[modify] https://crrev.com/2dd2610dc05678f182b268412a63150b5fd8eacb/device/nfc/android/junit/src/org/chromium/device/nfc/NFCTest.java

Status: Fixed (was: Started)
canx.cao@ Could you please verify? Thanks.

Comment 7 by canx....@intel.com, May 4 2017

I verified this issue in chrome 60.0.3087.3, it is blocked by https://bugs.chromium.org/p/chromium/issues/detail?id=717899 .
I will verified it when the  Issue#717899  is fixed.
If you want to avoid releasing NFC adapter to system. Just add watch for 'any'.
Something like:

navigator.nfc.watch((message) => { console.log(JSON.stringify(message)); })
function testPush() {
  navigator.nfc.push("Test " + Date.now()).then(testPush);
}
function testPush() {
  navigator.nfc.push("Test " + Date.now()).then(testPush);
}

navigator.nfc.watch((message) => { console.log(JSON.stringify(message)); })
navigator.nfc.push("Test " + Date.now()).then(testPush);
I verified this issue in chrome 60.0.3089.0.
Repeat the steps to reproduce more than 50 times,no crash occurs.
Close.
Status: Verified (was: Fixed)

Sign in to add a comment