Repository navigation
services/vibes: fix history leak and heap diagnostics - #2387
Merged
jplexer merged 2 commits intoOct 13, 2026
Merged
Conversation
gmarull
approved these changes
Oct 12, 2026
Stopping accelerometer history collection during an active pulse left an unfinished entry at the head of the list. Both clear-all and normal pruning stopped there, so future pulses retained history allocations until the kernel heap ran out of space. Clear unfinished entries on shutdown and serialize collection changes and event handling with the history mutex. This also prevents an event from appending after shutdown or dereferencing a concurrently freed head. Cover active-pulse cleanup, bounded growth after restarting, normal pruning, and shutdown immediately before start/end acquire the mutex. The 17 vibration tests pass, as do the related alarm and heap tests. Normal QEMU Emery firmware builds with XS and speaker support enabled. Related: FIRM-4316 The leak is confirmed; its connection to the reported silent alarm remains unproven. Co-authored-by: GPT-6 <noreply@openai.com> Signed-off-by: Joshua Jun <lets@throw.rocks>
The largest-block scan compared each candidate in alignment units against a maximum already expressed in bytes. A larger later free block could therefore be skipped, understating contiguous capacity by up to four times on ARM32. Allocation and coalescing are unaffected. Compare both quantities in bytes. Add a regression with a small free hole before a larger one, then verify complete coalescing on cleanup. All nine allocator tests pass. The regression failed before the fix. Normal QEMU Emery firmware also builds successfully. Related: FIRM-4316 Co-authored-by: GPT-6 <noreply@openai.com> Signed-off-by: Joshua Jun <lets@throw.rocks>
jplexer
force-pushed
the
codex/firm-4316-alarm-vibration
branch
from
October 13, 2026 11:28
7a7cda6 to
3cf19af
Compare
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.
Stopping vibration-history collection during an active pulse can leave an unfinished entry at the head of the list. That entry blocks both clear-all and later pruning, causing retained allocations to grow with subsequent pulses. Clear unfinished entries when collection stops and protect collection transitions and event handling with the history mutex.
Also correct the largest-free-block calculation, which compared alignment units against bytes and could understate contiguous free capacity by up to four times on ARM32. This changes diagnostics; allocation and coalescing are unaffected.
These defects were found while investigating FIRM-4316. This PR is related to that issue, but is not a confirmed fix for its reported silent alarm. The alarm's root cause remains unconfirmed, and this PR should not close the issue.
Evidence for the history leak includes stale unfinished entries in the reporter's older coredump and an actual-service reproduction retaining 1,001 history allocations after 1,000 completed pulses. Regression coverage checks active-pulse cleanup, bounded growth after restarting, normal pruning, and stop/event interleavings. The allocator regression exposes a larger free block being skipped after a smaller hole.
Validation:
git diff --checkpass.