NFC: b2g crashes when trying to read MIFARE Classic tag

RESOLVED FIXED in Firefox 38, Firefox OS v2.2

Status

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: tauzen, Assigned: dimi)

Tracking

unspecified
2.2 S5 (6feb)
ARM
Gonk (Firefox OS)
Dependency tree / graph

Firefox Tracking Flags

(firefox36 wontfix, firefox37 wontfix, firefox38 fixed, b2g-v2.2 fixed, b2g-master fixed)

Details

Attachments

(6 attachments, 2 obsolete attachments)

(Reporter)

Description

4 years ago
Created attachment 8511988 [details]
mifare_classic_crash.log

Recently I've noticed that each time I try to read a MIFARE Classic tag, b2g crashes. I know that we don't support MIFARE Classic, but trying to read it should not cause such problem.

In the attached log you can see a segmentation fault just after nfcd tries to notify gecko about the discovered tag:
>D/NfcNci  (  299): doCheckNdefResult: flag all unknown
>D/NfcNci  (  299): doCheckNdef: exit; status=0x3
>E/NfcNci  (  299): doReadNdefInfo: Check NDEF Failed - status = 3
>D/nfcd    (  299): processNotificaton notification=2001
>D/nfcd    (  299): void NfcIpcSocket::writeToOutgoingQueue(uint8_t*, size_t) enter, data=0xb7dcdd68, dataLen=28
>D/nfcd    (  299): Writing 28 bytes to gecko 
>D/NfcNci  (  299): doPresenceCheck
>I/BrcmNfcNfa(  299): NFA_RwPresenceCheck
>I/BrcmNfcNfa(  299): NFC_Deactivate 5 (OPEN) deactivate_type:1
>F/libc    (  294): Fatal signal 11 (SIGSEGV) at 0x00000380 (code=1), thread 294 (b2g)
(Assignee)

Updated

4 years ago
Assignee: nobody → dlee
(Assignee)

Updated

4 years ago
Blocks: 1044425
(Assignee)

Comment 1

4 years ago
Created attachment 8514182 [details]
nfcd with debug message

Hi Krzysztof,
Could you help update the attached nfcd and add |-v theadtime| to dump log again ? Thanks for help
(Reporter)

Comment 2

