[Bug 1677578] Re: php-fcgi: max_execution_time causes memory leaks

Bryce Harrington 1677578 at bugs.launchpad.net
Mon Feb 7 23:15:21 UTC 2022


The upstream comment indicates the issue is believed to be in imagemagick itself rather than php-imagick.
It would be worth re-testing if this issue exists or not when using current imagemagick.

** Package changed: php-imagick (Ubuntu) => imagemagick (Ubuntu)

** Changed in: imagemagick (Ubuntu)
       Status: Confirmed => Incomplete

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to imagemagick in Ubuntu.
https://bugs.launchpad.net/bugs/1677578

Title:
  php-fcgi: max_execution_time causes memory leaks

Status in php:
  Unknown
Status in imagemagick package in Ubuntu:
  Incomplete
Status in php7.0 package in Ubuntu:
  Invalid

Bug description:
  I noticed that php processes do not free memory after killing scripts
  that are running more than allowed by max_execution_time directive.

  My setup is lighttpd with php configured as fcgi. Sample script
  (requires php-imagick) that can easily hit default 30 seconds time
  limit and uses a lot of memory so leaks are easy to notice:

  <?php
      define('__BASE__', 'images');
      $photos = [];
      if ($album_root = opendir(__BASE__)) {
          while (false !== ($entry = readdir($album_root))) {
              if (preg_match('/\.(jpe?g|gif|png)$/i', $entry)) {
                  $photos[] = $entry;
              }
          }
          closedir($album_root);
          sort($photos);
          if (!file_exists('thumbs')) {
              mkdir('thumbs');
          }
          foreach($photos as $photo) {
              $thumb = 'thumbs/'.$photo;
              if (!file_exists($thumb)) {
                  $image = new \Imagick(realpath(__BASE__.'/'.$photo));
                  $image->thumbnailImage(64, 48, true, false);
                  $image->writeImage($thumb);
                  $image->clear;
                  $image = null;
              }
          }
      }
  ?>

  Just put many big JPGs to images directory.

  ProblemType: Bug
  DistroRelease: Ubuntu 16.04
  Package: php7.0-cgi 7.0.15-0ubuntu0.16.04.4
  ProcVersionSignature: Ubuntu 4.8.0-45.48~16.04.1-generic 4.8.17
  Uname: Linux 4.8.0-45-generic x86_64
  ApportVersion: 2.20.1-0ubuntu2.5
  Architecture: amd64
  Date: Thu Mar 30 14:37:16 2017
  InstallationDate: Installed on 2011-04-14 (2177 days ago)
  InstallationMedia: Ubuntu-Server 10.04.2 LTS "Lucid Lynx" - Release amd64 (20110211.1)
  SourcePackage: php7.0
  UpgradeStatus: Upgraded to xenial on 2016-07-30 (242 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/php/+bug/1677578/+subscriptions




More information about the foundations-bugs mailing list