You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
F-31: JMRI heartbeat task deleted from outside, possibly mid-send #34
Severity: MEDIUM · Effort: Small · Batch: 2 · Status: Code done in #21 (68452a5), awaiting bench verification
Found in the second full review of the firmware. Recorded with the rest of the pass (F-19…F-44) in docs/REVIEW_REMEDIATION_PLAN_2.md, which is where its status is kept.
Description
JmriJsonClient::stopHeartbeat calls vTaskDelete on a task that may be inside esp_websocket_client_send_text, holding the client's lock — the F-02 shape again. It is
called from both the WebSocket task and disconnect() with an unguarded handle, so the same
handle can be deleted twice. The task's stack is 2 KB with ESP_LOG in its path.
Plan
Cooperative shutdown with an exit signal, as F-02 did for the WiThrottle receive task, and a
3 KB stack pending F-33's measurement.
Acceptance Criteria
The task is woken to exit by a notification, signals, and suspends itself; stopHeartbeat() deletes it only after that signal, under a mutex that also guards startHeartbeat().
Stack raised to 3 KB.
Bench: repeated JMRI JSON connect/disconnect (twenty cycles) with no hang and no heap
growth.
Activity