1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-07 07:55:04 -05:00

#1092 Fixed crash if use wrong affinity on NUMA systems.

This commit is contained in:
XMRig
2019-08-05 21:55:52 +07:00
parent 4afc987111
commit 66d8598f9f

View File

@@ -62,9 +62,11 @@ uint32_t xmrig::VirtualMemory::bindToNUMANode(int64_t affinity)
LOG_WARN("CPU #%02u warning: \"can't bind memory\"", puId);
}
hwloc_obj_t node = nullptr;
uint32_t nodeId = 0;
if (pu) {
hwloc_obj_t node = nullptr;
while ((node = hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_NUMANODE, node)) != nullptr) {
if (hwloc_bitmap_intersects(node->cpuset, pu->cpuset)) {
nodeId = node->os_index;
@@ -72,6 +74,7 @@ uint32_t xmrig::VirtualMemory::bindToNUMANode(int64_t affinity)
break;
}
}
}
hwloc_topology_destroy(topology);