4 years ago
Sure, but could you paste the command needed update nfcd? (I haven't done this before myslef)
Flags: needinfo?(dlee)
(Reporter)

Comment 3

4 years ago
Ok, figured this out. 
But actually, after doing ./repo sync -d and full build the error does not happen anymore. I assume this might be related to switching back and forth form QCRIL image to regular master. I'll leave this open for couple more days and if it won't occur I'll close this bug as invalid if it's ok with you.
Sorry for all the trouble.
Flags: needinfo?(dlee)
(Assignee)

Comment 4

4 years ago
Yes

Bug if this bug is reproduced,
You can use "adb push nfcd /system/bin/" to update nfcd, and then reboot device dump the log again, please also add -v threadtime when dumping adb log, thanks
(Assignee)

Comment 5

4 years ago
Hi krzysztof,
Can this issue still be reproduced ? If not, i would suggest we close this bug.
Flags: needinfo?(kmioduszewski)
(Reporter)

Comment 6

4 years ago
I actually had experienced this yesterday on a Friday build. I just want to do a fresh build today, if everything will be ok I'll close this. Will remove ni, once I did the final test.
(Reporter)

Comment 7

4 years ago
Ok, i replicated this once more on todays build:
Gecko:
commit 1e0235c7b7f910135090e4f72f9f30ae74c12162
Merge: 4a1ad5b 00198ea
Author: Wes Kocher <wkocher@mozilla.com>
Date:   Mon Nov 10 18:14:04 2014 -0800

    Merge b2g-inbound to m-c a=merge

nfcd:
commit 91a2872824a81dea949f0b57a1399dade5d4d1ea
Merge: 2cb1db1 d65b31e
Author: Yoshi Huang <allstars.chh@gmail.com>
Date:   Fri Nov 7 19:50:54 2014 +0800

    Merge pull request #72 from allstarschh/Bug1055460
    
    Bug 1055460 - replace config with power request. r=dimi
(Reporter)

Comment 8

4 years ago
Created attachment 8520459 [details]
mifare_classic_crash_2.log

Log with debug nfcd and threadtime
Flags: needinfo?(kmioduszewski)
(Assignee)

Comment 9

4 years ago
Hi krzysztof,
Is this issue 100% reproducible when tap the tag ?
I saw this on my debug build.

12-10 22:31:59.420: A/MOZ_Assert(916): Assertion failure: tech < NFCTechType::EndGuard_, at ../../../gecko/dom/nfc/gonk/NfcService.cpp:130
(Assignee)

Updated

4 years ago
Depends on: 1120321
(Assignee)

Updated

4 years ago
Depends on: 1120841
(Assignee)

Comment 11

4 years ago
Created attachment 8554362 [details] [review]
pull request to mozilla-b2g/platform_system_nfcd v1
Attachment #8554362 - Flags: review?(allstars.chh)
(Assignee)

Comment 12

4 years ago
Created attachment 8554363 [details] [diff] [review]
WebIDL change v1
Attachment #8554363 - Flags: review?(allstars.chh)
Comment on attachment 8554363 [details] [diff] [review]
WebIDL change v1

Review of attachment 8554363 [details] [diff] [review]:
-----------------------------------------------------------------

need review from a DOM peer.
Attachment #8554363 - Flags: review?(allstars.chh) → review+
Attachment #8554362 - Flags: review?(allstars.chh) → review+
(Assignee)

Comment 14

4 years ago
Comment on attachment 8554363 [details] [diff] [review]
WebIDL change v1

Review of attachment 8554363 [details] [diff] [review]:
-----------------------------------------------------------------

r? to smaug for WebIDL change
Attachment #8554363 - Flags: review?(bugs)
(Assignee)

Comment 16

4 years ago
Created attachment 8554971 [details] [diff] [review]
WebIDL change v2

Update patch description
Attachment #8554363 - Attachment is obsolete: true
Attachment #8554971 - Flags: review+
(Assignee)

Updated

4 years ago
Keywords: checkin-needed
(Assignee)

Comment 17

4 years ago
need rebased nfcd base on bug 1125041
Keywords: checkin-needed
(Assignee)

Comment 18

4 years ago
Created attachment 8555076 [details] [review]
pull request to mozilla-b2g/platform_system_nfcd v2

Hi Yoshi,
Please help review again because there is some changed due to rebase on bug 1125041
Attachment #8554362 - Attachment is obsolete: true
Attachment #8555076 - Flags: review?(allstars.chh)
Attachment #8555076 - Flags: review?(allstars.chh) → review+
(Assignee)

Updated

4 years ago
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/9b56103db0ce
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.2 S5 (6feb)
(Assignee)

Comment 21

4 years ago
Created attachment 8555594 [details] [review]
pull request to mozilla-b2g/platform_system_nfcd 2.2
(Assignee)

Comment 22

4 years ago
Comment on attachment 8554971 [details] [diff] [review]
WebIDL change v2

NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 
New bug

User impact if declined: 
b2g crash when reading NFC mifare-classic tag type

Testing completed: 
Manually test with mifare-classic tag

String or UUID changes made by this patch:
None
Attachment #8554971 - Flags: approval-mozilla-b2g37?
(Assignee)

Comment 23

4 years ago
Comment on attachment 8555594 [details] [review]
pull request to mozilla-b2g/platform_system_nfcd 2.2

NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 
New bug

User impact if declined: 
b2g crash when reading NFC mifare-classic tag type

Testing completed: 
Manually test with mifare-classic tag

String or UUID changes made by this patch:
None
Attachment #8555594 - Flags: approval-mozilla-b2g37?

Updated

4 years ago
Attachment #8554971 - Flags: approval-mozilla-b2g37? → approval-mozilla-b2g37+

Updated

4 years ago
Attachment #8555594 - Flags: approval-mozilla-b2g37? → approval-mozilla-b2g37+
https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/aeff9ec9a901

v2.2: https://github.com/mozilla-b2g/platform_system_nfcd/commit/de927361215b03e8aaa39ff25b3e691520417cb4
status-b2g-v2.2: --- → fixed
status-b2g-master: --- → fixed
status-firefox36: --- → wontfix
status-firefox37: --- → wontfix
status-firefox38: --- → fixed
You need to log in before you can comment on or make changes to this bug.