Debian Bug report logs - #463255
php5: Reflection object fails to recognise runtime class properties as public

version graph

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

Reported by: mark.2391@blueyonder.co.uk

Date: Wed, 30 Jan 2008 16:21:01 UTC

Severity: important

Tags: confirmed, etch

Found in version php5/5.2.0-8+etch10

Fixed in version 5.2.6.dfsg.1-1+lenny4

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#463255; Package php5. (full text, mbox, link).


Acknowledgement sent to mark.2391@blueyonder.co.uk:
New Bug report received and forwarded. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>. (full text, mbox, link).


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

From: mark.2391@blueyonder.co.uk
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: php5: Reflection object fails to recognise runtime class properties as public
Date: Wed, 30 Jan 2008 16:17:33 +0000
Package: php5
Version: 5.2.0-8+etch10
Severity: important

According to a friend, the code below works correctly on PHP 5.2.3 but in the current Debian stable distribuion it fails to produce the right result. Note that the 
myRuntimeProperty is absent from the second var_dump at the end.

<?php

class Test
{
    public $myDeclaredProperty = 1;

    public function __construct()
    {
        $this->myRuntimeProperty = 2;
    }

    public function getPublicProperties()
    {
        $r = new ReflectionObject($this);
        $properties = $r->getProperties();
        $publicProperties = array();
        foreach ($properties as $property) {
            if ($property->isPublic()) {
                $publicProperties[$property->getName()] = 
$property->getValue($this);
            }
        }
        return $publicProperties;
    }
}
echo 'Running ' . phpversion() . "\n";
$obj = new Test();
echo "Dumping object:\n";
var_dump($obj);
echo "Dumping public properties according to Reflection object\n";
var_dump($obj->getPublicProperties());


My output:

Running 5.2.0-8+etch10
Dumping object:
object(Test)#1 (2) {
  ["myDeclaredProperty"]=>
  int(1)
  ["myRuntimeProperty"]=>
  int(2)
}
Dumping public properties according to Reflection object
array(1) {
  ["myDeclaredProperty"]=>
  int(1)
}


-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (1001, 'stable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-5-amd64
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)

Versions of packages php5 depends on:
ii  libapache2-mod-php5       5.2.0-8+etch10 server-side, HTML-embedded scripti
ii  php5-common               5.2.0-8+etch10 Common files for packages built fr

php5 recommends no packages.

-- no debconf information





Information forwarded to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#463255; Package php5. (full text, mbox, link).


Acknowledgement sent to "Raphael Geissert" <atomo64@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>. (full text, mbox, link).


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

From: "Raphael Geissert" <atomo64@gmail.com>
To: mark.2391@blueyonder.co.uk, 463255@bugs.debian.org
Cc: control@bugs.debian.org
Subject: Re: [php-maint] Bug#463255: php5: Reflection object fails to recognise runtime class properties as public
Date: Wed, 30 Jan 2008 14:37:18 -0600
tag 463255 confirmed
notfound 463255 5.2.4-2+b1
notfound 463255 5.2.5-1
thanks

On 30/01/2008, mark.2391@blueyonder.co.uk <mark.2391@blueyonder.co.uk> wrote:
> Package: php5
> Version: 5.2.0-8+etch10
> Severity: important
>
> According to a friend, the code below works correctly on PHP 5.2.3 but in the current Debian stable distribuion it fails to produce the right result. Note that the
> myRuntimeProperty is absent from the second var_dump at the end.
>

Running 5.2.5-1
Dumping object:
object(Test)#1 (2) {
  ["myDeclaredProperty"]=>
  int(1)
  ["myRuntimeProperty"]=>
  int(2)
}
Dumping public properties according to Reflection object
array(2) {
  ["myDeclaredProperty"]=>
  int(1)
  ["myRuntimeProperty"]=>
  int(2)
}

Running 5.2.0-8+etch10
Dumping object:
object(Test)#1 (2) {
  ["myDeclaredProperty"]=>
  int(1)
  ["myRuntimeProperty"]=>
  int(2)
}
Dumping public properties according to Reflection object
Segmentation fault

That looks even worst.

I'll try to provide a backtrace as soon as I recompile php5 with the
debug symbols.

>
>
> -- System Information:
> Debian Release: 4.0
>   APT prefers stable
>   APT policy: (1001, 'stable')
> Architecture: amd64 (x86_64)
> Shell:  /bin/sh linked to /bin/bash
> Kernel: Linux 2.6.18-5-amd64
> Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
>
> Versions of packages php5 depends on:
> ii  libapache2-mod-php5       5.2.0-8+etch10 server-side, HTML-embedded scripti
> ii  php5-common               5.2.0-8+etch10 Common files for packages built fr
>
> php5 recommends no packages.
>
> -- no debconf information
>
>
>
>
> _______________________________________________
> pkg-php-maint mailing list
> pkg-php-maint@lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/pkg-php-maint
>


-- 
Atomo64 - Raphael

Please avoid sending me Word, PowerPoint or Excel attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html

Say NO to Microsoft Office broken standard.
See http://www.noooxml.org/petition




Tags added: confirmed Request was from "Raphael Geissert" <atomo64@gmail.com> to control@bugs.debian.org. (Wed, 30 Jan 2008 20:39:08 GMT) (full text, mbox, link).


