Skip to content

Runtime fixes 4/5: Protect string-pool IDs and concurrent access - #434

Merged
guido4096 merged 2 commits into
danielkucera:masterfrom
guido4096:fix/runtime-string-pool
Nov 1, 2026
Merged

guido4096 merged 2 commits into
danielkucera:masterfrom
guido4096:fix/runtime-string-pool

Conversation

@guido4096

@guido4096 guido4096 commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • 172 host tests passed on this standalone branch (macOS, POSIX enabled, original pinned eBUS revision f730dce).
  • Whitespace checks passed. CI and a fresh firmware build for this isolated branch are pending.
  • For the standalone macOS test run, the two mock-file fixes from part 1/5 were applied as temporary, uncommitted test-only overrides. Those files are not included in this PR.

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.

Part Scope PR / branch
1/5 Correct host-test mocks #431
2/5 Bound Logs page retention #432
3/5 Schedule diagnostics by elapsed time #433
4/5 Protect string-pool IDs and concurrent access #434
5/5 Buffer HTTP streams and stop after send failures #435

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.

Bound IDs and string lengths, synchronize access, and retain existing IDs at capacity. Cover exhaustion and concurrent access.
@guido4096
guido4096 force-pushed the fix/runtime-string-pool branch from 554624e to c9b36c6 Compare October 31, 2026 20:07
@guido4096
guido4096 merged commit 75d45f4 into danielkucera:master Nov 1, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants