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

Improve round-tripping of CHIP_ERROR through NSError. #17194

Conversation

bzbarsky-apple
Copy link
Contributor

We can try to reconstruct the original CHIP_ERROR's error code and
location information from the NSError.

Problem

When following the steps in #16146, which means running

chip-tool-darwin identify identify-query node-id 1 

we end up with output like this:

2022-04-07 22:03:15.429 chip-tool-darwin[77447:22254046] Values: (null)
[1649383395429] [77447:22254046] CHIP: [TOO] Error: ../../../examples/chip-tool-darwin/third_party/connectedhomeip/src/darwin/Framework/CHIP/CHIPError.mm:249: CHIP Error 0x000000AC: Internal error
...
[1649383395429] [77447:22254029] CHIP: [-] ../../../examples/chip-tool-darwin/third_party/connectedhomeip/src/darwin/Framework/CHIP/CHIPError.mm:249: CHIP Error 0x000000AC: Internal error at ../../../examples/chip-tool-darwin/commands/common/CHIPCommandBr
[1649383395429] [77447:22254029] CHIP: [TOO] Run command failure: ../../../examples/chip-tool-darwin/third_party/connectedhomeip/src/darwin/Framework/CHIP/CHIPError.mm:249: CHIP Error 0x000000AC: Internal error

which makes it look like chip-tool-darwin is what failed.

Change overview

Round-trip the CHIP_ERROR information through NSError better, so we get:

2022-04-07 22:36:21.090 chip-tool-darwin[79264:22276498] Values: (null)
[1649385381090] [79264:22276498] CHIP: [TOO] Error: ../../../examples/chip-tool-darwin/third_party/connectedhomeip/src/controller/TypedCommandCallback.h:90: CHIP Error 0x0000008E: Schema mismatch
...
[1649385381091] [79264:22276469] CHIP: [-] ../../../examples/chip-tool-darwin/third_party/connectedhomeip/src/controller/TypedCommandCallback.h:90: CHIP Error 0x0000008E: Schema mismatch at ../../../examples/chip-tool-darwin/commands/common/CHIPCommandBri
[1649385381091] [79264:22276469] CHIP: [TOO] Run command failure: ../../../examples/chip-tool-darwin/third_party/connectedhomeip/src/controller/TypedCommandCallback.h:90: CHIP Error 0x0000008E: Schema mismatch

Testing

See above for steps.

We can try to reconstruct the original CHIP_ERROR's error code and
location information from the NSError.
@github-actions
Copy link

github-actions bot commented Apr 8, 2022

PR #17194: Size comparison from 3992a17 to 9e1608d

