ID:               31926
 User updated by:  gms08701 at yahoo dot com
 Reported By:      gms08701 at yahoo dot com
-Status:           Feedback
+Status:           Open
 Bug Type:         SPL related
 Operating System: FreeBSD 5.3
 PHP Version:      5.0.3
 Assigned To:      helly
 New Comment:

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]
=====================================================================


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

[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-12 18:56:22] gms08701 at yahoo dot com

I forgot to enter the results in my previous entry ->
$ php -f z.php
bool(true)
bool(true)


bool(true)

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

[2005-02-12 18:52:19] gms08701 at yahoo dot com

On what OS, are you trying your my example on??

Unfortunately, I dont have the knowledge on installing php on FreeBSD
(I normally install it via the port).  Im currently investigating if I
can overcome this.

But I was tinkering with the script this morning.
--
$array = array(0);

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));

while($result = $it->valid())
{
    var_dump($result);
    $it->next();
}

echo "\n\n";

while($result = (bool)each($array))
{
    var_dump($result);
}
--

Notice how the 1st while loop is returning (bool)TRUE *twice*, while
the 2nd loop is returning (bool)TRUE *once*. 
$it->valid() should return (bool)FALSE the second time it was run. 
Shouldn't it???

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/31926

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

Reply via email to