Repository navigation
Fix various memory correctness issues - #456
Merged
Merged
Conversation
Read one byte less than the buffer size to guarantee space for the null terminator. If esp_http_client_read returns exactly 2048 bytes, buf[read_len] = 0 writes one byte past the allocation. Reported-by: Claude Opus 4.6 <noreply@anthropic.com> Fixes: e102adf ("test2: feed audio to HTTP API")
The WebSocket event callback runs in the WebSocket client task rather than an interrupt context. It performs substantial JSON, UI, and storage processing and has no demonstrated requirement to reside in IRAM. Allow the callback to use normal application code placement and avoid unnecessarily consuming internal instruction memory. This reverts commit 7e0ba91. Reported-by: Claude Opus 4.6 <noreply@anthropic.com>
audio_element_set_event_callback() expects an audio_element_handle_t, but the playback callback was passed the esp_audio_handle_t. Treating the ESP Audio controller as an audio element corrupted unrelated controller memory, including its volume configuration. Passing the playback HTTP element instead would avoid that corruption, but would not make the callback usable. ESP Audio owns the element, temporarily replaces its single event callback while probing the codec, and then clears it. Callback delivery would also bypass the listener ESP Audio uses to manage pipeline events. The playback callback therefore cannot provide the intended error handling. Remove its registration and leave the independent callback on the standalone STT HTTP element unchanged. Reported-by: GPT-5.6-sol Fixes: 86353e1 ("audio: add callback for HTTP stream audio element")
The IP event handler remains registered after the initial connection and uses hdl_evg for every GOT_IP event. Deleting the event group after the first connection leaves the handler with a stale handle on later reconnections. Keep the event group alive for the lifetime of the registered handler. Reported-by: GPT-5.6-sol Fixes: eb812b4 ("network: nuke periph_wifi")
stintel
force-pushed
the
fix/memory_issues
branch
from
July 20, 2026 08:10
d33c17a to
1981376
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.
These issues were uncovered during an LLM-assisted code audit. See individual commit messages for details.
Torture test results: 1000/1000.