From 94fff0ec8e8a4cd47281a9a1628ddf56e638ca10 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Mon, 8 Apr 2019 12:11:11 +0200 Subject: [socket] Building term with terms from different env (again) When building the (activate next) select message, used terms from different environments, which is not allowed. This was during cancel of one request, we tries to activate next, and then building the select message (with terms from different environments). Arg! Details... OTP-15496 --- erts/emulator/nifs/common/socket_nif.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'erts') diff --git a/erts/emulator/nifs/common/socket_nif.c b/erts/emulator/nifs/common/socket_nif.c index b48f0e05d4..75a3058253 100644 --- a/erts/emulator/nifs/common/socket_nif.c +++ b/erts/emulator/nifs/common/socket_nif.c @@ -17603,9 +17603,10 @@ int esock_select_cancel(ErlNifEnv* env, "\r\n ref: %T" \ "\r\n", reqP->pid, reqP->ref) ); \ \ + /* We need to copy req ref to 'env' */ \ if ((sres = esock_select_##S(env, descP->sock, descP, \ &reqP->pid, sockRef, \ - reqP->ref)) < 0) { \ + CP_TERM(env, reqP->ref))) < 0) { \ \ /* We need to inform this process, reqP->pid, */ \ /* that we failed to select, so we don't leave */ \ -- cgit v1.2.3