Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ESP32] Fixed lock app crash #25895

Merged
merged 2 commits into from
Apr 3, 2023

Conversation

jadhavrohit924
Copy link
Contributor

@jadhavrohit924 jadhavrohit924 commented Mar 30, 2023

Problem:

Changes:

  • See above.

Testing:

  • Tested commissioning and cluster control.

@github-actions
Copy link

PR #25895: Size comparison from 35b1fc1 to d98c355

Decreases (1 build for cc32xx)
platform target config section 35b1fc1 d98c355 change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_info 20310043 20310042 -1 -0.0
Full report (1 build for cc32xx)
platform target config section 35b1fc1 d98c355 change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 645769 645769 0 0.0
(read/write) 203848 203848 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197248 197248 0 0.0
.comment 194 194 0 0.0
.data 1480 1480 0 0.0
.debug_abbrev 933102 933102 0 0.0
.debug_aranges 87704 87704 0 0.0
.debug_frame 301596 301596 0 0.0
.debug_info 20310043 20310042 -1 -0.0
.debug_line 2681003 2681003 0 0.0
.debug_loc 2827360 2827360 0 0.0
.debug_ranges 286352 286352 0 0.0
.debug_str 3041144 3041144 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 105953 105953 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 380543 380543 0 0.0
.symtab 257472 257472 0 0.0
.text 537696 537696 0 0.0

examples/lock-app/esp32/main/AppTask.cpp Outdated Show resolved Hide resolved
@jadhavrohit924 jadhavrohit924 force-pushed the bugfix/lock-app branch 2 times, most recently from 5732321 to ba1dbda Compare March 31, 2023 09:34
@github-actions
Copy link

PR #25895: Size comparison from ce0ddc0 to ba1dbda

Increases (1 build for cc32xx)
platform target config section ce0ddc0 ba1dbdaf change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_info 20310331 20310332 1 0.0
Full report (1 build for cc32xx)
platform target config section ce0ddc0 ba1dbdaf change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 645825 645825 0 0.0
(read/write) 203848 203848 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197248 197248 0 0.0
.comment 194 194 0 0.0
.data 1480 1480 0 0.0
.debug_abbrev 933102 933102 0 0.0
.debug_aranges 87704 87704 0 0.0
.debug_frame 301596 301596 0 0.0
.debug_info 20310331 20310332 1 0.0
.debug_line 2681125 2681125 0 0.0
.debug_loc 2827568 2827568 0 0.0
.debug_ranges 286448 286448 0 0.0
.debug_str 3041144 3041144 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 105953 105953 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 380543 380543 0 0.0
.symtab 257472 257472 0 0.0
.text 537752 537752 0 0.0

@github-actions
Copy link

github-actions bot commented Apr 3, 2023

PR #25895: Size comparison from 7ccd5d4 to 485213d

Increases (1 build for cc32xx)
platform target config section 7ccd5d4 485213d change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_info 20310330 20310331 1 0.0
Full report (1 build for cc32xx)
platform target config section 7ccd5d4 485213d change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 645825 645825 0 0.0
(read/write) 203848 203848 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197248 197248 0 0.0
.comment 194 194 0 0.0
.data 1480 1480 0 0.0
.debug_abbrev 933102 933102 0 0.0
.debug_aranges 87704 87704 0 0.0
.debug_frame 301596 301596 0 0.0
.debug_info 20310330 20310331 1 0.0
.debug_line 2681125 2681125 0 0.0
.debug_loc 2827568 2827568 0 0.0
.debug_ranges 286448 286448 0 0.0
.debug_str 3041144 3041144 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 105953 105953 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 380543 380543 0 0.0
.symtab 257472 257472 0 0.0
.text 537752 537752 0 0.0

@andy31415 andy31415 merged commit 9555521 into project-chip:master Apr 3, 2023
@jadhavrohit924 jadhavrohit924 deleted the bugfix/lock-app branch April 4, 2023 04:18
@karlp
Copy link
Contributor

karlp commented Jun 28, 2023

I'm still seeing this on the v1.1-branch, which includes this fix, any other ideas?

Log with backtrace
I (2153) chip[DL]: Device Configuration:
I (2153) chip[DL]:   Serial Number: TEST_SN
I (2153) chip[DL]:   Vendor Id: 65521 (0xFFF1)
I (2163) chip[DL]:   Product Id: 32774 (0x8006)
I (2163) chip[DL]:   Product Name: TEST_PRODUCT
I (2173) chip[DL]:   Hardware Version: 0
I (2173) chip[DL]:   Setup Pin Code (0 for UNKNOWN/ERROR): 20202021
I (2183) chip[DL]:   Setup Discriminator (0xFFFF for UNKNOWN/ERROR): 3840 (0xF00)
I (2193) chip[DL]:   Manufacturing Date: (not set)
I (2193) chip[DL]:   Device Type: 0 (0x0)
I (2203) chip[SVR]: SetupQRCode: [MT:8IXS142C00KA0648G00]
I (2213) chip[SVR]: Copy/paste the below URL in a browser to see the QR Code:
I (2213) chip[SVR]: https://project-chip.github.io/connectedhomeip/qrcode.html?data=MT%3A8IXS142C00KA0648G00
I (2223) chip[SVR]: Manual pairing code: [34970112332]
I (2233) lock-devicecallbacks: PostAttributeChangeCallback - Cluster ID: '0x6', EndPoint ID: '0x1', Attribute ID: '0x0'
I (2233) lock-app: App Task started
I (2243) lock-devicecallbacks: Current free heap: 93540

