Zabbix_sender in Zabbix 6 exits without releasing the semaphore it used on my FreeBSD 13.0 system.
I checked the phenomenon with 'ipcs -s'.
Zabbix_sender in Zabbix 5.4.11 or below exits normally after releasing the semaphore it used.
I experienced the same situation on my Gentoo Linux system too.
But, zabbix_sender in Zabbix 6 exit with no problem on my Fedora 35, Ubuntu 20.04, Debian 11 or Arch Linux system.
I found the Asymmetric usage of zbx_locks_* in zabbix_sender.c.
In mutex.h, zbx_locks_enable() seems to be paired with zbx_locks_disable(), and zbx_locks_create() seems to be paired with zbx_locks_destroy().
So, I changed the zabbix_sender.c like the appended patch, and patched zabbix_sender just exits normally after releasing the semaphore it used
on my FreeBSD 13.0 system.
Does anyone experience semaphore issues on zabbix_sender?
I checked the phenomenon with 'ipcs -s'.
Zabbix_sender in Zabbix 5.4.11 or below exits normally after releasing the semaphore it used.
I experienced the same situation on my Gentoo Linux system too.
But, zabbix_sender in Zabbix 6 exit with no problem on my Fedora 35, Ubuntu 20.04, Debian 11 or Arch Linux system.
I found the Asymmetric usage of zbx_locks_* in zabbix_sender.c.
- Initializing locks uses zbx_locks_create(&error) #ifndef _WINDOWS on l.1508 and l.1509
- Finalizing locks uses zbx_locks_disable() #if !defined(_WINDOWS) && defined(HAVE_PTHREAD_PROCESS_SHARED) on l.1868 and l.1869
In mutex.h, zbx_locks_enable() seems to be paired with zbx_locks_disable(), and zbx_locks_create() seems to be paired with zbx_locks_destroy().
So, I changed the zabbix_sender.c like the appended patch, and patched zabbix_sender just exits normally after releasing the semaphore it used
on my FreeBSD 13.0 system.
Does anyone experience semaphore issues on zabbix_sender?
Comment