Ad Widget

Collapse

zabbix_sender (6.0.0~6.0.2) exits w/o releasing semaphore on FreeBSD 13.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tomohide
    Junior Member
    • Sep 2021
    • 4

    #1

    zabbix_sender (6.0.0~6.0.2) exits w/o releasing semaphore on FreeBSD 13.0

    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.
    • 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
    HAVE_PTHREAD_PROCESS_SHARED appears only at finalizing, and zabbix_sender.c uses zabbix_locks_create() and zabbix_locks_disable().

    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?
    Attached Files
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    It would be better to report here https://support.zabbix.com/projects/ZBX/

    Comment

    • Tomohide
      Junior Member
      • Sep 2021
      • 4

      #3
      Thank you for your suggestion.
      I'm going to the issue and patch to the URL above.

      Comment

      Working...