From 45036071684919555e32f81a3f94cd38e06b6c66 Mon Sep 17 00:00:00 2001 From: Matthieu Garrigues Date: Fri, 31 Jul 2026 15:21:22 +0200 Subject: [PATCH 1/2] Upgrade vcpkg submodule to 2026.06.24 Verified manifest install (boost-context, boost-lexical-cast, curl, libmariadb, libpq, openssl, sqlite3) builds cleanly on x64-osx. Co-Authored-By: Claude Sonnet 5 --- vcpkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcpkg b/vcpkg index c2a21b7..cd61e1e 160000 --- a/vcpkg +++ b/vcpkg @@ -1 +1 @@ -Subproject commit c2a21b787cc505d5960d0292d30fd14306b07dd4 +Subproject commit cd61e1e26a038e82d6550a3ebbe0fbbfe7da78e3 From 4edca8e5f9bc92dd6c6bd9b2c04429c5f9c5db4a Mon Sep 17 00:00:00 2001 From: Matthieu Garrigues Date: Fri, 31 Jul 2026 15:35:23 +0200 Subject: [PATCH 2/2] Fix fiber_exception handling --- .gitignore | 1 + libraries/http_server/http_server/http_ctx.hh | 9 ++++++++- single_headers/lithium.hh | 9 ++++++++- single_headers/lithium_http_server.hh | 9 ++++++++- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 214e176..0029459 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ test_install builds build-linux vcpkg_installed +.DS_Store diff --git a/libraries/http_server/http_server/http_ctx.hh b/libraries/http_server/http_server/http_ctx.hh index a233e8a..e5e1826 100644 --- a/libraries/http_server/http_server/http_ctx.hh +++ b/libraries/http_server/http_server/http_ctx.hh @@ -816,7 +816,14 @@ template auto make_http_processor(F handler) { ctx.flush_responses(); } } -catch (const std::runtime_error& e) { +catch (fiber_exception&) { + // Used internally (e.g. idle timeout, EPOLLRDHUP) to unwind the fiber via + // boost::context's exception-forwarding protocol. Must propagate to the + // callcc entry point in tcp_server.hh, which returns the continuation + // carried by the exception. Swallowing it here leaves boost::context's + // bookkeeping inconsistent and later crashes with a forced_unwind. + throw; +} catch (const std::runtime_error& e) { std::cerr << "Error: " << e.what() << std::endl; return; } catch (...) { diff --git a/single_headers/lithium.hh b/single_headers/lithium.hh index 5bcfaa8..1e8b3a0 100644 --- a/single_headers/lithium.hh +++ b/single_headers/lithium.hh @@ -10415,7 +10415,14 @@ template auto make_http_processor(F handler) { ctx.flush_responses(); } } -catch (const std::runtime_error& e) { +catch (fiber_exception&) { + // Used internally (e.g. idle timeout, EPOLLRDHUP) to unwind the fiber via + // boost::context's exception-forwarding protocol. Must propagate to the + // callcc entry point in tcp_server.hh, which returns the continuation + // carried by the exception. Swallowing it here leaves boost::context's + // bookkeeping inconsistent and later crashes with a forced_unwind. + throw; +} catch (const std::runtime_error& e) { std::cerr << "Error: " << e.what() << std::endl; return; } catch (...) { diff --git a/single_headers/lithium_http_server.hh b/single_headers/lithium_http_server.hh index 5d7acc3..ddb7ef7 100644 --- a/single_headers/lithium_http_server.hh +++ b/single_headers/lithium_http_server.hh @@ -7206,7 +7206,14 @@ template auto make_http_processor(F handler) { ctx.flush_responses(); } } -catch (const std::runtime_error& e) { +catch (fiber_exception&) { + // Used internally (e.g. idle timeout, EPOLLRDHUP) to unwind the fiber via + // boost::context's exception-forwarding protocol. Must propagate to the + // callcc entry point in tcp_server.hh, which returns the continuation + // carried by the exception. Swallowing it here leaves boost::context's + // bookkeeping inconsistent and later crashes with a forced_unwind. + throw; +} catch (const std::runtime_error& e) { std::cerr << "Error: " << e.what() << std::endl; return; } catch (...) {