Skip to content

Conversation

@benediktibk
Copy link
Contributor

Check if the calculated package length exceeds the maximum possible value and cap it.
Fixes #75015

Check if the calculated package length exceeds the maximum possible
value.
Fixes zephyrproject-rtos#75015

Signed-off-by: Benedikt Schmidt <[email protected]>
@benediktibk benediktibk force-pushed the fix_long_log_strings branch from 83fe779 to 6437e7f Compare June 26, 2024 10:43
@benediktibk
Copy link
Contributor Author

Looking promising with this change:

[00:00:00.000,000] <inf> main: logging 1 bytes
0
[00:00:02.001,000] <inf> main: logging 2 bytes
01
[00:00:04.002,000] <inf> main: logging 4 bytes
0123
[00:00:06.002,000] <inf> main: logging 8 bytes
01234567
[00:00:08.003,000] <inf> main: logging 16 bytes
0123456789012345
[00:00:10.003,000] <inf> main: logging 32 bytes
01234567890123456789012345678901
[00:00:12.004,000] <inf> main: logging 64 bytes
0123456789012345678901234567890123456789012345678901234567890123
[00:00:14.005,000] <inf> main: logging 128 bytes
01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
[00:00:16.005,000] <inf> main: logging 256 bytes
0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345
[00:00:18.006,000] <inf> main: logging 512 bytes
01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901
[00:00:20.007,000] <inf> main: logging 1024 bytes
0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123
[00:00:22.008,000] <inf> main: logging 2048 bytes
[00:00:22.008,000] <wrn> log: Message dropped because it exceeds size limitation (2047)
[00:00:24.009,000] <inf> main: logging 4096 bytes
[00:00:24.009,000] <wrn> log: Message dropped because it exceeds size limitation (2047)
[00:00:26.011,000] <inf> main: logging 8192 bytes
[00:00:26.011,000] <wrn> log: Message dropped because it exceeds size limitation (2047)
[00:00:28.014,000] <inf> main: logging 16384 bytes
[00:00:28.014,000] <wrn> log: Message dropped because it exceeds size limitation (2047)
[00:00:30.019,000] <inf> main: logging 32768 bytes
[00:00:30.019,000] <wrn> log: Message dropped because it exceeds size limitation (2047)
[00:00:32.020,000] <inf> main: logging 1 bytes
0
[00:00:34.020,000] <inf> main: logging 2 bytes
01
[00:00:36.021,000] <inf> main: logging 4 bytes
0123

@benediktibk benediktibk requested a review from nordic-krch June 26, 2024 11:34
@nashif nashif added this to the v3.7.0 milestone Jun 27, 2024
@aescolar aescolar merged commit bc4743f into zephyrproject-rtos:main Jun 28, 2024
@benediktibk benediktibk deleted the fix_long_log_strings branch August 20, 2024 09:08
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.

Logging long strings via printk kills the logging

6 participants