Flipper-XFW / Xtreme-Firmware

The Dom amongst the Flipper Zero Firmware. Give your Flipper the power and freedom it is really craving. Let it show you its true form. Dont delay, switch to the one and only true Master today!
https://flipper-xtre.me
GNU General Public License v3.0
9.5k stars 693 forks source link

NFC crashes when reading tag #417

Closed marciogranzotto closed 10 months ago

marciogranzotto commented 1 year ago

Describe the bug.

On dev(9ef4b15f683419afba98556e9ad2b9cd674abc5b), when reading an NFC device, in this cases a FreeStyle Libre CGM device, causes a crash.

The message after reboot is:

Flipper crashed but has been rebooted MPU fault, possibly stackoverflow

This doesn't happen on the release version.

Reproduction

  1. Flash commit 9ef4b15f683419afba98556e9ad2b9cd674abc5b
  2. Open NFC app from the app menu
  3. Select read
  4. Try to read an NFC tag/device
  5. Crashes

Target

f7-C

Logs

No response

Anything else?

No response

Sil333033 commented 1 year ago

What type NFC is used on your device? Can you send a result of the read (with release version ofc)

marciogranzotto commented 1 year ago

Well... it looks like it's also crashing most of the time in the main branch.

I've tried to watch the logs while reading the tag:

