File 1287-Fix-handling-asynchronous-port-close.patch of Package erlang
From cf7b6f6cf0bad818da4ba87a80424b4134b0cde4 Mon Sep 17 00:00:00 2001
From: Rickard Green <rickard@erlang.org>
Date: Wed, 29 Sep 2021 14:03:47 +0200
Subject: [PATCH] Fix handling asynchronous port close
Sending a "Port ! {PortOwner, close}" signal from a process other than
the port owner could erroneously trigger a badsig exit signal being
sent to the port owner process even though the correct PortOwner had
been passed in the signal.
---
erts/emulator/beam/io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c
index d7fa2f2696..5f81449eab 100644
--- a/erts/emulator/beam/io.c
+++ b/erts/emulator/beam/io.c
@@ -2271,7 +2271,7 @@ erts_port_exit(Process *c_p,
switch (try_imm_drv_call(&try_call_state)) {
case ERTS_TRY_IMM_DRV_CALL_OK: {
res = call_deliver_port_exit(flags & ERTS_PORT_SIG_FLG_BANG_OP,
- c_p ? c_p->common.id : from,
+ from,
prt,
try_call_state.state,
reason,
--
2.31.1