Bug no longer marked as found in version 5.2.4-2+b1. Request was from "Raphael Geissert" <atomo64@gmail.com> to control@bugs.debian.org. (Wed, 30 Jan 2008 20:39:09 GMT) (full text, mbox, link).


Bug no longer marked as found in version 5.2.5-1. Request was from "Raphael Geissert" <atomo64@gmail.com> to control@bugs.debian.org. (Wed, 30 Jan 2008 20:39:10 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#463255; Package php5. (full text, mbox, link).


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

From: Raphael Geissert <atomo64@gmail.com>
To: mark.2391@blueyonder.co.uk
Cc: 463255@bugs.debian.org
Subject: Re: [php-maint] Bug#463255: php5: Reflection object fails to recognise runtime class properties as public
Date: Thu, 31 Jan 2008 10:45:25 -0600
On Wednesday 30 January 2008, Raphael Geissert wrote:
> Running 5.2.0-8+etch10
> Dumping object:
> object(Test)#1 (2) {
>   ["myDeclaredProperty"]=>
>   int(1)
>   ["myRuntimeProperty"]=>
>   int(2)
> }
> Dumping public properties according to Reflection object
> Segmentation fault
>
> That looks even worst.
>
> I'll try to provide a backtrace as soon as I recompile php5 with the
> debug symbols.


(gdb) run /tmp/foo
Starting program: /usr/bin/php5 /tmp/foo
Running 5.2.0-8+etch10
Dumping object:
object(Test)#1 (2) {
  ["myDeclaredProperty"]=>
  int(1)
  ["myRuntimeProperty"]=>
  int(2)
}
Dumping public properties according to Reflection object

Program received signal SIGSEGV, Segmentation fault.
0x08157308 in _property_check_flag (ht=0, return_value=0xb7684a4c, 
return_value_ptr=0x8524c80,
    this_ptr=0xb7684800, return_value_used=1, mask=256)
    at /tmp/buildd/php5-5.2.0/ext/reflection/php_reflection.c:3846
3846    /tmp/buildd/php5-5.2.0/ext/reflection/php_reflection.c: No such file 
or directory.
        in /tmp/buildd/php5-5.2.0/ext/reflection/php_reflection.c
(gdb) bt
#0  0x08157308 in _property_check_flag (ht=0, return_value=0xb7684a4c, 
return_value_ptr=0x8524c80,
    this_ptr=0xb7684800, return_value_used=1, mask=256)
    at /tmp/buildd/php5-5.2.0/ext/reflection/php_reflection.c:3846
#1  0x082cfeef in zend_do_fcall_common_helper_SPEC (execute_data=0xbfaba01c)
    at /tmp/buildd/php5-5.2.0/Zend/zend_vm_execute.h:200
#2  0x082bf8e8 in execute (op_array=0xb7683d14) 
at /tmp/buildd/php5-5.2.0/Zend/zend_vm_execute.h:92
#3  0x082cf8d1 in zend_do_fcall_common_helper_SPEC (execute_data=0xbfaba26c)
    at /tmp/buildd/php5-5.2.0/Zend/zend_vm_execute.h:234
#4  0x082bf8e8 in execute (op_array=0xb76823d8) 
at /tmp/buildd/php5-5.2.0/Zend/zend_vm_execute.h:92
#5  0x082a0abc in zend_execute_scripts (type=8, retval=0x0, file_count=3)
    at /tmp/buildd/php5-5.2.0/Zend/zend.c:1097
#6  0x0825bd82 in php_execute_script (primary_file=0xbfabc6a0) 
at /tmp/buildd/php5-5.2.0/main/main.c:1758
#7  0x0832fc5e in main (argc=2, argv=0xbfabc774) 
at /tmp/buildd/php5-5.2.0/sapi/cli/php_cli.c:1108


php_reflection.c:3846 is:
3846            RETURN_BOOL(ref->prop->flags & mask);

Cheers,
-- 
Atomo64 - Raphael

Please avoid sending me Word, PowerPoint or Excel attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html




Tags added: etch Request was from Raphael Geissert <atomo64@gmail.com> to control@bugs.debian.org. (Tue, 26 Aug 2008 22:39:02 GMT) (full text, mbox, link).


Reply sent to Ondřej Surý <ondrej@sury.org>:
You have taken responsibility. (Fri, 08 Jan 2010 15:06:13 GMT) (full text, mbox, link).


Notification sent to mark.2391@blueyonder.co.uk:
Bug acknowledged by developer. (Fri, 08 Jan 2010 15:06:13 GMT) (full text, mbox, link).


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

From: Ondřej Surý <ondrej@sury.org>
To: 463255-done@bugs.debian.org
Subject: Bug fixed in current stable
Date: Fri, 8 Jan 2010 16:03:24 +0100
Version: 5.2.6.dfsg.1-1+lenny4

Hi,
I am closing this bug report since it applies to version in oldstable
which is no longer supported. According to bugreport code in question
works fine in newer versions of php5.

Ondrej
-- 
Ondřej Surý <ondrej@sury.org>
http://blog.rfc1925.org/




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sat, 06 Feb 2010 07:32:11 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:07:25 2023; Machine Name: bembo

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.