Repository navigation
Runtime fixes 4/5: Protect string-pool IDs and concurrent access - #434
Merged
Merged
Conversation
This was referenced Oct 31, 2026
guido4096
marked this pull request as ready for review
October 31, 2026 19:31
Bound IDs and string lengths, synchronize access, and retain existing IDs at capacity. Cover exhaustion and concurrent access.
guido4096
force-pushed
the
fix/runtime-string-pool
branch
from
October 31, 2026 20:07
554624e to
c9b36c6
Compare
yuhu-
approved these changes
Nov 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding a 256th string could wrap the pool's 8-bit entry counter and invalidate previously issued IDs. Insertion and lookup were also unsynchronized across tasks, and strings longer than the 8-bit length representation were not rejected.
Limit the pool to 255 addressable entries, reject strings longer than 255 bytes, and synchronize insertion/lookup. Existing strings remain accessible when entry or byte capacity is exhausted; further new strings return ID 0.
Validation
Regressions cover entry exhaustion, byte exhaustion, oversized names, preservation of existing IDs and concurrent interning without duplicate IDs.
Device check before marking ready
Verify normal command/MQTT operation under concurrent use and sustained operation. The tests establish the covered capacity and concurrency behavior; they do not establish on-device timing or measured performance improvements.
Related runtime fixes
Part 4/5 of the single-commit replacements for #430, split at the maintainer's request. Every PR targets master directly and contains only its corresponding change.
Suggested merge order: the host-test mock fix first, then the other four changes independently. The five patches together reconstruct the exact tracked file tree of #430.
Source commit in #430: d8a436e.