I (2303) lock-app: Unlock Action has been initiated
I (4303) lock-app: Unlock Action has been completed
E (4303) chip[DL]: Chip stack locking error at 'src/system/SystemLayerImplFreeRTOS.cpp:94'. Code is unsafe/racy
E (4303) chip[-]: chipDie chipDie chipDie

abort() was called at PC 0x40121d8b on core 0
0x40121d8b: chip::Platform::Internal::AssertChipStackLockedByCurrentThread(char const*, int) at /home/karlp/src/esp/esp-matter/connectedhomeip/connectedhomeip/examples/lock-app/esp32/build/esp-idf/chip/../../../../../../config/esp32/third_party/connectedhomeip/src/lib/support/CodeUtils.h:508
 (inlined by) chipDie at /home/karlp/src/esp/esp-matter/connectedhomeip/connectedhomeip/examples/lock-app/esp32/build/esp-idf/chip/../../../../../../config/esp32/third_party/connectedhomeip/src/lib/support/CodeUtils.h:518
 (inlined by) chip::Platform::Internal::AssertChipStackLockedByCurrentThread(char const*, int) at /home/karlp/src/esp/esp-matter/connectedhomeip/connectedhomeip/examples/lock-app/esp32/build/esp-idf/chip/../../../../../../config/esp32/third_party/connectedhomeip/src/platform/LockTracker.cpp:36



Backtrace: 0x40081e9a:0x3ffe8f20 0x40091ad9:0x3ffe8f40 0x40097fde:0x3ffe8f60 0x40121d8b:0x3ffe8fd0 0x40122873:0x3ffe8ff0 0x400e7f8d:0x3ffe9030 0x400edc29:0x3ffe9050 0x400e8381:0x3ffe9070 0x400e83f9:0x3ffe9090 0x40094cfd:0x3ffe90c0
0x40081e9a: panic_abort at /home/karlp/src/esp/esp-idf/components/esp_system/panic.c:423

0x40091ad9: esp_system_abort at /home/karlp/src/esp/esp-idf/components/esp_system/esp_system.c:153

0x40097fde: abort at /home/karlp/src/esp/esp-idf/components/newlib/abort.c:38

0x40121d8b: chip::Platform::Internal::AssertChipStackLockedByCurrentThread(char const*, int) at /home/karlp/src/esp/esp-matter/connectedhomeip/connectedhomeip/examples/lock-app/esp32/build/esp-idf/chip/../../../../../../config/esp32/third_party/connectedhomeip/src/lib/support/CodeUtils.h:508
 (inlined by) chipDie at /home/karlp/src/esp/esp-matter/connectedhomeip/connectedhomeip/examples/lock-app/esp32/build/esp-idf/chip/../../../../../../config/esp32/third_party/connectedhomeip/src/lib/support/CodeUtils.h:518
 (inlined by) chip::Platform::Internal::AssertChipStackLockedByCurrentThread(char const*, int) at /home/karlp/src/esp/esp-matter/connectedhomeip/connectedhomeip/examples/lock-app/esp32/build/esp-idf/chip/../../../../../../config/esp32/third_party/connectedhomeip/src/platform/LockTracker.cpp:36

0x40122873: chip::System::LayerImplFreeRTOS::ScheduleWork(void (*)(chip::System::Layer*, void*), void*) at /home/karlp/src/esp/esp-matter/connectedhomeip/connectedhomeip/examples/lock-app/esp32/build/esp-idf/chip/../../../../../../config/esp32/third_party/connectedhomeip/src/system/SystemLayerImplFreeRTOS.cpp:94

0x400e7f8d: AppTask::ActionCompleted(BoltLockManager::Action_t) at /home/karlp/src/esp/esp-matter/connectedhomeip/connectedhomeip/examples/lock-app/esp32/main/AppTask.cpp:427

0x400edc29: BoltLockManager::ActuatorMovementTimerEventHandler(AppEvent*) at /home/karlp/src/esp/esp-matter/connectedhomeip/connectedhomeip/examples/lock-app/esp32/third_party/connectedhomeip/examples/platform/esp32/lock/BoltLockManager.cpp:324

0x400e8381: AppTask::DispatchEvent(AppEvent*) at /home/karlp/src/esp/esp-matter/connectedhomeip/connectedhomeip/examples/lock-app/esp32/main/AppTask.cpp:457

0x400e83f9: AppTask::AppTaskMain(void*) at /home/karlp/src/esp/esp-matter/connectedhomeip/connectedhomeip/examples/lock-app/esp32/main/AppTask.cpp:129

0x40094cfd: vPortTaskWrapper at /home/karlp/src/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:154

I'm on the v1.1-branch rev c95efa9 plus two backports: #27270 and #26792

@karlp
Copy link
Contributor

karlp commented Jun 28, 2023

Ok I've got a fix for this I believe. My commit #27270 was developed and tested on the matter 1.0 branch, and the code was identical in the master/1.1 branches, and obviously missing, so was jsut committed there. However, the lock checking must have been added later, which then breaks it again. I'll make a new PR tomorrow for this. It's quite disconcerting just how different all the different AppTask.cpp files are given that they are all meant to be ~equivalent. I suspect many of the other lock examples are probably also crashing on this on other platforms...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] [ESP32C3][lock-app] kernel panic
5 participants