Skip to content

Conversation

@mfncooper
Copy link
Contributor

When a connection attempt via AGWPE had exhausted all retries, Direwolf would crash (segfault) on Linux. This happened because the timer expiry check (dl_timer_expiry) iterates over the state machine list in a way that assumes the list is not modified during iteration. However, recent changes to clean up AGWPE connections violated this assumption, such that a state machine might be removed from the list during iteration. Updating the iterations was missed in those earlier changes.

This change replaces the loop structure with one that allows for the modification of the list during iteration. Currently t1_expiry() is the only case in which the list may be modified; however, t3_expiry() and tm201_expiry() loops have also been changed to insure against possible future modifications.

Fixes #621

When a connection attempt via AGWPE had exhausted all retries, Direwolf
would crash (segfault) on Linux. This happened because the timer expiry
check (dl_timer_expiry) iterates over the state machine list in a way
that assumes the list is not modified during iteration. However, recent
changes to clean up AGWPE connections violated this assumption, such
that a state machine might be removed from the list during iteration.
Updating the iterations was missed in those earlier changes.

This change replaces the loop structure with one that allows for the
modification of the list during iteration. Currently t1_expiry() is
the only case in which the list may be modified; however, t3_expiry()
and tm201_expiry() loops have also been changed to insure against
possible future modifications.

Fixes wb2osz#621
@wb2osz wb2osz merged commit fde612f into wb2osz:dev Nov 10, 2025
7 checks passed
@mfncooper mfncooper deleted the fix_621 branch November 27, 2025 16:28
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