[ZBX-15607] Zombie processes can occur when signalling agent during metric execution Created: 2019 Feb 06  Updated: 2024 Apr 10  Resolved: 2019 Mar 02

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G)
Affects Version/s: 3.0.25, 4.0.4, 4.2.0alpha3
Fix Version/s: 4.0.6rc1, 4.2.0beta2, 4.2 (plan)

Type: Problem report Priority: Trivial
Reporter: Vladislavs Sokurenko Assignee: Andrejs Kozlovs
Resolution: Fixed Votes: 0
Labels: zombie
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Team: Team A
Sprint: Sprint 49 (Feb 2019)
Story Points: 0.5

 Description   

Following patch to reproduce the issue which is otherwise hard to catch

Index: src/libs/zbxsysinfo/sysinfo.c
===================================================================
--- src/libs/zbxsysinfo/sysinfo.c	(revision 89520)
+++ src/libs/zbxsysinfo/sysinfo.c	(working copy)
@@ -1273,6 +1273,7 @@
 
 		ret = write_all(fds[1], data, data_offset);
 
+		sleep(30);
 		zbx_free(data);
 		free_result(result);

Send signal when metric is being executed:

./sbin/zabbix_agentd -R log_level_decrease

Result(from several times):

  75016 pts/1    S+     0:00 ./sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf --foreground
  75017 pts/1    S+     0:00 ./sbin/zabbix_agentd: collector [idle 1 sec]
  75018 pts/1    S+     0:00 ./sbin/zabbix_agentd: listener #1 [waiting for connection]
  75019 pts/1    S+     0:00 ./sbin/zabbix_agentd: listener #2 [waiting for connection]
  75020 pts/1    S+     0:00 ./sbin/zabbix_agentd: listener #3 [waiting for connection]
  75021 pts/1    S+     0:00 ./sbin/zabbix_agentd: active checks #1 [idle 1 sec]
  75033 pts/1    Z+     0:00 [zabbix_agentd] <defunct>
  75151 pts/1    Z+     0:00 [zabbix_agentd] <defunct>
  75315 pts/1    Z+     0:00 [zabbix_agentd] <defunct>
  75705 pts/1    Z+     0:00 [zabbix_agentd] <defunct>
  75992 pts/1    Z+     0:00 [zabbix_agentd] <defunct>
  76065 pts/1    S+     0:00 ./sbin/zabbix_agentd: listener #3 [processing request]
  76238 pts/2    S+     0:00 grep --color=auto zabbix_agentd
==65293==    at 0x445C3E: zbx_execute_threaded_metric (sysinfo.c:1326)
==65293==    by 0x466132: VFS_FS_SIZE (diskspace.c:124)
==65293==    by 0x440921: process (sysinfo.c:632)
==65293==    by 0x435D9A: process_listener (listener.c:57)
==65293==    by 0x43641B: listener_thread (listener.c:145)
==65293==    by 0x49D7AE: zbx_thread_start (threads.c:132)
==65293==    by 0x411A0C: MAIN_ZABBIX_ENTRY (zabbix_agentd.c:1046)
==65293==    by 0x4A0039: daemon_start (daemon.c:392)
==65293==    by 0x411F7E: main (zabbix_agentd.c:1270)
==65293==  Uninitialised value was created by a stack allocation
==65293==    at 0x4451E3: zbx_execute_threaded_metric (sysinfo.c:1234)
==65293== 
==65293== Conditional jump or move depends on uninitialised value(s)
==65293==    at 0x445DA2: zbx_execute_threaded_metric (sysinfo.c:1333)
==65293==    by 0x466132: VFS_FS_SIZE (diskspace.c:124)
==65293==    by 0x440921: process (sysinfo.c:632)
==65293==    by 0x435D9A: process_listener (listener.c:57)
==65293==    by 0x43641B: listener_thread (listener.c:145)
==65293==    by 0x49D7AE: zbx_thread_start (threads.c:132)
==65293==    by 0x411A0C: MAIN_ZABBIX_ENTRY (zabbix_agentd.c:1046)
==65293==    by 0x4A0039: daemon_start (daemon.c:392)
==65293==    by 0x411F7E: main (zabbix_agentd.c:1270)
==65293==  Uninitialised value was created by a stack allocation
==65293==    at 0x4451E3: zbx_execute_threaded_metric (sysinfo.c:1234)

Expected:
No zombie



 Comments   
Comment by Andrejs Kozlovs [ 2019 Feb 28 ]

Fixed in:

  • pre-4.0.6rc1 90392
  • pre-4.2.0beta2 (trunk) 90393
Generated at Sat Apr 27 01:13:04 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.