[PHP-BUG] Bug #65559 [NEW]: Opcache: cache not cleared if changes occur while running

2013-08-26 Thread zoeslam at gmail dot com
From: zoeslam at gmail dot com
Operating system: Ubuntu
PHP version:  5.5.3
Package:  opcache
Bug Type: Bug
Bug description:Opcache: cache not cleared if changes occur while running

Description:

The new Zend OPcache doesn't clear the cache if a file is changed on the
fly.

Instead the test script works well with opcache turned off
(opcache.enable=0).

Test script:
---
?php
$file = __DIR__.'/file.txt';
file_put_contents($file, '?php return 1;');
$var = include $file;
file_put_contents($file, '?php return 2;');
$var = include $file;
var_dump($var);

Expected result:

int(2)

Actual result:
--
int(1)

-- 
Edit bug report at https://bugs.php.net/bug.php?id=65559edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=65559r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=65559r=trysnapshot53
Try a snapshot (trunk): 
https://bugs.php.net/fix.php?id=65559r=trysnapshottrunk
Fixed in SVN:   https://bugs.php.net/fix.php?id=65559r=fixed
Fixed in release:   https://bugs.php.net/fix.php?id=65559r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=65559r=needtrace
Need Reproduce Script:  https://bugs.php.net/fix.php?id=65559r=needscript
Try newer version:  https://bugs.php.net/fix.php?id=65559r=oldversion
Not developer issue:https://bugs.php.net/fix.php?id=65559r=support
Expected behavior:  https://bugs.php.net/fix.php?id=65559r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=65559r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=65559r=submittedtwice
register_globals:   https://bugs.php.net/fix.php?id=65559r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65559r=php4
Daylight Savings:   https://bugs.php.net/fix.php?id=65559r=dst
IIS Stability:  https://bugs.php.net/fix.php?id=65559r=isapi
Install GNU Sed:https://bugs.php.net/fix.php?id=65559r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65559r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=65559r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=65559r=mysqlcfg



[PHP-BUG] Bug #62629 [NEW]: IteratorIterator doesn't delegate count() method

2012-07-21 Thread zoeslam at gmail dot com
From: zoeslam at gmail dot com
Operating system: Ubuntu 12.04
PHP version:  5.4.5
Package:  SPL related
Bug Type: Bug
Bug description:IteratorIterator doesn't delegate count() method

Description:

This bug report MAY be similar to:

https://bugs.php.net/bug.php?id=62616

But behave differently

Test script:
---
class MyFile extends SplFileObject
{
private $x = 10;
private $y = 20;

public function setX($x) { $this-x = $x; }
public function setY($y) { $this-y = $y; }

public function getX()   { return $this-x; }
public function count()  { return $this-y; }
}

$myFile = new MyFile(__FILE__);

var_dump($myFile-getX());
var_dump($myFile-count());

$myFile-setX(15);
$myFile-setY(25);

var_dump($myFile-getX());
var_dump($myFile-count());

$ii = new IteratorIterator($myFile);

var_dump($ii-getX());
var_dump($ii-count());

Expected result:

int(10)
int(20)
int(15)
int(25)
int(15)
int(25)

Actual result:
--
int(10)
int(20)
int(15)
int(25)
int(15)

Notice: Undefined property: IteratorIterator::$y in /tmp/it.php on line 12
NULL

-- 
Edit bug report at https://bugs.php.net/bug.php?id=62629edit=1
-- 
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=62629r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=62629r=trysnapshot53
Try a snapshot (trunk):  
https://bugs.php.net/fix.php?id=62629r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=62629r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=62629r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=62629r=alreadyfixed
Need backtrace:  
https://bugs.php.net/fix.php?id=62629r=needtrace
Need Reproduce Script:   
https://bugs.php.net/fix.php?id=62629r=needscript
Try newer version:   
https://bugs.php.net/fix.php?id=62629r=oldversion
Not developer issue: 
https://bugs.php.net/fix.php?id=62629r=support
Expected behavior:   
https://bugs.php.net/fix.php?id=62629r=notwrong
Not enough info: 
https://bugs.php.net/fix.php?id=62629r=notenoughinfo
Submitted twice: 
https://bugs.php.net/fix.php?id=62629r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=62629r=globals
PHP 4 support discontinued:  
https://bugs.php.net/fix.php?id=62629r=php4
Daylight Savings:https://bugs.php.net/fix.php?id=62629r=dst
IIS Stability:   
https://bugs.php.net/fix.php?id=62629r=isapi
Install GNU Sed: 
https://bugs.php.net/fix.php?id=62629r=gnused
Floating point limitations:  
https://bugs.php.net/fix.php?id=62629r=float
No Zend Extensions:  
https://bugs.php.net/fix.php?id=62629r=nozend
MySQL Configuration Error:   
https://bugs.php.net/fix.php?id=62629r=mysqlcfg



Bug #62616 [Com]: ArrayIterator::count() from IteratorIterator instance gives Segmentation fault

2012-07-21 Thread zoeslam at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=62616edit=1

 ID: 62616
 Comment by: zoeslam at gmail dot com
 Reported by:zoeslam at gmail dot com
 Summary:ArrayIterator::count() from IteratorIterator
 instance gives Segmentation fault
 Status: Verified
 Type:   Bug
 Package:SPL related
 Operating System:   Ubuntu 12.04
 PHP Version:5.4.5
 Assigned To:colder
 Block user comment: N
 Private report: N

 New Comment:

I've discovered a similar misbehaviour:

https://bugs.php.net/bug.php?id=62629


Previous Comments:

[2012-07-20 17:27:43] larue...@php.net

I've find the reason,  but seems not easy to fix.

