Steps to reproduce:
- Configure a host running Zabbix Agent 2 for process checks (kernel.maxproc seems a good candidate here)
- Put the host under stress, a large docker installation does the trick for me
Zabbix Agent 2 crashes with runtime error:
The crash occurs reliably on two virtual hosts (VMs) at my provider. I was unable to reproduce it on a Raspberry Pi or on a VM running on a small AMD Geode CPU.
Anyway, the crash output indicates that https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/src/go/plugins/proc/procfs_linux.go#142 still can fail due to empty slice even if f.Readdir(1) did not return an error - which should not happen in any case. I guess it should be sufficient to add a check for an empty entries slice in the if statement on that line and (loop) continue if either empty or !entries.IsDir()