Project

General

Profile

Actions

Regression #13598

closed

fcgicli can output garbage for stdout/stderr read back from php-fpm

Added by Marcos M about 2 years ago. Updated almost 2 years ago.

Status:
Resolved
Priority:
Normal
Category:
Operating System
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
23.01
Release Notes:
Force Exclusion
Affected Version:
Affected Architecture:

Description

After upgrading to 23.01, the console now shows the following when executing /usr/local/sbin/fcgicli -f /etc/rc.start_packages.

[23.01-DEVELOPMENT][root@gw]/root: /usr/local/sbin/fcgicli -f /etc/rc.start_packages
 Starting package AWS VPC Wizard...done.
 Starting package IPsec Profile Wizard...done.
 Starting package acme...done.
 Starting package System Patches...done.
 Starting package pfBlockerNG-devel...done.
 Starting package haproxy-devel...done.
 Starting package Open-VM-Tools...done.
 Starting package Cron...done.
 Starting package OpenVPN Client Export Utility...done.
 Starting package Avahi...done.
 Starting package freeradius3...ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZdone.
 Starting /usr/local/etc/rc.d/haproxy.sh...done.
 Starting /usr/local/etc/rc.d/pfb_dnsbl.sh...done.
 Starting /usr/local/etc/rc.d/pfb_filter.sh...done.
 Starting /usr/local/etc/rc.d/vmware-guestd.sh...done.
 Starting /usr/local/etc/rc.d/vmware-kmod.sh...done.
[23.01-DEVELOPMENT][root@gw]/root: /usr/local/bin/php-cgi -f /etc/rc.start_packages
 Starting package AWS VPC Wizard...done.
 Starting package IPsec Profile Wizard...done.
 Starting package acme...done.
 Starting package System Patches...done.
 Starting package pfBlockerNG-devel...done.
 Starting package haproxy-devel...done.
 Starting package Open-VM-Tools...done.
 Starting package Cron...done.
 Starting package OpenVPN Client Export Utility...done.
 Starting package Avahi...done.
 Starting package freeradius3...done.
 Starting /usr/local/etc/rc.d/haproxy.sh...done.
 Starting /usr/local/etc/rc.d/pfb_dnsbl.sh...done.
 Starting /usr/local/etc/rc.d/pfb_filter.sh...done.
 Starting /usr/local/etc/rc.d/vmware-guestd.sh...done.
 Starting /usr/local/etc/rc.d/vmware-kmod.sh...done.
Actions #1

Updated by Reid Linnemann about 2 years ago

  • Subject changed from Firewall gets tired during boot to fcgicli can output garbage for stdout/stderr read back from php-fpm
  • Status changed from New to In Progress

Many scripts, including rc.start_packages, use fcgicli to instruct php-fpm to load and execute a script rather than spin up a new interpreter instance and run the script directly. The fcgicli command prints out the stderr/stdout sent back to it by php-fpm by recv'ing fastcgi packets and spitting the buffers out. It appears that in some cases when an output packet arrives for text that is exactly 32 bytes (or perhaps modulos of 32), sans the terminating NUL, fcgicli only allocates a 32 byte buffer for the non-terminated string and subsequently uninitialized memory can be output. In this case, that memory has a marker value of 0x5a in every byte, which corresponds to ASCII 'Z'. This is easy enough to correct by ensuring the buffer is always one byte larger than the content length, and ensuring that final byte is NUL.

Actions #2

Updated by Reid Linnemann about 2 years ago

  • Status changed from In Progress to Feedback
  • % Done changed from 0 to 100
  • Private changed from Yes to No
Actions #3

Updated by Kris Phillips about 2 years ago

Looks good here and no longer seeing the garbage output when running the above commands.

Actions #4

Updated by Jim Pingle almost 2 years ago

  • Tracker changed from Bug to Regression
  • Status changed from Feedback to Resolved
  • Target version set to 2.7.0
  • Plus Target Version set to 23.01
  • Release Notes changed from Default to Force Exclusion
Actions

Also available in: Atom PDF