Runtime crash along exception path for `rpc()` returning non-empty operation_cx::as_future

Issue #522 resolved
Colin MacLean created an issue

Non-empty futures cannot be canceled correctly by cancel_and_delete because a non-empty future cannot be put in a “ready but invalid” state.

diff --git a/test/regression/spec-issue176.cpp b/test/regression/spec-issue176.cpp
index b7f990d..6b3d54d 100644
--- a/test/regression/spec-issue176.cpp
+++ b/test/regression/spec-issue176.cpp
@@ -144,6 +144,9 @@ int main() {
     CHECK("rpc(view(char[toobig]))", 
           auto f = rpc(peer, [](view<char> const &v) {}, big_view););

+    CHECK("rpc(view(char[toobig]) -> int)",
+          auto f = rpc(peer, [](view<char> const &v) { return 0; }, big_view););
+
     CHECK("rpc(view(unbounded))", 
           auto f = rpc(peer, [](view<byte_bag> const &v) {}, unbounded_view););

This causes a failed assert:

in function: void upcxx::detail::future_header_result<T>::readify() [with T = {int}]()

Failed condition: this->base_header.status_ == status_results_yes

Comments (3)

  1. Dan Bonachea

    issue #522: Runtime crash along exception path for rpc() returning non-empty operation_cx::as_future

    Stop attempting to fulfill implicit promises created by operation_cx::as_future() during operation cancellation.

    Fixes issue #522.

    → <<cset 15c83d7914c9>>

  2. Log in to comment