$ii-count, will finally call to arrayObject-count (due to implemention of 
spl_dual_it_get_method).

but arrayObject-count will take the object as a spl_array_object, which is 
totally different struct with spl_dual_it_object, then in the 
spl_array_object_count_elements_helper , it will make the object struct 
mess(via 
update pos)


[2012-07-20 13:57:50] jpa...@php.net

I can reproduce on 5.3.14

I can only reproduce calling the method directly.
Calling count($ii) instead of $ii-count() wont segfault


[2012-07-20 12:54:55] f...@php.net

BT

#0  0x7fdfaf4221d8 in ?? ()
#1  0x00594a41 in spl_dual_it_free (intern=0x7fdfaf53fa20) at 
/opt/src/php-5.4.5/ext/spl/spl_iterators.c:1585
#2  spl_dual_it_dtor (_object=0x7fdfaf53fa20, handle=optimized out) at 
/opt/src/php-5.4.5/ext/spl/spl_iterators.c:2237
#3  0x006a7b20 in zend_objects_store_del_ref_by_handle_ex (handle=2, 
handlers=optimized out) at /opt/src/php-5.4.5/Zend/zend_objects_API.c:206
#4  0x006a7b63 in zend_objects_store_del_ref (zobject=0x7fdfaf53f990) 
at 
/opt/src/php-5.4.5/Zend/zend_objects_API.c:172
#5  0x00674082 in _zval_dtor (zvalue=optimized out) at /opt/src/php-
5.4.5/Zend/zend_variables.h:35
#6  _zval_ptr_dtor (zval_ptr=0x7fdfaf53fb30) at /opt/src/php-
5.4.5/Zend/zend_execute_API.c:438
#7  _zval_ptr_dtor (zval_ptr=0x7fdfaf53fb30) at /opt/src/php-
5.4.5/Zend/zend_execute_API.c:427
#8  0x0068e28b in zend_hash_apply_deleter (ht=ht@entry=0xd34508, 
p=p@entry=0x7fdfaf53fb18) at /opt/src/php-5.4.5/Zend/zend_hash.c:650
#9  0x0068fdd1 in zend_hash_reverse_apply (ht=0xd34508, 
apply_func=apply_func@entry=0x673f10 zval_call_destructor) at /opt/src/php-
5.4.5/Zend/zend_hash.c:804
#10 0x0067438b in shutdown_destructors () at /opt/src/php-
5.4.5/Zend/zend_execute_API.c:217
#11 0x006826c0 in zend_call_destructors () at /opt/src/php-
5.4.5/Zend/zend.c:925
#12 0x00624805 in php_request_shutdown (dummy=dummy@entry=0x0) at 
/opt/src/php-5.4.5/main/main.c:1723
#13 0x00726004 in do_cli (argc=2, argv=0x7fff5ea442f8) at /opt/src/php-
5.4.5/sapi/cli/php_cli.c:1174
#14 0x00428455 in main (argc=2, argv=0x7fff5ea442f8) at /opt/src/php-
5.4.5/sapi/cli/php_cli.c:1364


[2012-07-20 11:54:38] f...@php.net

Reproducible on Debian wheezy with 5.4.0 and 5.4.5.


[2012-07-20 08:13:34] vanidlesky dot jr at gmail dot com

VanZCool




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

https://bugs.php.net/bug.php?id=62616


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=62616edit=1


[PHP-BUG] Bug #62616 [NEW]: ArrayIterator::count() from IteratorIterator instance gives Segmentation fault

2012-07-20 Thread zoeslam at gmail dot com
From: zoeslam at gmail dot com
Operating system: Ubuntu 12.04
PHP version:  5.4.5
Package:  SPL related
Bug Type: Bug
Bug description:ArrayIterator::count() from IteratorIterator instance gives 
Segmentation fault

Description:

The code explains all, no idea why it happens.

Verified on Ubuntu and Slackware, both on PHP 5.4.3, PHP 5.4.4, PHP 5.4.5.

Test script:
---
$ai = new ArrayIterator(array(0,1));

var_dump($ai-count());

$ii = new IteratorIterator($ai);

var_dump($ii-count());


Expected result:

int(2)
int(2)

Actual result:
--
int(2)
int(2)
Segmentation fault

-- 
Edit bug report at https://bugs.php.net/bug.php?id=62616edit=1
-- 
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=62616r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=62616r=trysnapshot53
Try a snapshot (trunk):  
https://bugs.php.net/fix.php?id=62616r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=62616r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=62616r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=62616r=alreadyfixed
Need backtrace:  
https://bugs.php.net/fix.php?id=62616r=needtrace
Need Reproduce Script:   
https://bugs.php.net/fix.php?id=62616r=needscript
Try newer version:   
https://bugs.php.net/fix.php?id=62616r=oldversion
Not developer issue: 
https://bugs.php.net/fix.php?id=62616r=support
Expected behavior:   
https://bugs.php.net/fix.php?id=62616r=notwrong
Not enough info: 
https://bugs.php.net/fix.php?id=62616r=notenoughinfo
Submitted twice: 
https://bugs.php.net/fix.php?id=62616r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=62616r=globals
PHP 4 support discontinued:  
https://bugs.php.net/fix.php?id=62616r=php4
Daylight Savings:https://bugs.php.net/fix.php?id=62616r=dst
IIS Stability:   
https://bugs.php.net/fix.php?id=62616r=isapi
Install GNU Sed: 
https://bugs.php.net/fix.php?id=62616r=gnused
Floating point limitations:  
https://bugs.php.net/fix.php?id=62616r=float
No Zend Extensions:  
https://bugs.php.net/fix.php?id=62616r=nozend
MySQL Configuration Error:   
https://bugs.php.net/fix.php?id=62616r=mysqlcfg