Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in ASIO shutdown #4548

Merged
merged 2 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .release-notes/4548.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Fix bug in ASIO shutdown

There was a bug during our shutdown process that could cause a segmentation fault coming from our asynchrnous I/O subsystem. This has been fixed.
7 changes: 6 additions & 1 deletion src/libponyrt/asio/asio.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,12 @@ bool ponyint_asio_stop()
SYSTEMATIC_TESTING_YIELD();
#endif

ponyint_thread_join(running_base.tid);
// If we weren't able to wait on the asio
// thread until termination, return false
// Otherwise, we are probably setting a running
// backend to NULL and hilarity will ensue
if(!ponyint_thread_join(running_base.tid))
return false;

#if defined(USE_SCHEDULER_SCALING_PTHREADS)
#if defined(USE_SYSTEMATIC_TESTING)
Expand Down
Loading