Skip to content

inlet: fix bad_weak_ptr abort during inlet destruction - #289

Merged
cboulay merged 1 commit into
sccn:devfrom
mscheltienne:fix
Sep 19, 2026
Merged

cboulay merged 1 commit into
sccn:devfrom
mscheltienne:fix

Conversation

@mscheltienne

@mscheltienne mscheltienne commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Fixes the intermittent std::bad_weak_ptr → std::terminate/SIGABRT on inlet destruction reported in #220: resolve_attempt_udp::cancel() calls shared_from_this() on an attempt that has no live shared owner, and the exception skips the watchdog join(), leaving ~inlet_connection to destroy a joinable std::thread. #220 was closed by #246, but #246 only fixes the outlet-side garbage-sample bug (consumer_queue.h / tcp_server.cpp) and never touches the inlet resolver-cancellation path, so the crash still reproduces on current main.

Those changes have been suggested by Claude (Fable) following digging in a CI failure on mne-tools/mne-lsl#565. This changes are outside my expertise and comfort zone, thus up to you to merge or iterate on those changes.

@cboulay
cboulay merged commit 6aac1df into sccn:dev Sep 19, 2026
11 of 14 checks passed
cboulay added a commit that referenced this pull request Sep 19, 2026
… attempt

Follow-up to #289: resolve_attempt_tcp::cancel() has the same shared_from_this()
race as resolve_attempt_udp::cancel() when the io thread drops the last owner
while cancel_all_registered() is running.
@mscheltienne
mscheltienne deleted the fix branch September 28, 2026 15:40
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