From ca6534d2025dd37220b9775eea3fd0c5ccaa5afe Mon Sep 17 00:00:00 2001 From: Stefan Seifert Date: Fri, 17 Apr 2020 13:34:33 +0200 Subject: [PATCH] Fix deadlock when trying to report an unsupported NativeCall return type --- src/core/nativecall_dyncall.c | 1 + src/core/nativecall_libffi.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/core/nativecall_dyncall.c b/src/core/nativecall_dyncall.c index 6b7c2cb9d5..b0e5b35358 100644 --- a/src/core/nativecall_dyncall.c +++ b/src/core/nativecall_dyncall.c @@ -725,6 +725,7 @@ MVMObject * MVM_nativecall_invoke(MVMThreadContext *tc, MVMObject *res_type, break; } default: + MVM_gc_mark_thread_unblocked(tc); MVM_telemetry_interval_stop(tc, interval_id, "nativecall invoke failed"); MVM_exception_throw_adhoc(tc, "Internal error: unhandled dyncall return type"); } diff --git a/src/core/nativecall_libffi.c b/src/core/nativecall_libffi.c index 1cacf7abbc..9bc4326de6 100644 --- a/src/core/nativecall_libffi.c +++ b/src/core/nativecall_libffi.c @@ -689,6 +689,7 @@ MVMObject * MVM_nativecall_invoke(MVMThreadContext *tc, MVMObject *res_type, handle_ret(tc, unsigned long long, ffi_arg, MVM_nativecall_make_int); break; default: + MVM_gc_mark_thread_unblocked(tc); MVM_telemetry_interval_stop(tc, interval_id, "nativecall invoke failed"); MVM_exception_throw_adhoc(tc, "Internal error: unhandled libffi return type"); }