From fedec3006b0011b6cd131d3c5e59123635c4454e Mon Sep 17 00:00:00 2001 From: "Sean T. Allen" Date: Mon, 25 Nov 2024 13:33:03 +0000 Subject: [PATCH 1/2] Fix bug in ASIO shutdown Prior to this commit, when shutting down the ASIO subsystem, we ignored the result of our waiting to join on the ASIO thread's termination. By ignoring the result, in cases where the join failed, we would continue doing ASIO shutdown related activities while the ASIO system was still running. This was "not good". --- src/libponyrt/asio/asio.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libponyrt/asio/asio.c b/src/libponyrt/asio/asio.c index 08c0059194..1d79b420e9 100644 --- a/src/libponyrt/asio/asio.c +++ b/src/libponyrt/asio/asio.c @@ -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) From 946bcbf088820224a0c0ecc69b1fea9dfbbd047f Mon Sep 17 00:00:00 2001 From: "Sean T. Allen" Date: Mon, 25 Nov 2024 13:38:33 +0000 Subject: [PATCH 2/2] Add release notes --- .release-notes/4548.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .release-notes/4548.md diff --git a/.release-notes/4548.md b/.release-notes/4548.md new file mode 100644 index 0000000000..21f3c23ad2 --- /dev/null +++ b/.release-notes/4548.md @@ -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.