Debian Bug report logs - #513916
php5: php <= 5.2.0-8+etch13 (debian etch): PHP Bug #40191: use of array_unique triggers segfault. http://bugs.php.net/bug.php?id=40191

version graph

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

Reported by: Dino Ciuffetti <dino@tuxweb.it>

Date: Mon, 2 Feb 2009 13:00:02 UTC

Severity: normal

Found in version php5/5.2.0-8+etch13

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#513916; Package php5. (Mon, 02 Feb 2009 13:00:04 GMT) (full text, mbox, link).


Acknowledgement sent to Dino Ciuffetti <dino@tuxweb.it>:
New Bug report received and forwarded. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>. (Mon, 02 Feb 2009 13:00:04 GMT) (full text, mbox, link).


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

From: Dino Ciuffetti <dino@tuxweb.it>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: php5: php <= 5.2.0-8+etch13 (debian etch): PHP Bug #40191: use of array_unique triggers segfault. http://bugs.php.net/bug.php?id=40191
Date: Mon, 02 Feb 2009 12:59:06 +0000
Package: php5
Version: 5.2.0-8+etch13
Severity: normal


This is PHP bug number #40191, fixed in major versions:
http://bugs.php.net/bug.php?id=40191

Description:
------------
when using array_unique to unify an ArrayObject, PHP runs into a
segfault.

Reproduce code:
---------------
<?php
$arrObj = new ArrayObject();
$arrObj->append('foo');
$arrObj->append('bar');
$arrObj->append('foo');

$arr = array_unique($arrObj);
?>

Expected result:
----------------
array (
  [0] => 'foo',
  [1] => 'bar'
)

or Error

Actual result:
--------------
Segfault

-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-xen
Locale: LANG=it_IT@euro, LC_CTYPE=it_IT@euro (charmap=ISO-8859-15)

Versions of packages php5 depends on:
ii  php5-cgi                  5.2.0-8+etch13 server-side, HTML-embedded scripti
ii  php5-common               5.2.0-8+etch13 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#513916; Package php5. (Tue, 03 Feb 2009 18:57:02 GMT) (full text, mbox, link).


Acknowledgement sent to sean finney <seanius@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>. (Tue, 03 Feb 2009 18:57:05 GMT) (full text, mbox, link).


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

From: sean finney <seanius@debian.org>
To: Dino Ciuffetti <dino@tuxweb.it>, 513916@bugs.debian.org
Subject: Re: [php-maint] Bug#513916: php5: php <= 5.2.0-8+etch13 (debian etch): PHP Bug #40191: use of array_unique triggers segfault. http://bugs.php.net/bug.php?id=40191
Date: Tue, 3 Feb 2009 19:49:59 +0100
[Message part 1 (text/plain, inline)]
hi dino,

On Mon, Feb 02, 2009 at 12:59:06PM +0000, Dino Ciuffetti wrote:
> Package: php5
> Version: 5.2.0-8+etch13
> Severity: normal
> 
> 
> This is PHP bug number #40191, fixed in major versions:
> http://bugs.php.net/bug.php?id=40191

typically speaking, we don't spend much time chasing normal crash bugs
in php.  this is largely because actually *finding* the fix is incredibly
difficult and time-consuming due to lack of information typically found
in php.net bugs like this.

however, if you are motivated to do the work yourself, please feel
encouraged to dig up the specific commits that address the problem.
this will most likely involve correlating the "fixed in cvs snapshot"
time with commits in the cvs commits mailing list on lists.php.net and
the cvs web interface on cvs.php.net.  if you can find the specific fix,
and the patch is clear and simple enough, then we can propose the including
the fix in a version that we send to stable-proposed-updates.


regards,
	sean
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#513916; Package php5. (Tue, 03 Feb 2009 20:51:02 GMT) (full text, mbox, link).


Acknowledgement sent to "Dino Ciuffetti" <dino@tuxweb.it>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>. (Tue, 03 Feb 2009 20:51:19 GMT) (full text, mbox, link).


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

From: "Dino Ciuffetti" <dino@tuxweb.it>
To: "sean finney" <seanius@debian.org>
Cc: 513916@bugs.debian.org
Subject: Re: [php-maint] Bug#513916: php5: php <= 5.2.0-8+etch13 (debian etch): PHP Bug #40191: use of array_unique triggers segfault. http://bugs.php.net/bug.php?id=40191
Date: Tue, 3 Feb 2009 21:48:03 +0100 (CET)
[Message part 1 (text/plain, inline)]
Hi Sean.

> however, if you are motivated to do the work yourself, please feel
> encouraged to dig up the specific commits that address the problem.

Sure!

> if you can find the specific fix,
> and the patch is clear and simple enough, then we can propose the
> including
> the fix in a version that we send to stable-proposed-updates.

The patch (Tested. It fix the problem.) is clear and VERY simple and is
attached. Please try to propose to the stable updates.

Below, the tests I have done.


root@giubox:/mnt/samba/Downloads# apt-get -t stable source php5
Lettura della lista dei pacchetti in corso... Fatto
Generazione dell'albero delle dipendenze in corso
Lettura informazioni sullo stato... Fatto
È necessario prendere 8707kB di sorgenti
Get:1 ftp://debian.fastweb.it stable/main php5 5.2.0-8+etch13 (dsc) [1978B]
Get:2 ftp://debian.fastweb.it stable/main php5 5.2.0-8+etch13 (tar) [8583kB]
Get:3 ftp://debian.fastweb.it stable/main php5 5.2.0-8+etch13 (diff) [121kB]
Scaricato 8707kB in 33s (257kB/s)
dpkg-source: extracting php5 in php5-5.2.0
dpkg-source: info: unpacking php5_5.2.0.orig.tar.gz
dpkg-source: info: applying php5_5.2.0-8+etch13.diff.gz
root@giubox:/mnt/samba/Downloads# cd php5-5.2.0/
root@giubox:/mnt/samba/Downloads/php5-5.2.0# cp
../temp/php-5.2.0/array_unique_bug.patch .
root@giubox:/mnt/samba/Downloads/php5-5.2.0# patch -p0
<array_unique_bug.patch
patching file ext/standard/array.c
root@giubox:/mnt/samba/Downloads/php5-5.2.0# ./configure --prefix=/tmp/php1
...
root@giubox:/mnt/samba/Downloads/php5-5.2.0# make
...
Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).

nobody@giubox:/mnt/samba/Downloads/temp/php-5.2.0$ make install
Installing PHP SAPI module:       cgi
Installing PHP CGI into: /tmp/php1/bin/
Installing build environment:     /tmp/php1/lib/php/build/
Installing header files:          /tmp/php1/include/php/
Installing helper programs:       /tmp/php1/bin/
  program: phpize
  program: php-config
Installing man pages:             /tmp/php1/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /tmp/php1/lib/php/
[PEAR] Archive_Tar    - already installed: 1.3.1
[PEAR] Console_Getopt - already installed: 1.2
[PEAR] PEAR           - already installed: 1.4.11
Wrote PEAR system config file at: /tmp/php1/etc/pear.conf
You may want to add: /tmp/php1/lib/php to your php.ini include_path
Installing PDO headers:          /tmp/php1/include/php/ext/pdo/
nobody@giubox:/mnt/samba/Downloads/temp/php-5.2.0$
nobody@giubox:/mnt/samba/Downloads/temp/php-5.2.0$ echo -e '<?php
$arrObj = new ArrayObject();
$arrObj->append('foo');
$arrObj->append('bar');
$arrObj->append('foo');

$arr = array_unique($arrObj);
print_r($arr);
?>' > sapi/cli/bug.php
nobody@giubox:/mnt/samba/Downloads/temp/php-5.2.0$
nobody@giubox:/mnt/samba/Downloads/temp/php-5.2.0$ /tmp/php1/bin/php
sapi/cli/bug.php
X-Powered-By: PHP/5.2.0
Content-type: text/html

Array
(
    [0] => foo
    [1] => bar
)


Bug was fixed.
Ciao, Dino.


-- 
Dino Ciuffetti
Linux System Administrator and Architect
-----------------
TuxWeb S.r.l. - InfoServices EveryWhere - http://www.tuxweb.it
Soluzioni informatiche, sviluppo, applicazioni web, consulenze sistemistiche e su prodotti opensource, corsi Linux e molto altro ancora! Per maggiori informazioni scrivi a info@tuxweb.it.

[array_unique_bug.patch (application/octet-stream, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#513916; Package php5. (Tue, 03 Feb 2009 22:42:02 GMT) (full text, mbox, link).


Acknowledgement sent to sean finney <seanius@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>. (Tue, 03 Feb 2009 22:42:02 GMT) (full text, mbox, link).


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

From: sean finney <seanius@debian.org>
To: Dino Ciuffetti <dino@tuxweb.it>
Cc: 513916@bugs.debian.org
Subject: Re: [php-maint] Bug#513916: php5: php <= 5.2.0-8+etch13 (debian etch): PHP Bug #40191: use of array_unique triggers segfault. http://bugs.php.net/bug.php?id=40191
Date: Tue, 3 Feb 2009 23:36:11 +0100
[Message part 1 (text/plain, inline)]
hiya,

On Tue, Feb 03, 2009 at 09:48:03PM +0100, Dino Ciuffetti wrote:
> The patch (Tested. It fix the problem.) is clear and VERY simple and is
> attached. Please try to propose to the stable updates.

wow, that was fast :)

could you send the patch in unified diff (diff -u) format?  we have a couple
other pending patches so it might be about time to send this off to
proposed-updates.

thanks,
	sean
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#513916; Package php5. (Wed, 04 Feb 2009 10:24:10 GMT) (full text, mbox, link).


Acknowledgement sent to "Dino Ciuffetti" <dino@tuxweb.it>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>. (Wed, 04 Feb 2009 10:24:10 GMT) (full text, mbox, link).


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

From: "Dino Ciuffetti" <dino@tuxweb.it>
To: "sean finney" <seanius@debian.org>
Cc: 513916@bugs.debian.org
Subject: Re: [php-maint] Bug#513916: php5: php <= 5.2.0-8+etch13 (debian etch): PHP Bug #40191: use of array_unique triggers segfault. http://bugs.php.net/bug.php?id=40191
Date: Wed, 4 Feb 2009 11:11:21 +0100 (CET)
[Message part 1 (text/plain, inline)]
> could you send the patch in unified diff (diff -u) format?  we have a
> couple
> other pending patches so it might be about time to send this off to
> proposed-updates.

Ok. It is in attach. Thank you!
Ciao, Dino.


-- 
Dino Ciuffetti
Linux System Administrator and Architect
-----------------
TuxWeb S.r.l. - InfoServices EveryWhere - http://www.tuxweb.it
Soluzioni informatiche, sviluppo, applicazioni web, consulenze sistemistiche e su prodotti opensource, corsi Linux e molto altro ancora! Per maggiori informazioni scrivi a info@tuxweb.it.

[array_unique_bug.patch (text/x-diff, attachment)]

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


Notification sent to Dino Ciuffetti <dino@tuxweb.it>:
Bug acknowledged by developer. (Fri, 08 Jan 2010 16:42:09 GMT) (full text, mbox, link).


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

From: Ondřej Surý <ondrej@sury.org>
To: 513916-done@bugs.debian.org
Subject: #513916: php5: php <= 5.2.0-8+etch13 (debian etch): PHP Bug #40191: use of array_unique triggers segfault. http://bugs.php.net/bug.php?id=40191
Date: Fri, 8 Jan 2010 17:39:46 +0100
Version: 5.2.6.dfsg.1-1+lenny4

Fixed in current stable.

-- 
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:28:32 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:08:52 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.