解决CPU核超过248时或numa节点超过16个时可能出现coredump问题,并解决内存操作安全问题

(cherry picked from commit 32abdb5ff544a0e5130c993b2d3bbdf7dafd622d)
This commit is contained in:
heppen 2024-04-03 14:55:56 +08:00 committed by openeuler-sync-bot
parent 05180eca66
commit f966d09f7f
3 changed files with 9 additions and 40 deletions

View File

@ -1,36 +0,0 @@
From cd6bd63738ea2abb5ac953e976fca6d1cfcbd545 Mon Sep 17 00:00:00 2001
From: queyanwen <queyanwen@huawei.com>
Date: Wed, 27 Dec 2023 15:43:28 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E8=A7=A3=E5=86=B3=E9=97=AE=E9=A2=98?=
=?UTF-8?q?=EF=BC=9A=E6=88=B7=E7=AB=AF=E4=B8=BB=E5=8A=A8=E6=96=AD=E9=93=BE?=
=?UTF-8?q?=EF=BC=8C=E6=9C=8D=E5=8A=A1=E7=AB=AF=E9=94=99=E5=8F=AA=E4=BC=9A?=
=?UTF-8?q?=E6=B8=85=E7=90=86index=200=E7=9A=84=E8=B5=84=E6=BA=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pwrapis/src/server.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pwrapis/src/server.c b/pwrapis/src/server.c
index b3f3fa6..1a1767b 100644
--- a/pwrapis/src/server.c
+++ b/pwrapis/src/server.c
@@ -230,10 +230,10 @@ static void AcceptConnection(void)
Logger(INFO, MD_NM_SVR, "Create new connection succeed. fd:%d, sysId:%d", client.fd, client.sysId);
}
-static void CleanClientResource(PwrClient *pwrClient, int idx)
+static void CleanClientResource(PwrClient clients[], int idx)
{
- CleanControlAuth(pwrClient->sysId);
- CleanDataCollTaskByClient(pwrClient->sysId);
+ CleanControlAuth(clients[idx].sysId);
+ CleanDataCollTaskByClient(clients[idx].sysId);
DeleteFromClientList(g_pwrClients, idx);
}
--
Gitee

Binary file not shown.

View File

@ -1,15 +1,14 @@
Name: powerapi Name: powerapi
Version: 1.0.1 Version: 1.0.1
Release: 3 Release: 4
Summary: The ability to support openEuler power consumption control. Summary: The ability to support openEuler power consumption control.
License: MulanPSL-2.0 License: MulanPSL-2.0
URL: https://gitee.com/openeuler/powerapi/ URL: https://gitee.com/openeuler/powerapi/
Source0: %{name}-%{version}.tar.gz Source0: %{name}-%{version}.tar.gz
Patch0: powerapi-0.patch
BuildRequires: gcc,cmake,zip,unzip BuildRequires: gcc,cmake,zip,unzip
Requires: tar Requires: tar,ipmitool
%description %description
Including a power API SO and the Power API Service. Including a power API SO and the Power API Service.
@ -17,7 +16,7 @@ Including a power API SO and the Power API Service.
%package -n powerapi-devel %package -n powerapi-devel
Summary: The ability to support openEuler power consumption control. Summary: The ability to support openEuler power consumption control.
BuildRequires: gcc,cmake,zip,unzip BuildRequires: gcc,cmake,zip,unzip
Requires: tar Requires: tar,ipmitool
%description -n powerapi-devel %description -n powerapi-devel
Contains the client and server components and API header files for powerapi integration development. Contains the client and server components and API header files for powerapi integration development.
@ -69,6 +68,12 @@ systemctl stop pwrapis
%{_sysconfdir}/systemd/system/pwrapis.service %{_sysconfdir}/systemd/system/pwrapis.service
%changelog %changelog
* Wed Apr 3 2024 heppen <hepeng68@huawei.com> - 1.0.1-4
- Add the dependency on ipmitool.
- Fix bug: Coredump when CPU cores number exceed 248 or numa nodes exceed 16.
- Fix some memory bug.
* Sat Mar 9 2024 queyanwen <queyanwen@huawei.com> - 1.0.1-3 * Sat Mar 9 2024 queyanwen <queyanwen@huawei.com> - 1.0.1-3
- Add the dependency on tar that is omitted in the earlier version. - Add the dependency on tar that is omitted in the earlier version.