File 0923-If-avail-CPUs-is-0-then-clamp-to-online-CPUs-to-avoi.patch of Package erlang
From 15d3cebe110b04341a1ddcfda9d201a34b81c8db Mon Sep 17 00:00:00 2001
From: Calvin Buckley <calvin@cmpct.info>
Date: Sat, 16 May 2020 22:43:26 +0000
Subject: [PATCH 07/11] If avail CPUs is 0, then clamp to online CPUs to avoid
returning errors
Causes a weird issue in the scheduler otherwise.
---
erts/lib_src/common/erl_misc_utils.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/erts/lib_src/common/erl_misc_utils.c b/erts/lib_src/common/erl_misc_utils.c
index 986eff46b0..37394220f2 100644
--- a/erts/lib_src/common/erl_misc_utils.c
+++ b/erts/lib_src/common/erl_misc_utils.c
@@ -410,6 +410,8 @@ erts_cpu_info_update(erts_cpu_info_t *cpuinfo)
if (available > online)
available = online;
+ else if (available == 0) /* shouldn't happen */
+ available = online;
if (cpuinfo->available != available)
changed = 1;
--
2.26.2