>: log debug
Current log level: debug
Use <log ?> to list available log levels
Press CTRL+C to stop...
68397 [I][FuriHalNfc] Deinit OK
68527 [I][FuriHalNfc] Init OK
68532 [D][DolphinState] icounter 9978, butthurt 0
70710 [I][NfcWorker] NfcV detected
70875 [D][NfcV] Read SYSTEM INFORMATION...
70887 [D][NfcV]   UID:          E0 07 A0 00 0C 0E 27 79
70889 [D][NfcV]   DSFID 243, AFI 7, Blocks 207, Size 94, IC Ref 0
70891 [D][NfcV] Reading block 0/206
70902 [D][NfcV]   9D F4 88 1B
70904 [D][NfcV] Reading block 1/206
70914 [D][NfcV]   00 00 00 00
70915 [D][NfcV] Reading block 2/206
70926 [D][NfcV]   00 00 00 00
70928 [D][NfcV] Reading block 3/206
70938 [D][NfcV]   DD E4 06 05
70940 [D][NfcV] Reading block 4/206
70951 [D][NfcV]   1F 80 C8 03
70953 [D][NfcV] Reading block 5/206
70963 [D][NfcV]   C1 03 C8 B4
70964 [D][NfcV] Reading block 6/206
70974 [D][NfcV]   C8 58 1F 80
70976 [D][NfcV] Reading block 7/206
70987 [D][NfcV]   5F 00 BF 03
70989 [D][NfcV] Reading block 8/206
70999 [D][NfcV]   07 04 C8 CC
71000 [D][NfcV] Reading block 9/206
71011 [D][NfcV]   C8 D8 5E 00
71013 [D][NfcV] Reading block 10/206
71023 [D][NfcV]   1E 80 F3 03
71025 [D][NfcV] Reading block 11/206
71036 [D][NfcV]   ED 03 C8 E4
71038 [D][NfcV] Reading block 12/206
71048 [D][NfcV]   C8 14 5F 00
71051 [D][NfcV] Reading block 13/206
71061 [D][NfcV]   5F 00 DD 03
71062 [D][NfcV] Reading block 14/206
71072 [D][NfcV]   D8 03 C8 6C
71074 [D][NfcV] Reading block 15/206
71085 [D][NfcV]   C8 A0 1F 80
71087 [D][NfcV] Reading block 16/206
71097 [D][NfcV]   1E 80 8B 04
71100 [D][NfcV] Reading block 17/206
71110 [D][NfcV]   60 04 C8 8C
71111 [D][NfcV] Reading block 18/206
71121 [D][NfcV]   C8 E4 5E 00
71123 [D][NfcV] Reading block 19/206
71134 [D][NfcV]   1E 80 09 06
71136 [D][NfcV] Reading block 20/206
71146 [D][NfcV]   00 06 C8 B0
71149 [D][NfcV] Reading block 21/206
71159 [D][NfcV]   C8 4C 60 00
71160 [D][NfcV] Reading block 22/206
71170 [D][NfcV]   1F 80 D9 06
71172 [D][NfcV] Reading block 23/206
71183 [D][NfcV]   A5 08 C8 58
71185 [D][NfcV] Reading block 24/206
71195 [D][NfcV]   C8 90 1F 80
71198 [D][NfcV] Reading block 25/206
71208 [D][NfcV]   1F 80 5D 09
71209 [D][NfcV] Reading block 26/206
71219 [D][NfcV]   7C 09 C8 44
71221 [D][NfcV] Reading block 27/206
71232 [D][NfcV]   C8 78 1F 80
71234 [D][NfcV] Reading block 28/206
71244 [D][NfcV]   5F 00 01 0A
71247 [D][NfcV] Reading block 29/206
71257 [D][NfcV]   60 0A C8 F0
71258 [D][NfcV] Reading block 30/206
71268 [D][NfcV]   C8 08 1E 80
71270 [D][NfcV] Reading block 31/206
71281 [D][NfcV]   1D 80 45 0A
71283 [D][NfcV] Reading block 32/206
71293 [D][NfcV]   FF 09 C8 A0
71296 [D][NfcV] Reading block 33/206
71306 [D][NfcV]   C8 80 1C 80
71307 [D][NfcV] Reading block 34/206
71317 [D][NfcV]   5D 00 94 08
71319 [D][NfcV] Reading block 35/206
71330 [D][NfcV]   0C 08 C8 C0
71332 [D][NfcV] Reading block 36/206
71343 [D][NfcV]   C8 0C 1C 80
71345 [D][NfcV] Reading block 37/206
71355 [D][NfcV]   1C 80 71 06
71356 [D][NfcV] Reading block 38/206
71366 [D][NfcV]   FB 05 C8 10
71368 [D][NfcV] Reading block 39/206
71379 [D][NfcV]   C8 40 5D 00
71381 [D][NfcV] Reading block 40/206
71391 [D][NfcV]   AA BB 00 08
71394 [D][NfcV] Reading block 41/206
71404 [D][NfcV]   14 07 96 80
71405 [D][NfcV] Reading block 42/206
71415 [D][NfcV]   0E 5E 1A C8
71417 [D][NfcV] Reading block 43/206
71428 [D][NfcV]   AE F9 21 83
71430 [D][NfcV] Reading block 44/206
71440 [D][NfcV]   06 08 02 24
71443 [D][NfcV] Reading block 45/206
71453 [D][NfcV]   C2 43 08 08
71454 [D][NfcV] Reading block 46/206
71464 [D][NfcV]   08 08 D2 42
71466 [D][NfcV] Reading block 47/206
71478 [D][NfcV]   D2 42 A3 F9
71480 [D][NfcV] Reading block 48/206
71494 [D][NfcV]   0C 53 92 12
71496 [D][NfcV] Reading block 49/206
71506 [D][NfcV]   03 20 A2 41
71508 [D][NfcV] Reading block 50/206
71519 [D][NfcV]   B2 43 08 08
71521 [D][NfcV] Reading block 51/206
71531 [D][NfcV]   30 41 0A 12
71534 [D][NfcV] Reading block 52/206
71544 [D][NfcV]   0B 20 B2 40
71545 [D][NfcV] Reading block 53/206
71555 [D][NfcV]   92 D3 00 07
71557 [D][NfcV] Reading block 54/206
71568 [D][NfcV]   00 07 A2 D2
71570 [D][NfcV] Reading block 55/206
71581 [D][NfcV]   92 12 82 1C
71583 [D][NfcV] Reading block 56/206
71593 [D][NfcV]   E2 B3 C3 1C
71594 [D][NfcV] Reading block 57/206
71604 [D][NfcV]   C3 1C 4A 93
71606 [D][NfcV] Reading block 58/206
71617 [D][NfcV]   12 10 A4 1C
71619 [D][NfcV] Reading block 59/206
71629 [D][NfcV]   3A 41 30 41
71632 [D][NfcV] Reading block 60/206
71642 [D][NfcV]   08 12 09 12
71643 [D][NfcV] Reading block 61/206
71653 [D][NfcV]   07 00 06 08
71655 [D][NfcV] Reading block 62/206
71666 [D][NfcV]   3A FB 61 20
71668 [D][NfcV] Reading block 63/206
71679 [D][NfcV]   3A 40 FA F9
71681 [D][NfcV] Reading block 64/206
71691 [D][NfcV]   3B 40 84 1C
71692 [D][NfcV] Reading block 65/206
71703 [D][NfcV]   B0 F9 39 40
71705 [D][NfcV] Reading block 66/206
71715 [D][NfcV]   00 20 A4 1C
71717 [D][NfcV] Reading block 67/206
71728 [D][NfcV]   B0 12 30 FB
71730 [D][NfcV] Reading block 68/206
71740 [D][NfcV]   2F 89 82 4F
71741 [D][NfcV] Reading block 69/206
71752 [D][NfcV]   0F 43 B0 12
71754 [D][NfcV] Reading block 70/206
71764 [D][NfcV]   00 E0 A4 1C
71766 [D][NfcV] Reading block 71/206
71777 [D][NfcV]   A4 1C 2F 49
71779 [D][NfcV] Reading block 72/206
71789 [D][NfcV]   0C 48 AB 12
71792 [D][NfcV] Reading block 73/206
71802 [D][NfcV]   3D 40 22 00
71804 [D][NfcV] Reading block 74/206
71814 [D][NfcV]   B2 90 00 01
71816 [D][NfcV] Reading block 75/206
71827 [D][NfcV]   7F 43 7E 42
71829 [D][NfcV] Reading block 76/206
71839 [D][NfcV]   AB 12 7C 40
71842 [D][NfcV] Reading block 77/206
71852 [D][NfcV]   6C 42 8A 12
71853 [D][NfcV] Reading block 78/206
71863 [D][NfcV]   FF 07 82 4F
71865 [D][NfcV] Reading block 79/206
71876 [D][NfcV]   A6 1C 7E 40
71878 [D][NfcV] Reading block 80/206
71888 [D][NfcV]   16 00 0C 48
71891 [D][NfcV] Reading block 81/206
71901 [D][NfcV]   05 00 8A 12
71902 [D][NfcV] Reading block 82/206
71912 [D][NfcV]   0C 00 3D 40
71914 [D][NfcV] Reading block 83/206
71925 [D][NfcV]   AB 12 7C 40
71927 [D][NfcV] Reading block 84/206
71937 [D][NfcV]   2F 49 7E 40
71940 [D][NfcV] Reading block 85/206
71950 [D][NfcV]   34 00 0C 48
71951 [D][NfcV] Reading block 86/206
71961 [D][NfcV]   10 00 22 01
71963 [D][NfcV] Reading block 87/206
71974 [D][NfcV]   28 00 92 12
71976 [D][NfcV] Reading block 88/206
71986 [D][NfcV]   05 3C E2 C2
71989 [D][NfcV] Reading block 89/206
71999 [D][NfcV]   94 1C 1C 43
72000 [D][NfcV] Reading block 90/206
72010 [D][NfcV]   5E 43 3D 40
72012 [D][NfcV] Reading block 91/206
72023 [D][NfcV]   00 46 C2 43
72025 [D][NfcV] Reading block 92/206
72035 [D][NfcV]   C3 1C 92 12
72038 [D][NfcV] Reading block 93/206
72048 [D][NfcV]   30 41 F2 90
72049 [D][NfcV] Reading block 94/206
72059 [D][NfcV]   02 24 0C 43
72061 [D][NfcV] Reading block 95/206
72072 [D][NfcV]   3A FB 08 24
72074 [D][NfcV] Reading block 96/206
72084 [D][NfcV]   7C 40 28 00
72087 [D][NfcV] Reading block 97/206
72097 [D][NfcV]   0C 43 30 41
72098 [D][NfcV] Reading block 98/206
72108 [D][NfcV]   92 D3 00 07
72110 [D][NfcV] Reading block 99/206
72121 [D][NfcV]   02 07 B2 C0
72123 [D][NfcV] Reading block 100/206
72134 [D][NfcV]   A2 D2 00 07
72136 [D][NfcV] Reading block 101/206
72146 [D][NfcV]   32 D0 D8 00
72147 [D][NfcV] Reading block 102/206
72158 [D][NfcV]   05 28 E2 C3
72159 [D][NfcV] Reading block 103/206
72169 [D][NfcV]   A4 1C DE F8
72171 [D][NfcV] Reading block 104/206
72181 [D][NfcV]   86 1C E2 C2
72183 [D][NfcV] Reading block 105/206
72194 [D][NfcV]   94 1C 1C 43
72196 [D][NfcV] Reading block 106/206
72207 [D][NfcV]   07 00 06 08
72209 [D][NfcV] Reading block 107/206
72219 [D][NfcV]   30 41 C2 43
72220 [D][NfcV] Reading block 108/206
72231 [D][NfcV]   C3 1C 92 12
72232 [D][NfcV] Reading block 109/206
72242 [D][NfcV]   30 41 0A 12
72244 [D][NfcV] Reading block 110/206
72255 [D][NfcV]   4C 93 14 24
72257 [D][NfcV] Reading block 111/206
72268 [D][NfcV]   0C 08 10 20
72270 [D][NfcV] Reading block 112/206
72280 [D][NfcV]   5F 42 06 08
72283 [D][NfcV] Reading block 113/206
72293 [D][NfcV]   7F 93 05 20
72294 [D][NfcV] Reading block 114/206
72304 [D][NfcV]   C2 43 08 08
72306 [D][NfcV] Reading block 115/206
72317 [D][NfcV]   10 00 02 28
72319 [D][NfcV] Reading block 116/206
72330 [D][NfcV]   C2 43 08 08
72332 [D][NfcV] Reading block 117/206
72342 [D][NfcV]   0E 4C 0E 5E
72345 [D][NfcV] Reading block 118/206
72355 [D][NfcV]   A2 4A 08 08
72356 [D][NfcV] Reading block 119/206
72366 [D][NfcV]   F7 2B 1C 43
72368 [D][NfcV] Reading block 120/206
72379 [D][NfcV]   0A 12 4A 4C
72381 [D][NfcV] Reading block 121/206
72392 [D][NfcV]   6A 92 10 20
72394 [D][NfcV] Reading block 122/206
72404 [D][NfcV]   3D 40 16 00
72407 [D][NfcV] Reading block 123/206
72417 [D][NfcV]   92 12 4C 1C
72418 [D][NfcV] Reading block 124/206
72428 [D][NfcV]   92 52 A6 1C
72430 [D][NfcV] Reading block 125/206
72440 [D][NfcV]   A6 1C A6 1C
72442 [D][NfcV] Reading block 126/206
72453 [D][NfcV]   0E 43 1C 42
72455 [D][NfcV] Reading block 127/206
72466 [D][NfcV]   DE 5E 1D 42
72468 [D][NfcV] Reading block 128/206
72478 [D][NfcV]   0D 10 0D 11
72479 [D][NfcV] Reading block 129/206
72490 [D][NfcV]   0D 8C 04 3C
72492 [D][NfcV] Reading block 130/206
72503 [D][NfcV]   3E 40 00 02
72505 [D][NfcV] Reading block 131/206
72518 [D][NfcV]   02 28 3D 40
72519 [D][NfcV] Reading block 132/206
72529 [D][NfcV]   A8 F9 0F 9D
72531 [D][NfcV] Reading block 133/206
72542 [D][NfcV]   40 00 AE 1C
72544 [D][NfcV] Reading block 134/206
72555 [D][NfcV]   C2 1C 0D DE
72557 [D][NfcV] Reading block 135/206
72567 [D][NfcV]   30 41 0A 12
72568 [D][NfcV] Reading block 136/206
72579 [D][NfcV]   09 12 5B 42
72580 [D][NfcV] Reading block 137/206
72590 [D][NfcV]   F2 B0 40 00
72592 [D][NfcV] Reading block 138/206
72603 [D][NfcV]   F2 43 04 02
72605 [D][NfcV] Reading block 139/206
Exception in thread rx:
Traceback (most recent call last):

--- exit ---
  File "/Users/marciorodrigues/Projects/Flipper/Xtreme-Firmware/toolchain/x86_64-darwin/python/lib/python3.11/site-packages/serial/serialposix.py", line 575, in read
    buf = os.read(self.fd, size - len(read))

If I try to read the tag via the CLI, I get:

>: nfc detect
Detecting nfc...
Press Ctrl+C to abort
Found: NFC-V UID length: 8, UID:79270E0C00A007E0

I've seen other crash messages though, like:

Also, when it successfully reads the tag, it crashes when I press the "More" button, with NULL pointer dereference error.

But here's its screen when it successfully reads the tag: telegram-cloud-photo-size-1-4986033182264634623-y

Willy-JL commented 1 year ago

can you try on latest dev branch?

also do you have asset packs enabled?

how are you launching the nfc app?

does it also happen just right after a reboot?

Willy-JL commented 11 months ago

the nfc stack has been fully refactored. please check if it happens on the latest release @marciogranzotto

also ensure that settings > system > heap trace = none

Willy-JL commented 10 months ago

Very stale, and there's been copious amounts of fixes for nfc and nfcv, I believe this is fixed. Report back if you still have issues