Debian Bug report logs - #614904
php5-cgi: fastcgi breaks __COMPILER_HALT_OFFSET__

version graph

Package: php5-cgi; Maintainer for php5-cgi is (unknown);

Reported by: Pascal COURTOIS <debian-br@nouvo.com>

Date: Thu, 24 Feb 2011 08:00:02 UTC

Severity: important

Tags: upstream

Found in version php5/5.3.3-7

Fixed in versions php5/5.4.4-7, 5.4.4-14

Done: Ondřej Surý <ondrej@sury.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#614904; Package php5-cgi. (Thu, 24 Feb 2011 08:00:05 GMT) (full text, mbox, link).


Acknowledgement sent to Pascal COURTOIS <debian-br@nouvo.com>:
New Bug report received and forwarded. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>. (Thu, 24 Feb 2011 08:00:05 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Pascal COURTOIS <debian-br@nouvo.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: php5-cgi: fastcgi breaks __COMPILER_HALT_OFFSET__
Date: Thu, 24 Feb 2011 08:47:07 +0100
Package: php5-cgi
Version: 5.3.3-7
Severity: important
Tags: upstream


php code :
=======================================================
<?php
  print "offset:".__COMPILER_HALT_OFFSET__."==\n";

  __halt_compiler();

=======================================================

with fastcgi (using either libapache2-mod-fcgid or libapache2-mod-fastcgi) and suexec,
the first call works. If called again I get this error:
Notice: Use of undefined constant __COMPILER_HALT_OFFSET__ - assumed '__COMPILER_HALT_OFFSET__'
  in /var/www/dev4.sociatomdev.com/chroot/htdocs/test.php on line 2 offset:__COMPILER_HALT_OFFSET__== 


If I touch the php file, the script works again once.
If I kill fastcgi processes, the script also works again once.

script works fine with php as Apache module or cgi

It used to work with lenny


-- System Information:
Debian Release: 6.0
  APT prefers squeeze-updates
  APT policy: (500, 'squeeze-updates'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.34.6-xxxx-std-ipv6-32 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages php5-cgi depends on:
ii  libbz2-1.0              1.0.5-6          high-quality block-sorting file co
ii  libc6                   2.11.2-10        Embedded GNU C Library: Shared lib
ii  libcomerr2              1.41.12-2        common error description library
ii  libdb4.8                4.8.30-2         Berkeley v4.8 Database Libraries [
ii  libgssapi-krb5-2        1.8.3+dfsg-4     MIT Kerberos runtime libraries - k
ii  libk5crypto3            1.8.3+dfsg-4     MIT Kerberos runtime libraries - C
ii  libkrb5-3               1.8.3+dfsg-4     MIT Kerberos runtime libraries
ii  libmagic1               5.04-5           File type determination library us
ii  libonig2                5.9.1-1          Oniguruma regular expressions libr
ii  libpcre3                8.02-1.1         Perl 5 Compatible Regular Expressi
ii  libqdbm14               1.8.77-4         QDBM Database Libraries [runtime]
ii  libssl0.9.8             0.9.8o-4squeeze1 SSL shared libraries
ii  libxml2                 2.7.8.dfsg-2     GNOME XML library
ii  mime-support            3.48-1           MIME files 'mime.types' & 'mailcap
ii  php5-common             5.3.3-7          Common files for packages built fr
ii  tzdata                  2010o-1          time zone and daylight-saving time
ii  ucf                     3.0025+nmu1      Update Configuration File: preserv
ii  zlib1g                  1:1.2.3.4.dfsg-3 compression library - runtime

php5-cgi recommends no packages.

Versions of packages php5-cgi suggests:
pn  php-pear                      <none>     (no description available)

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#614904; Package php5-cgi. (Thu, 24 Feb 2011 11:36:03 GMT) (full text, mbox, link).


Acknowledgement sent to Pascal COURTOIS <debian-br@nouvo.com>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>. (Thu, 24 Feb 2011 11:36:03 GMT) (full text, mbox, link).


Message #10 received at 614904@bugs.debian.org (full text, mbox, reply):

From: Pascal COURTOIS <debian-br@nouvo.com>
To: 614904@bugs.debian.org
Subject: php5-cgi: fastcgi breaks __COMPILER_HALT_OFFSET__
Date: Thu, 24 Feb 2011 12:25:40 +0100
I tried the dotdeb package PHP 3.3.5. It's buggy as well :-(




Information forwarded to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#614904; Package php5-cgi. (Thu, 24 Feb 2011 16:45:08 GMT) (full text, mbox, link).


Acknowledgement sent to Pascal COURTOIS <Pascal.Courtois@nouvo.com>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>. (Thu, 24 Feb 2011 16:45:08 GMT) (full text, mbox, link).


Message #15 received at 614904@bugs.debian.org (full text, mbox, reply):

From: Pascal COURTOIS <Pascal.Courtois@nouvo.com>
To: 614904@bugs.debian.org
Subject: Re: php5-cgi: fastcgi breaks __COMPILER_HALT_OFFSET__
Date: Thu, 24 Feb 2011 17:35:44 +0100
obviously it's a memory leak. The following program should always print the same offset (last print before __halt_compiler() )
after few calls result become different.

<?php
  header("Content-type: text/plain");
  print "posix_getpid ".posix_getpid()."\n";
  if (!defined('__COMPILER_HALT_OFFSET__'))
      {
        print "not defined\n";
        $COMPILER_HALT_OFFSET=00000000;
        if ($COMPILER_HALT_OFFSET==0)
          {
            $fh = fopen(__FILE__, 'r+');
            $ok=0;

            $offset_file=-1;
            while(!$ok && ($line = fgets($fh)))
              {
                if ($offset_file<0 && preg_match("/^.*COMPILER_HALT_OFFSET=(00000000)/",$line,$matches,PREG_OFFSET_CAPTURE))
                  {
                    $offset_file=$pos+$matches[1][1];
                  }
                if (preg_match("/^.*(__halt_compiler\(\);)/",$line,$matches,PREG_OFFSET_CAPTURE))
                  {
                    $COMPILER_HALT_OFFSET=$pos+$matches[1][1]+18;
                    $ok=1;
                  }

                $pos=ftell($fh);
              }

            if (!$ok)
              {
                die("PHP 5.3 with fastcgi bug could not be corrected");
              }

            $computed_offset=sprintf("%08d",$COMPILER_HALT_OFFSET);
            print "computed_offset:".$computed_offset."\n";
            fseek($fh,$offset_file);
            fwrite($fh,sprintf("%08d",$COMPILER_HALT_OFFSET));
            fclose($fh);

          }
      }
    else
      $COMPILER_HALT_OFFSET=__COMPILER_HALT_OFFSET__;

  print "offset:".$COMPILER_HALT_OFFSET."==\n";

  __halt_compiler();abcd




Information forwarded to debian-bugs-dist@lists.debian.org, debian-br@nouvo.com, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#614904; Package php5-cgi. (Mon, 09 Apr 2012 10:40:11 GMT) (full text, mbox, link).


Acknowledgement sent to Ondřej Surý <ondrej@debian.org>:
Extra info received and forwarded to list. Copy sent to debian-br@nouvo.com, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>. (Mon, 09 Apr 2012 10:40:31 GMT) (full text, mbox, link).


Message #20 received at 614904@bugs.debian.org (full text, mbox, reply):

From: Ondřej Surý <ondrej@debian.org>
To: Debian Bug Tracking System <614904@bugs.debian.org>
Subject: Re: fastcgi breaks __COMPILER_HALT_OFFSET__
Date: Mon, 09 Apr 2012 12:37:55 +0200
Package: php5-cgi
Severity: normal

Hi Pascal,

can you please try with PHP 5.4 from testing/unstable?  If it is still
broken, can you please report this bug to the bugs.php.net and report the
issue number back?

Ondrej

-- System Information:
Debian Release: 6.0.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable'), (300, 'unstable'), (200, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash




Reply sent to Ondřej Surý <ondrej@sury.org>:
You have taken responsibility. (Fri, 04 Jul 2014 13:03:08 GMT) (full text, mbox, link).


Notification sent to Pascal COURTOIS <debian-br@nouvo.com>:
Bug acknowledged by developer. (Fri, 04 Jul 2014 13:03:08 GMT) (full text, mbox, link).


Message #25 received at 614904-done@bugs.debian.org (full text, mbox, reply):

From: Ondřej Surý <ondrej@sury.org>
To: 614904-done@bugs.debian.org, 620015-done@bugs.debian.org, 704764-done@bugs.debian.org, 628054-done@bugs.debian.org, 620948-done@bugs.debian.org, 620423-done@bugs.debian.org, 620015-done@bugs.debian.org
Subject: Re: Closing bugs filled against php5 in oldstable
Date: Fri, 04 Jul 2014 15:00:44 +0200
Version: 5.4.4-14

One more batch...

On Fri, Jul 4, 2014, at 14:09, Ondřej Surý wrote:
> Version: 5.4.4-14
> 
> Hey all,
> 
> I am closing the bugs that were filled against php5 5.3 in Debian
> oldstable
> (well and earlier)...
> 
> Feel free to reopen the bug in you can reproduce it with php5 from
> current
> stable Debian release.
> 
> Cheers,
> -- 
> Ondřej Surý <ondrej@sury.org>
> Knot DNS (https://www.knot-dns.cz/) – a high-performance DNS server


-- 
Ondřej Surý <ondrej@sury.org>
Knot DNS (https://www.knot-dns.cz/) – a high-performance DNS server



Marked as fixed in versions php5/5.4.4-7. Request was from Ondřej Surý <ondrej@debian.org> to control@bugs.debian.org. (Wed, 09 Jul 2014 08:06:19 GMT) (full text, mbox, link).


Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Thu, 07 Aug 2014 07:25:33 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Jul 2 03:38:22 2023; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.