Full report (28 builds for cc13x2_26x2, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 3992a17 9e1608d change % change
cc13x2_26x2 lock-ftd LP_CC2652R7 (read only) 674667 674667 0 0.0
(read/write) 176812 176812 0 0.0
.bss 81520 81520 0 0.0
.data 3216 3216 0 0.0
.rodata 80715 80715 0 0.0
.text 593472 593472 0 0.0
lock-mtd LP_CC2652R7 (read only) 623803 623803 0 0.0
(read/write) 154320 154320 0 0.0
.bss 77248 77248 0 0.0
.data 3216 3216 0 0.0
.rodata 80603 80603 0 0.0
.text 542712 542712 0 0.0
pump-app LP_CC2652R7 (read only) 682115 682115 0 0.0
(read/write) 170540 170540 0 0.0
.bss 81928 81928 0 0.0
.data 3248 3248 0 0.0
.rodata 75467 75467 0 0.0
.text 606164 606164 0 0.0
pump-controller-app LP_CC2652R7 (read only) 676451 676451 0 0.0
(read/write) 175932 175932 0 0.0
.bss 81656 81656 0 0.0
.data 3212 3212 0 0.0
.rodata 79243 79243 0 0.0
.text 596724 596724 0 0.0
efr32 lighting-app BRD4161A (read only) 905068 905068 0 0.0
(read/write) 133160 133160 0 0.0
.bss 131120 131120 0 0.0
.data 2040 2040 0 0.0
.text 905060 905060 0 0.0
BRD4161A+rpc (read only) 932956 932956 0 0.0
(read/write) 149108 149108 0 0.0
.bss 146888 146888 0 0.0
.data 2220 2220 0 0.0
.text 932948 932948 0 0.0
window-app BRD4161A (read only) 842348 842348 0 0.0
(read/write) 131228 131228 0 0.0
.bss 129280 129280 0 0.0
.data 1948 1948 0 0.0
.text 842340 842340 0 0.0
esp32 all-clusters-app c3devkit (read only) 991958 991958 0 0.0
(read/write) 1462090 1462090 0 0.0
.dram0.bss 62944 62944 0 0.0
.dram0.data 14364 14364 0 0.0
.flash.rodata 199312 199312 0 0.0
.flash.text 991958 991958 0 0.0
.iram0.text 62572 62572 0 0.0
m5stack (read only) 1044615 1044615 0 0.0
(read/write) 463152 463152 0 0.0
.dram0.bss 68464 68464 0 0.0
.dram0.data 34160 34160 0 0.0
.flash.rodata 228384 228384 0 0.0
.flash.text 1039231 1039231 0 0.0
.iram0.text 123415 123415 0 0.0
k32w light k32w061+release (read/write) 685388 685388 0 0.0
.bss 78208 78208 0 0.0
.data 2036 2036 0 0.0
.text 599344 599344 0 0.0
lock k32w061+release (read/write) 690084 690084 0 0.0
.bss 78784 78784 0 0.0
.data 1996 1996 0 0.0
.text 603504 603504 0 0.0
linux all-clusters-app debug (read only) 2622785 2622785 0 0.0
(read/write) 145640 145640 0 0.0
.bss 57664 57664 0 0.0
.data 1824 1824 0 0.0
.data.rel.ro 80264 80264 0 0.0
.dynamic 592 592 0 0.0
.got 4320 4320 0 0.0
.init 27 27 0 0.0
.init_array 960 960 0 0.0
.rodata 222661 222661 0 0.0
.text 2231250 2231250 0 0.0
bridge-app debug+rpc (read only) 1831485 1831485 0 0.0
(read/write) 91304 91304 0 0.0
.bss 44344 44344 0 0.0
.data 2912 2912 0 0.0
.data.rel.ro 38936 38936 0 0.0
.dynamic 592 592 0 0.0
.got 3936 3936 0 0.0
.init 27 27 0 0.0
.init_array 552 552 0 0.0
.rodata 148505 148505 0 0.0
.text 1565509 1565509 0 0.0
chip-tool debug (read only) 10679061 10679061 0 0.0
(read/write) 371736 371736 0 0.0
.bss 22752 22752 0 0.0
.data 1104 1104 0 0.0
.data.rel.ro 341632 341632 0 0.0
.dynamic 624 624 0 0.0
.got 4928 4928 0 0.0
.init 27 27 0 0.0
.init_array 656 656 0 0.0
.rodata 538389 538389 0 0.0
.text 9311733 9311733 0 0.0
chip-tool-no-interactive-ipv6only arm64 (read only) 10280620 10280620 0 0.0
(read/write) 492145 492145 0 0.0
.bss 41009 41009 0 0.0
.data 1168 1168 0 0.0
.data.rel.ro 388776 388776 0 0.0
.dynamic 560 560 0 0.0
.got 57392 57392 0 0.0
.init 24 24 0 0.0
.init_array 184 184 0 0.0
.rodata 512524 512524 0 0.0
.text 8665060 8665060 0 0.0
door-lock-app debug (read only) 2102577 2102577 0 0.0
(read/write) 119024 119024 0 0.0
.bss 47936 47936 0 0.0
.data 1472 1472 0 0.0
.data.rel.ro 64056 64056 0 0.0
.dynamic 592 592 0 0.0
.got 4264 4264 0 0.0
.init 27 27 0 0.0
.init_array 680 680 0 0.0
.rodata 186537 186537 0 0.0
.text 1761394 1761394 0 0.0
lighting-app debug+rpc (read only) 2305081 2305081 0 0.0
(read/write) 127344 127344 0 0.0
.bss 50144 50144 0 0.0
.data 1952 1952 0 0.0
.data.rel.ro 69544 69544 0 0.0
.dynamic 608 608 0 0.0
.got 4312 4312 0 0.0
.init 27 27 0 0.0
.init_array 776 776 0 0.0
.rodata 181673 181673 0 0.0
.text 1958674 1958674 0 0.0
ota-provider-app debug (read only) 2040321 2040321 0 0.0
(read/write) 114592 114592 0 0.0
.bss 47840 47840 0 0.0
.data 1608 1608 0 0.0
.data.rel.ro 59384 59384 0 0.0
.dynamic 608 608 0 0.0
.got 4464 4464 0 0.0
.init 27 27 0 0.0
.init_array 632 632 0 0.0
.rodata 172451 172451 0 0.0
.text 1712306 1712306 0 0.0
ota-requestor-app debug (read only) 2069673 2069673 0 0.0
(read/write) 117880 117880 0 0.0
.bss 48800 48800 0 0.0
.data 1864 1864 0 0.0
.data.rel.ro 61624 61624 0 0.0
.dynamic 592 592 0 0.0
.got 4304 4304 0 0.0
.init 27 27 0 0.0
.init_array 656 656 0 0.0
.rodata 168876 168876 0 0.0
.text 1743458 1743458 0 0.0
shell debug (read only) 2517601 2517601 0 0.0
(read/write) 149168 149168 0 0.0
.bss 67368 67368 0 0.0
.data 1264 1264 0 0.0
.data.rel.ro 74808 74808 0 0.0
.dynamic 592 592 0 0.0
.got 4168 4168 0 0.0
.init 27 27 0 0.0
.init_array 928 928 0 0.0
.rodata 214290 214290 0 0.0
.text 2143922 2143922 0 0.0
thermostat-no-ble arm64 (read only) 2348588 2348588 0 0.0
(read/write) 150497 150497 0 0.0
.bss 63025 63025 0 0.0
.data 1424 1424 0 0.0
.data.rel.ro 78264 78264 0 0.0
.dynamic 560 560 0 0.0
.got 4768 4768 0 0.0
.init 24 24 0 0.0
.init_array 368 368 0 0.0
.rodata 144652 144652 0 0.0
.text 1976464 1976464 0 0.0
tv-app debug (read only) 2793393 2793393 0 0.0
(read/write) 251096 251096 0 0.0
.bss 165032 165032 0 0.0
.data 4448 4448 0 0.0
.data.rel.ro 75408 75408 0 0.0
.dynamic 592 592 0 0.0
.got 4680 4680 0 0.0
.init 27 27 0 0.0
.init_array 904 904 0 0.0
.rodata 213451 213451 0 0.0
.text 2400226 2400226 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2366996 2366996 0 0.0
.bss 185060 185060 0 0.0
.data 5840 5840 0 0.0
.text 1329596 1329596 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1153663 1153663 0 0.0
bss 135540 135540 0 0.0
rodata 146120 146120 0 0.0
text 793392 793392 0 0.0
p6 all-clusters-app default (read/write) 2512792 2512792 0 0.0
.bss 118464 118464 0 0.0
.data 2768 2768 0 0.0
.text 1471056 1471056 0 0.0
light-app default (read/write) 2413760 2413760 0 0.0
.bss 111960 111960 0 0.0
.data 2576 2576 0 0.0
.text 1372024 1372024 0 0.0
lock-app default (read/write) 2377304 2377304 0 0.0
.bss 111704 111704 0 0.0
.data 2536 2536 0 0.0
.text 1335568 1335568 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 799480 799480 0 0.0
bss 70064 70064 0 0.0
noinit 40416 40416 0 0.0
text 568290 568290 0 0.0

@pullapprove pullapprove bot requested a review from Byungjoo-Lee April 8, 2022 17:39
@bzbarsky-apple bzbarsky-apple merged commit da7eb85 into project-chip:master Apr 8, 2022
@bzbarsky-apple bzbarsky-apple deleted the darwin-error-better-roundtrip branch April 8, 2022 23:15
andrei-menzopol pushed a commit to andrei-menzopol/connectedhomeip that referenced this pull request Apr 14, 2022
…7194)

We can try to reconstruct the original CHIP_ERROR's error code and
location information from the NSError.
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.

3 participants