From 013cbc3d96256906bafe16c0952260c2f0c31f49 Mon Sep 17 00:00:00 2001 From: Nuno Alves Date: Fri, 5 Dec 2025 12:59:04 +0000 Subject: [PATCH 1/2] analyzer/linux: Fix get_proc_status parsing When parsing the `/proc//status` file some field are empty which made the dict() conversion fail because the list length was 1. With this change, we are spliting on the ":" character and striping the key and the value so we can get the key without the ":" at the end and the value without any "\t" at the beginning or "\n" at the end. --- analyzer/linux/lib/api/process.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/analyzer/linux/lib/api/process.py b/analyzer/linux/lib/api/process.py index ba20ef05341..9e0c546cf83 100644 --- a/analyzer/linux/lib/api/process.py +++ b/analyzer/linux/lib/api/process.py @@ -25,7 +25,7 @@ def is_alive(self): status = self.get_proc_status() if not status: return False - if "zombie" in status.get("State:", ""): + if "zombie" in status.get("State", ""): return False return True @@ -36,7 +36,7 @@ def get_proc_status(self): try: with open(f"/proc/{self.pid}/status") as f: status = f.readlines() - status_values = dict([j.strip().split(maxsplit=1) for j in status]) + status_values = dict([tuple(map(str.strip, j.split(':',1))) for j in status]) return status_values except Exception: log.critical("Could not get process status for pid %s", self.pid) From 37bbf9d79c9135e254c23aac8f0fc119ae1c1d9e Mon Sep 17 00:00:00 2001 From: Nuno Alves Date: Fri, 5 Dec 2025 13:55:36 +0000 Subject: [PATCH 2/2] analyzer/linux: convert parent process id (PPid) to int --- analyzer/linux/lib/api/process.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/analyzer/linux/lib/api/process.py b/analyzer/linux/lib/api/process.py index 9e0c546cf83..5a9fea3c3c7 100644 --- a/analyzer/linux/lib/api/process.py +++ b/analyzer/linux/lib/api/process.py @@ -30,7 +30,7 @@ def is_alive(self): return True def get_parent_pid(self): - return self.get_proc_status().get("PPid") + return int(self.get_proc_status().get("PPid")) def get_proc_status(self): try: