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

[Tizen] Do not log BLE binary data using "%s" #25768

Merged
merged 3 commits into from
Mar 21, 2023

Conversation

arkq
Copy link
Contributor

@arkq arkq commented Mar 21, 2023

Problem

Logging binary data with "%.*s" might lead to terminal (or Tizen logging service) corruption.

Changes

  • log binary data using dedicated ChipLogByteSpan function
  • improve readability of app preference logging

Testing

Tested locally:

I/CHIP    (  852): DL: Gatt write requested on Characteristic: uuid=18EE2EF5-263D-4559-959F-4F9C429F9D11 len=23
D/CHIP    (  852): DL: 0x09, 0x00, 0x00, 0x4f, 0x00, 0x04, 0x00, 0x00,
...

@github-actions
Copy link

PR #25768: Size comparison from 934a6b1 to 2a0dcc8

Increases (1 build for cc32xx)
platform target config section 934a6b1 2a0dcc8 change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_info 20248022 20248023 1 0.0
Full report (1 build for cc32xx)
platform target config section 934a6b1 2a0dcc8 change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 645601 645601 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 930292 930292 0 0.0
.debug_aranges 87400 87400 0 0.0
.debug_frame 300320 300320 0 0.0
.debug_info 20248022 20248023 1 0.0
.debug_line 2661345 2661345 0 0.0
.debug_loc 2805489 2805489 0 0.0
.debug_ranges 283264 283264 0 0.0
.debug_str 3027174 3027174 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 105993 105993 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 380421 380421 0 0.0
.symtab 257408 257408 0 0.0
.text 537488 537488 0 0.0

@arkq arkq force-pushed the tizen-bin-logging branch from 2a0dcc8 to 932a121 Compare March 21, 2023 17:16
src/platform/Tizen/BLEManagerImpl.cpp Outdated Show resolved Hide resolved
@github-actions
Copy link

PR #25768: Size comparison from 934a6b1 to 932a121

Full report (1 build for cc32xx)
platform target config section 934a6b1 932a121 change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 645601 645601 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 930292 930292 0 0.0
.debug_aranges 87400 87400 0 0.0
.debug_frame 300320 300320 0 0.0
.debug_info 20248022 20248022 0 0.0
.debug_line 2661345 2661345 0 0.0
.debug_loc 2805489 2805489 0 0.0
.debug_ranges 283264 283264 0 0.0
.debug_str 3027174 3027174 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 105993 105993 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 380421 380421 0 0.0
.symtab 257408 257408 0 0.0
.text 537488 537488 0 0.0

@arkq arkq force-pushed the tizen-bin-logging branch from a4ac56c to 894335c Compare March 21, 2023 17:51
@github-actions
Copy link

PR #25768: Size comparison from 5a0811e to 894335c

Increases (1 build for cc32xx)
platform target config section 5a0811e 894335c change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_info 20248021 20248022 1 0.0
Full report (1 build for cc32xx)
platform target config section 5a0811e 894335c change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 645601 645601 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 930292 930292 0 0.0
.debug_aranges 87400 87400 0 0.0
.debug_frame 300320 300320 0 0.0
.debug_info 20248021 20248022 1 0.0
.debug_line 2661345 2661345 0 0.0
.debug_loc 2805489 2805489 0 0.0
.debug_ranges 283264 283264 0 0.0
.debug_str 3027174 3027174 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 105993 105993 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 380421 380421 0 0.0
.symtab 257408 257408 0 0.0
.text 537488 537488 0 0.0

@andy31415 andy31415 enabled auto-merge (squash) March 21, 2023 18:37
@andy31415 andy31415 merged commit 2a9fa2a into project-chip:master Mar 21, 2023
@arkq arkq deleted the tizen-bin-logging branch March 21, 2023 20:01
lecndav pushed a commit to lecndav/connectedhomeip that referenced this pull request Mar 22, 2023
* Do not print binary data using "%s"

* Improve readability of app preference logging format

* Use Uint8:: helpers instead of reinterpret_cast
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants