Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-12476

PHP UserParameter hangs under PHP-5.3.3 but not PHP >= 5.4

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Won't fix
    • Icon: Major Major
    • None
    • None
    • Agent (G), Proxy (P), Server (S)
    • CentOS-6.9, three hosts:
      a) Zabbix-2.2.18, PHP-5.3.3
      b) Zabbix-2.4.8, PHP-5.3.3, PHP-5.6.32
      c) Zabbix-3.2.6, PHP-5.6.31

      RHEL-7.3, one host
      a) Zabbix-2.4.8, PHP-5.4.16

      Using simple PHP script as UserParameter,

      UserParameter=local.php.test,php -f /var/tmp/stdout.tester.php
      
      <?php 
         date_default_timezone_set("America/Chicago");
         $count=fwrite(STDOUT,strftime("%c"));
         exit;
      ?>
      

      the test (zabbix_agentd -t local.php.test) hangs under PHP-5.3.3 but works with PHP >=5.4.

      Significant tail-end portion of strace Zabbix-2.1.18/2.4.8, PHP-5.3.3

      alarm(3)                                = 0
      pipe([3, 4])                            = 0
      clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f6ce1aeda90) = 3215
      close(4)                                = 0
      read(3, 0x7ffc3cf7f210, 4095)           = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
      --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_STOPPED, si_pid=3215, si_status=SIGTTOU, si_utime=0, si_stime=0} ---
      read(3, 0x7ffc3cf7f210, 4095)           = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
      --- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL, si_value={int=22, ptr=0x16}} ---
      rt_sigreturn()                          = -1 EINTR (Interrupted system call)
      close(3)                                = 0
      kill(4294964081, SIGTERM)               = 0
      wait4(3215, [{WIFSTOPPED(s) && WSTOPSIG(s) == SIGTTOU}], WSTOPPED|WCONTINUED, NULL) = 3215
      wait4(3215, ^CProcess 3214 detached
       <detached ...>
      [root@newzabbix tmp]# zabbix_agentd [3214]: Warning: Got signal [signal:2(SIGINT),sender_pid:0,sender_uid:0,reason:128]. Exiting ...
      zabbix_agentd [3214]: Zabbix Agent stopped. Zabbix 2.2.18 (revision 67443).
      

      Process hangs and has to be manually terminated (crtl-c).

      strace of success under Zabbix-2.4.8, PHP >= 5.4

      alarm(3)                                = 0
      pipe([3, 4])                            = 0
      write(1, "local.php.test                  "..., 45local.php.test                               ) = 45
      clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f112fb18a90) = 3708
      close(4)                                = 0
      read(3, "Sat Aug  5 00:00:10 2017", 4095) = 24
      read(3, "", 4095)                       = 0
      close(3)                                = 0
      wait4(3708, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WSTOPPED|WCONTINUED, NULL) = 3708
      --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3708, si_status=0, si_utime=0, si_stime=0} ---
      alarm(0)                                = 3
      write(1, " [t|Sat Aug  5 00:00:10 2017]\n", 30 [t|Sat Aug  5 00:00:10 2017]
      ) = 30
      exit_group(0)                           = ?
      +++ exited with 0 +++
      

            Unassigned Unassigned
            AlesisTrigger Jim Dutton
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: