ID:               31926
 Updated by:       [EMAIL PROTECTED]
 Reported By:      gms08701 at yahoo dot com
-Status:           Assigned
+Status:           Feedback
 Bug Type:         SPL related
 Operating System: FreeBSD 5.3
 PHP Version:      5CVS-2005-02-13
 Assigned To:      helly
 New Comment:

According to the test result you used the run-tests.php script from
your newly build but used your installation. Could you check again
using the right php version now?


Previous Comments:
------------------------------------------------------------------------

[2005-02-13 16:59:44] gms08701 at yahoo dot com

gladiator# /home/gsam/local/bin/php -f
/home/gsam/php/php5-STABLE-200502131330/run-tests.php ext/spl

=====================================================================
CWD         : /usr/home/gsam/php/php5-STABLE-200502131330
PHP         : /home/gsam/local/bin/php
PHP_SAPI    : cli
PHP_VERSION : 5.0.4-dev
ZEND_VERSION: 2.0.4-dev
PHP_OS      : FreeBSD - FreeBSD gladiator.xxx.xxx 5.3-RELEASE-p2
FreeBSD 5.3-RELEASE-p2 #0: Wed Dec 29 20:45:41 EST 2004    
[EMAIL PROTECTED]:/usr/obj/usr/src/sys/GLADIATOR i386
INI actual  : /usr/home/gsam/php/php5-STABLE-200502131330
More .INIs  : /usr/local/etc/php/extensions.ini
Extra dirs  :
=====================================================================
Running selected tests.
PASS SPL: EmptyIterator [ext/spl/examples/tests/iterators_001.phpt]
PASS SPL: InfiniteIterator [ext/spl/examples/tests/iterators_002.phpt]
PASS SPL: NoRweindIterator [ext/spl/examples/tests/iterators_003.phpt]
PASS SPL: AppendIterator [ext/spl/examples/tests/iterators_004.phpt]
PASS SPL: ArrayObject [ext/spl/tests/array_001.phpt]
PASS SPL: ArrayObject copy constructor [ext/spl/tests/array_002.phpt]
PASS SPL: ArrayObject from object [ext/spl/tests/array_003.phpt]
PASS SPL: ArrayIterator [ext/spl/tests/array_004.phpt]
PASS SPL: ArrayObject/Iterator interaction
[ext/spl/tests/array_005.phpt]
PASS SPL: ArrayIterator without ArrayObject
[ext/spl/tests/array_006.phpt]
PASS SPL: ArrayObject/Iterator from IteratorAggregate
[ext/spl/tests/array_007.phpt]
PASS SPL: ArrayIterator and foreach reference
[ext/spl/tests/array_008.phpt]
FAIL SPL: ArrayIterator implementing RecursiveIterator
[ext/spl/tests/array_009.phpt]
PASS SPL: ArrayIterator implements ArrayAccess
[ext/spl/tests/array_010.phpt]
PASS SPL: ArrayIterator, LimitIterator and string keys
[ext/spl/tests/array_011.phpt]
PASS SPL: ArrayIterator::count [ext/spl/tests/array_012.phpt]
PASS SPL: ArrayIterator::append [ext/spl/tests/array_013.phpt]
PASS SPL: ArrayIterator::seek() [ext/spl/tests/array_014.phpt]
PASS SPL: ArrayIterator::next() with internal arrays
[ext/spl/tests/array_015.phpt]
PASS Bug #28822 (ArrayObject::offsetExists() works inverted)
[ext/spl/tests/bug28822.phpt]
PASS Bug #31486 (ArrayIterator::next segfaults)
[ext/spl/tests/bug31346.phpt]
PASS Bug #31348 (CachingIterator::rewind() leaks)
[ext/spl/tests/bug31348.phpt]
FAIL Bug #31926 (php in free() error with RecursiveArrayIterator)
[ext/spl/tests/bug31926.phpt]
PASS SPL: Problem with casting to string [ext/spl/tests/dit_001.phpt]
PASS SPL: Iterator aggregating inner iterator's methods
[ext/spl/tests/iterator_001.phpt]
FAIL SPL: Iterator using getInnerIterator
[ext/spl/tests/iterator_002.phpt]
PASS SPL: CachingIterator and __toString()
[ext/spl/tests/iterator_003.phpt]
PASS SPL: SeekableIterator and string keys
[ext/spl/tests/iterator_004.phpt]
FAIL SPL: SimpleXMLIterator [ext/spl/tests/sxe_001.phpt]
FAIL SPL: SimpleXMLIterator and recursion [ext/spl/tests/sxe_002.phpt]
FAIL SPL: SimpleXMLIterator and getChildren()
[ext/spl/tests/sxe_003.phpt]

=====================================================================
Number of tests :   31                31
Tests skipped   :    0 (0.0%) --------
Tests warned    :    0 (0.0%) (0.0%)
Tests failed    :    6 (19.4%) (19.4%)
Tests passed    :   25 (80.6%) (80.6%)
---------------------------------------------------------------------
Time taken      :    6 seconds
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
SPL: ArrayIterator implementing RecursiveIterator
[ext/spl/tests/array_009.phpt]
Bug #31926 (php in free() error with RecursiveArrayIterator)
[ext/spl/tests/bug31926.phpt]
SPL: Iterator using getInnerIterator [ext/spl/tests/iterator_002.phpt]
SPL: SimpleXMLIterator [ext/spl/tests/sxe_001.phpt]
SPL: SimpleXMLIterator and recursion [ext/spl/tests/sxe_002.phpt]
SPL: SimpleXMLIterator and getChildren() [ext/spl/tests/sxe_003.phpt]
=====================================================================

------------------------------------------------------------------------

[2005-02-13 15:27:10] [EMAIL PROTECTED]

Please do the following:
php run-tests.php ext/spl
and copy the output here

if you have also this:
memcheck php ext/spl/tests/bug31926.php
but just report if it states any real errors besides the messages
stating that some memory is still accessible at program end.

For me the problem is solved both in HEAD and 5.0.4-dev but i don't use
FreeBSD.

------------------------------------------------------------------------

[2005-02-12 20:47:30] gms08701 at yahoo dot com

Ok, I was able to get something built from the snapshot.
Using the original script example, Im getting the same error as with
5.0.2/3 ->

$ /home/gsam/local/bin/php -v
PHP 5.0.4-dev (cli) (built: Feb 12 2005 14:35:12)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies
$ /home/gsam/local/bin/php -f z.php
int(0)
string(5) "world"
php in free(): warning: chunk is already free

------------------------------------------------------------------------

[2005-02-12 19:39:54] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.0-win32-latest.zip



------------------------------------------------------------------------

[2005-02-11 03:10:21] gms08701 at yahoo dot com

Description:
------------
Trying to create a RecursiveArrayIterator class, 
using currently available SPL classes.
Its generating this error ->
php in free(): warning: chunk is already free

Apparently it works on win2k ->
http://marc.theaimsgroup.com/?l=php-general&m=110807956115501&w=2

Reproduce code:
---------------
<?php

$array = array(0 => array('world'));

class RecursiveArrayIterator extends ArrayIterator implements
RecursiveIterator {
   function hasChildren() {
       return (is_array($this->current()));
   }

   function getChildren() {
       return new self($this->current());
   }
}

$it = new RecursiveIteratorIterator(new
RecursiveArrayIterator($array));
foreach($it as $key => $val) {
   var_dump($key, $val);
}

?>

Expected result:
----------------
$ php -f z.php
int(0)
string(5) "world"

Actual result:
--------------
$ php -f z.php
int(0)
string(5) "world"
php in free(): warning: chunk is already free


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=31926&edit=1

Reply via email to