Req #52190 [Bgs]: send php scripts finished message

2010-08-06 Thread christian dot gnoth at arcor dot de
Edit report at http://bugs.php.net/bug.php?id=52190&edit=1

 ID: 52190
 User updated by:christian dot gnoth at arcor dot de
 Reported by:christian dot gnoth at arcor dot de
 Summary:send php scripts finished message
 Status: Bogus
 Type:   Feature/Change Request
 Package:*Web Server problem
 Operating System:   Linux - Windows
 PHP Version:5.2.13
 Block user comment: N

 New Comment:

as the virus software applications are getting a message that the php
script has ended from the server and sending the output to the browser -
it should be possible to built a function for that, or?



as I saw it on different pc's - on few the output of the long running
script was visible immediately at the browser and on others the anti
virus software was holding the output until the end of the script.


Previous Comments:

[2010-08-07 01:19:58] johan...@php.net

See flush() and output buffer documentation. more can't be done.


[2010-06-26 13:05:02] christian dot gnoth at arcor dot de

Description:

Hello,

I have a long running PHP script - with Web-Browser Interface and MySQL
access.



The user starts a migration of data in MySQL - it can take a lot of
time. The script generates for each step it takes output and sends it to
the web browser.



I used output buffering.



On few PC the anti-virus software helds the output back and the user do
not gets any message. For long running task it may be difficult for the
user to decide if the script hangs or it is still active.



So I wanted send a PHP script finished message - so that the output is
released from the anti virus software and shown in the browser.



sending a HTTP header() 200 status code is not possible - I am getting a
warning: 'header already sent - output started at'

Test script:
---
wordpress plugin - joomla to wordpress migrator:



http://wordpress.org/extend/plugins/joomla-to-wordpress-migrator/

Expected result:

a function which sends PHP script status code from the server to the
browser.







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


Bug #52560 [Opn->Asn]: FilterIterator errantly returns null for first element

2010-08-06 Thread colder
Edit report at http://bugs.php.net/bug.php?id=52560&edit=1

 ID: 52560
 Updated by: col...@php.net
 Reported by:tobias382 at gmail dot com
 Summary:FilterIterator errantly returns null for first
 element
-Status: Open
+Status: Assigned
 Type:   Bug
 Package:SPL related
 Operating System:   Ubuntu 10.04
 PHP Version:5.3SVN-2010-08-07 (snap)
-Assigned To:
+Assigned To:colder
 Block user comment: N



Previous Comments:

[2010-08-07 04:49:28] tobias382 at gmail dot com

Small amendment: $iterator->rewind() should be $this->rewind() in the
overridden 

constructor in the test script.


[2010-08-07 04:40:26] tobias382 at gmail dot com

Description:

Even when a FilterIterator subclass accepts all elements, it returns
NULL for the 

first element in the original array. There are a few methods to correct
this 

behavior, noted in the attached test script.

Test script:
---
rewind();

}

*/

// Should cause all elements to be accepted

public function accept() {

return true;

}   

/* 

// Another way to force this class to produce expected behavior
below

public function current() {

return $this->getInnerIterator()->current();

}

*/

}



$array = array(1, 2); 



/*

// What should happen in subsequent blocks

$iterator1 = new ArrayIterator($array);

var_dump($iterator1->current()); // int(1)

$iterator1->next();

var_dump($iterator1->current()); // int(2)

$iterator1->next();

var_dump($iterator1->current()); // NULL

*/



// The problem

$iterator2 = new FooIterator(new ArrayIterator($array));

var_dump($iterator2->current()); // NULL <-- this should be int(1)

$iterator2->next();

var_dump($iterator2->current()); // int(2)

$iterator2->next();

var_dump($iterator2->current()); // NULL



// Exhibits correct behavior with no changes to FooIterator

$iterator3 = new FooIterator(new ArrayIterator($array));

$iterator3->rewind(); // This line shouldn't be needed, but is to force
expected behavior

var_dump($iterator3->current()); // int(1)

$iterator3->next();

var_dump($iterator3->current()); // int(2)

$iterator3->next();

var_dump($iterator3->current()); // NULL

Expected result:

int(1)

int(2)

NULL

int(1)

int(2)

NULL

Actual result:
--
NULL

int(2)

NULL

int(1)

int(2)

NULL






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


Bug #52560 [Com]: FilterIterator errantly returns null for first element

2010-08-06 Thread tobias382 at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=52560&edit=1

 ID: 52560
 Comment by: tobias382 at gmail dot com
 Reported by:tobias382 at gmail dot com
 Summary:FilterIterator errantly returns null for first
 element
 Status: Open
 Type:   Bug
 Package:SPL related
 Operating System:   Ubuntu 10.04
 PHP Version:5.3SVN-2010-08-07 (snap)
 Block user comment: N

 New Comment:

Small amendment: $iterator->rewind() should be $this->rewind() in the
overridden 

constructor in the test script.


Previous Comments:

[2010-08-07 04:40:26] tobias382 at gmail dot com

Description:

Even when a FilterIterator subclass accepts all elements, it returns
NULL for the 

first element in the original array. There are a few methods to correct
this 

behavior, noted in the attached test script.

Test script:
---
rewind();

}

*/

// Should cause all elements to be accepted

public function accept() {

return true;

}   

/* 

// Another way to force this class to produce expected behavior
below

public function current() {

return $this->getInnerIterator()->current();

}

*/

}



$array = array(1, 2); 



/*

// What should happen in subsequent blocks

$iterator1 = new ArrayIterator($array);

var_dump($iterator1->current()); // int(1)

$iterator1->next();

var_dump($iterator1->current()); // int(2)

$iterator1->next();

var_dump($iterator1->current()); // NULL

*/



// The problem

$iterator2 = new FooIterator(new ArrayIterator($array));

var_dump($iterator2->current()); // NULL <-- this should be int(1)

$iterator2->next();

var_dump($iterator2->current()); // int(2)

$iterator2->next();

var_dump($iterator2->current()); // NULL



// Exhibits correct behavior with no changes to FooIterator

$iterator3 = new FooIterator(new ArrayIterator($array));

$iterator3->rewind(); // This line shouldn't be needed, but is to force
expected behavior

var_dump($iterator3->current()); // int(1)

$iterator3->next();

var_dump($iterator3->current()); // int(2)

$iterator3->next();

var_dump($iterator3->current()); // NULL

Expected result:

int(1)

int(2)

NULL

int(1)

int(2)

NULL

Actual result:
--
NULL

int(2)

NULL

int(1)

int(2)

NULL






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


[PHP-BUG] Bug #52560 [NEW]: FilterIterator errantly returns null for first element

2010-08-06 Thread tobias382 at gmail dot com
From: 
Operating system: Ubuntu 10.04
PHP version:  5.3SVN-2010-08-07 (snap)
Package:  SPL related
Bug Type: Bug
Bug description:FilterIterator errantly returns null for first element

Description:

Even when a FilterIterator subclass accepts all elements, it returns NULL
for the 

first element in the original array. There are a few methods to correct
this 

behavior, noted in the attached test script.

Test script:
---
rewind();

}

*/

// Should cause all elements to be accepted

public function accept() {

return true;

}   

/* 

// Another way to force this class to produce expected behavior below

public function current() {

return $this->getInnerIterator()->current();

}

*/

}



$array = array(1, 2); 



/*

// What should happen in subsequent blocks

$iterator1 = new ArrayIterator($array);

var_dump($iterator1->current()); // int(1)

$iterator1->next();

var_dump($iterator1->current()); // int(2)

$iterator1->next();

var_dump($iterator1->current()); // NULL

*/



// The problem

$iterator2 = new FooIterator(new ArrayIterator($array));

var_dump($iterator2->current()); // NULL <-- this should be int(1)

$iterator2->next();

var_dump($iterator2->current()); // int(2)

$iterator2->next();

var_dump($iterator2->current()); // NULL



// Exhibits correct behavior with no changes to FooIterator

$iterator3 = new FooIterator(new ArrayIterator($array));

$iterator3->rewind(); // This line shouldn't be needed, but is to force
expected behavior

var_dump($iterator3->current()); // int(1)

$iterator3->next();

var_dump($iterator3->current()); // int(2)

$iterator3->next();

var_dump($iterator3->current()); // NULL

Expected result:

int(1)

int(2)

NULL

int(1)

int(2)

NULL

Actual result:
--
NULL

int(2)

NULL

int(1)

int(2)

NULL

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



[PHP-BUG] Bug #52559 [NEW]: Calling undefined method on FilterIterator subclasses causes segfault

2010-08-06 Thread tobias382 at gmail dot com
From: 
Operating system: Ubuntu 10.04
PHP version:  5.3SVN-2010-08-06 (snap)
Package:  SPL related
Bug Type: Bug
Bug description:Calling undefined method on FilterIterator subclasses causes 
segfault

Description:

The attached test script causes a segmentation fault in PHP 5.3.3 and the
current 

PHP 5.3 snapshot, presumably because count() is not a defined method in 

FooIterator or any of its ancestor classes.



The configure line used to compile the snapshot:



Configure Command =>  './configure'  '--prefix=/home/matt/Software/php5.3-

201008070030/build/php_build' '--without-pear' '--without-sqlite3'
'--without-

pdo-sqlite' '--without-sqlite' '--enable-debug'

Test script:
---
count();

Expected result:

PHP Fatal error:  Call to undefined method FooIterator::count() in test.php
on 

line 8

Actual result:
--
1Segmentation fault



gdb backtrace:



#0  0x02926cd0 in ?? ()

#1  0x00573929 in spl_dual_it_free (intern=0x2a089f0) at 

/home/matt/Software/php5.3-201008070030/ext/spl/spl_iterators.c:1461

#2  0x00574ebd in spl_dual_it_dtor (_object=0x2a089f0, handle=1) at


/home/matt/Software/php5.3-201008070030/ext/spl/spl_iterators.c:1942

#3  0x006ebbea in zend_objects_store_del_ref_by_handle_ex
(handle=1, 

handlers=0xcace80)

at /home/matt/Software/php5.3-201008070030/Zend/zend_objects_API.c:206

#4  0x006eba5f in zend_objects_store_del_ref (zobject=0x2a20e30) at


/home/matt/Software/php5.3-201008070030/Zend/zend_objects_API.c:172

#5  0x006bbca2 in _zval_dtor_func (zvalue=0x2a20e30, 

__zend_filename=0xa4e9a8 "/home/matt/Software/php5.3-

201008070030/Zend/zend_execute_API.c", 

__zend_lineno=443) at /home/matt/Software/php5.3-

201008070030/Zend/zend_variables.c:52

#6  0x006abbba in _zval_dtor (zvalue=0x2a20e30,
__zend_filename=0xa4e9a8 

"/home/matt/Software/php5.3-201008070030/Zend/zend_execute_API.c", 

__zend_lineno=443) at /home/matt/Software/php5.3-

201008070030/Zend/zend_variables.h:35

#7  0x006acb48 in _zval_ptr_dtor (zval_ptr=0x2a24158, 

__zend_filename=0xa50290 "/home/matt/Software/php5.3-

201008070030/Zend/zend_variables.c", 

__zend_lineno=178) at /home/matt/Software/php5.3-

201008070030/Zend/zend_execute_API.c:443

#8  0x006bc01f in _zval_ptr_dtor_wrapper (zval_ptr=0x2a24158) at 

/home/matt/Software/php5.3-201008070030/Zend/zend_variables.c:178

#9  0x006ce705 in zend_hash_apply_deleter (ht=0xcc4588,
p=0x2a24140) at 

/home/matt/Software/php5.3-201008070030/Zend/zend_hash.c:611

#10 0x006ced8e in zend_hash_reverse_apply (ht=0xcc4588, 

apply_func=0x6ac3f5 )

at /home/matt/Software/php5.3-201008070030/Zend/zend_hash.c:760

#11 0x006ac487 in shutdown_destructors () at
/home/matt/Software/php5.3-

201008070030/Zend/zend_execute_API.c:226

#12 0x006bd8db in zend_call_destructors () at 

/home/matt/Software/php5.3-201008070030/Zend/zend.c:874

#13 0x00647cec in php_request_shutdown (dummy=0x0) at 

/home/matt/Software/php5.3-201008070030/main/main.c:1587

#14 0x007a27db in main (argc=2, argv=0x7fffd4f78e68) at 

/home/matt/Software/php5.3-201008070030/sapi/cli/php_cli.c:1373

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

Bug #52519 [Com]: microseconds in DateInterval are missing

2010-08-06 Thread giorgio dot liscio at email dot it
Edit report at http://bugs.php.net/bug.php?id=52519&edit=1

 ID: 52519
 Comment by: giorgio dot liscio at email dot it
 Reported by:giorgio dot liscio at email dot it
 Summary:microseconds in DateInterval are missing
 Status: Assigned
 Type:   Bug
 Package:Date/time related
 Operating System:   xp x64 all
 PHP Version:5.3.3
 Assigned To:derick
 Block user comment: N

 New Comment:

sorry, bad link http://bugs.php.net/bug.php?id=52514


Previous Comments:

[2010-08-07 02:51:10] giorgio dot liscio at email dot it

hi thank you for accepting this bug



since ISO8601 does not specify how to treat microseconds



i think the best way to implement this is with seconds treated as
floats



"P10.342192S"



see http://bugs.php.net/bug.php?id=52519 too



again, thank you for this library and for your attention on my requests



:)


[2010-08-02 23:06:30] giorgio dot liscio at email dot it

Description:

hi, the property $seconds should be float or a $microseconds property is
missing in the class DateInterval



http://www.php.net/manual/en/class.dateinterval.php



thank you







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


Bug #52519 [Com]: microseconds in DateInterval are missing

2010-08-06 Thread giorgio dot liscio at email dot it
Edit report at http://bugs.php.net/bug.php?id=52519&edit=1

 ID: 52519
 Comment by: giorgio dot liscio at email dot it
 Reported by:giorgio dot liscio at email dot it
 Summary:microseconds in DateInterval are missing
 Status: Assigned
 Type:   Bug
 Package:Date/time related
 Operating System:   xp x64 all
 PHP Version:5.3.3
 Assigned To:derick
 Block user comment: N

 New Comment:

hi thank you for accepting this bug



since ISO8601 does not specify how to treat microseconds



i think the best way to implement this is with seconds treated as
floats



"P10.342192S"



see http://bugs.php.net/bug.php?id=52519 too



again, thank you for this library and for your attention on my requests



:)


Previous Comments:

[2010-08-02 23:06:30] giorgio dot liscio at email dot it

Description:

hi, the property $seconds should be float or a $microseconds property is
missing in the class DateInterval



http://www.php.net/manual/en/class.dateinterval.php



thank you







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


Bug #52514 [Com]: microseconds are missing in DateTime class

2010-08-06 Thread giorgio dot liscio at email dot it
Edit report at http://bugs.php.net/bug.php?id=52514&edit=1

 ID: 52514
 Comment by: giorgio dot liscio at email dot it
 Reported by:giorgio dot liscio at email dot it
 Summary:microseconds are missing in DateTime class
 Status: Assigned
 Type:   Bug
 Package:Date/time related
 Operating System:   all? xp x64
 PHP Version:5.3.3
 Assigned To:derick
 Block user comment: N

 New Comment:

hi, thank you for accepting this bug



microseconds must be stored for example in:



"now"

"+5 weeks"

"-7 weekdays"

"ago"



in practice, when the date-time is relative to "now"



in plus must works (and apparently works) full microseconds support when
datetime is instantiated through createFromFormat()



see http://bugs.php.net/bug.php?id=52519 too



thank you for creating this library, love oop dates :)


Previous Comments:

[2010-08-02 13:44:52] giorgio dot liscio at email dot it

Description:

hi



i expected to dump microseconds too when i use



new DateTime("now");

new DateTime(date('Y-m-d H:i:s.283020,time()));



but apparently they are not stored at all in datetime objects



echo date('Y-m-d H:i:s.u',microtime(true));



or in classical php functions



thank you







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


Bug #51610 [Wfx->Csd]: 1 second+ needed for OCI8 versus PDO/oci to open/close connection and exit

2010-08-06 Thread sixd
Edit report at http://bugs.php.net/bug.php?id=51610&edit=1

 ID: 51610
 Updated by: s...@php.net
 Reported by:marioroy at verizon dot net
 Summary:1 second+ needed for OCI8 versus PDO/oci to
 open/close connection and exit
-Status: Wont fix
+Status: Closed
 Type:   Bug
 Package:OCI8 related
 Operating System:   Linux & Snow Leopard
 PHP Version:5.3SVN-2010-04-20 (snap)
 Assigned To:sixd
 Block user comment: N

 New Comment:

The increase in exit cleanup time occurs when OCI8 1.3+ uses Oracle
10.2.0.4+ client libraries.



There is a resolution in OCI8 1.4.3.  An Oracle client library fix
(Oracle bug 9891199) is also needed for this patch to have an effect.



OCI8 1.4.3 will be included in the PHP release _after_ PHP 5.3.3.


Previous Comments:

[2010-08-07 02:24:28] s...@php.net

Automatic comment from SVN on behalf of sixd
Revision: http://svn.php.net/viewvc/?view=revision&revision=301960
Log: Fixed bug #51610 (Using oci_connect causes PHP to take a long time
to exit). Do PECL OCI8 1.4.3 release


[2010-07-08 07:37:56] s...@php.net

I wonder what issues the following patch would bring?





Index: oci8.c

===

--- oci8.c(revision 300858)

+++ oci8.c(working copy)

@@ -35,6 +35,7 @@

 #include "php.h"

 #include "ext/standard/info.h"

 #include "php_ini.h"

+#include "SAPI.h"

 #include "ext/standard/php_smart_str.h"



 #if HAVE_OCI8

@@ -3187,7 +3188,11 @@

 PHP_OCI_CALL(OCIHandleFree, ((dvoid *) session_pool->err, 

OCI_HTYPE_ERROR));

 }



-if (session_pool->env) {

+/* When PHP is invoked as a CLI then destruction of the

+ * Environment handle is left to the OS at PHP process shutdown.

+ */

+if (session_pool->env && !sapi_module.phpinfo_as_text) {

 PHP_OCI_CALL(OCIHandleFree, ((dvoid *) session_pool->env, 

OCI_HTYPE_ENV));

 }


[2010-06-26 05:44:43] marioroy at verizon dot net

I have applied this patch to oci8.c.  It resolves the issue for me.  I
set 

use_spool to 0.  Can we have use_spool enabled/disabled via an oci8.ini


directive.  Thanks.



@@ -1711,7 +1693,7 @@

smart_str hashed_details = {0};

time_t timestamp;

php_oci_spool *session_pool = NULL;

-   zend_bool use_spool = 1;   /* Default is to use
client-side 

session pool */

+   zend_bool use_spool = 0;   /* Default is to use
client-side 

session pool */

zend_bool ping_done = 0;


[2010-06-18 04:19:45] s...@php.net

The PHP OCI8 code changes in question have been in production for two

years.  They were introduced to support Database Resident Connection

Pooling and FAN for scalability in web apps.  The dominant use cases

for SQL*Plus and PHP are very different.


[2010-06-17 15:29:25] chris at leaflock dot net

I filed a duplicate bug, but I noticed something unique; It doesn't
happen with Oracle 10.2.0.3.



I'm pretty unhappy about this, what is the benefit and/or requirement
for this behavior, and why does it not happen in 10.2.0.3?



Oracle's own SQLPlus doesn't display this behavior.  I never thought I'd
see the day when SQLPlus could do something faster for me than PHP.




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/bug.php?id=51610


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


Bug #52479 [Opn->Bgs]: Object destructor does not get called on fatal error

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=52479&edit=1

 ID: 52479
 Updated by: johan...@php.net
 Reported by:php-bugs at majkl578 dot cz
 Summary:Object destructor does not get called on fatal error
-Status: Open
+Status: Bogus
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   Linux Debian
 PHP Version:5.3.3
 Block user comment: N

 New Comment:

Fatal Errors keep the engine in undefined state we can't rely on the
availability of the destructor anymore.


Previous Comments:

[2010-07-29 03:11:45] php-bugs at majkl578 dot cz

Description:

Class destructor does not get called when the script end with fatal
error (eg. unknown function, uncaught exception etc.).

Test script:
---
class Foo {

function __destruct() {

touch('/tmp/foo');

}

}



$x = new Foo;



throw new Exception;

Expected result:

New file /tmp/foo

Actual result:
--
Nothing






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


Req #52139 [Opn->Wfx]: Method name conflict

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=52139&edit=1

 ID: 52139
 Updated by: johan...@php.net
 Reported by:juwe at clasennet dot de
 Summary:Method name conflict
-Status: Open
+Status: Wont fix
 Type:   Feature/Change Request
 Package:SPL related
 Operating System:   Doesn't matter
 PHP Version:Irrelevant
 Block user comment: N

 New Comment:

We can't "simply" rename them unfortunately.


Previous Comments:

[2010-06-22 11:01:03] juwe at clasennet dot de

Description:

Could you please solve the method name conflict between SplObjectStorage
ans SplSubject?



Since SplObjectStorage is the closest available thing to an object map,
it is a prior candidate to being a subject in an observer design
pattern. Since both, the interface and the class itself use the method
names attach and detach, this constellation isn't really feasible at the
moment.



Please take a look at the example below.



Neither attach(), nor detach() are really necessary for
SplObjectStorage. Both their behavior could be implemented using
offsetSet() and offsetUnset(). If they are necessary at all, could you
please call them append() and remove() for example? 



Or could you maybe add a suffix "Observer(s)" to the methods of
SplSubject?



Both would enable us to implement the observer design pattern on
SplObjectStorage in derived classes. 

Test script:
---
class MyObjectMap extends SplObjectStorage implements SplSubject

{

  public function offsetSet($key,$value)

  {

// check types of $key and $value and call parent method

  }

  public function offsetGet($key,$value)

  {

// check existance of $key and return result of public method

  }



  public function attach(SplObserver o) // fails with a naming conflict

  {

// store observer for later notification

  }

}



class MyObjectMapHandler implements SplObserver

{

  // implements update method and reacts to changes of MyObjectMap

}

Expected result:

A possibility to have observable lists, as it is possible with classes
derived from ArrayObject, SplHeap, and so on

Actual result:
--
Probably: An error message because of the name clash.






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


Bug #51766 [Opn->Asn]: SplFileInfo::isLink() Fails for Symlinks on windows

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=51766&edit=1

 ID: 51766
 Updated by: johan...@php.net
 Reported by:v-sumada at microsoft dot com
 Summary:SplFileInfo::isLink()  Fails for Symlinks on windows
-Status: Open
+Status: Assigned
 Type:   Bug
 Package:SPL related
 Operating System:   All Windows OS
 PHP Version:5.3.2
-Assigned To:
+Assigned To:pajoye
 Block user comment: N

 New Comment:

Pierre, I think you played with symlinks on Windows before, can you add
the magic needed, here?


Previous Comments:

[2010-05-07 19:08:08] v-sumada at microsoft dot com

Description:

SplFileInfo::isLink()  Which returns False for Symbolic links on all 
windows OS. we have a  File Symbolic link created  for a file and tried
to test whether the referenced file  by SplFileInfo is symbolic link or
not.





In the above script we have a symlink(filesymlink)created for a file
'testfile'  and tried to check with the file_exists function for
symlink(filesymlink) which returns true and it returns false for the
SplFileInfo::isLink().





Test script:
---
isLink());

?>

Expected result:

bool(true)

bool(true)

Actual result:
--
bool(true)

bool(false)






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


Bug #51804 [Opn->Asn]: SplFileInfo::getLinkTarget() Fails.

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=51804&edit=1

 ID: 51804
 Updated by: johan...@php.net
 Reported by:v-sumada at microsoft dot com
 Summary:SplFileInfo::getLinkTarget() Fails.
-Status: Open
+Status: Assigned
 Type:   Bug
 Package:SPL related
 Operating System:   All Windows OS
 PHP Version:5.3SVN-2010-05-13 (SVN)
-Assigned To:
+Assigned To:pajoye
 Block user comment: N

 New Comment:

Pierre, I think you played with symlinks before, can you add the magic
needed, here?


Previous Comments:

[2010-05-13 03:36:36] v-sumada at microsoft dot com

Description:

SplFileInfo::getLinkTarget() fails .we have a filesymlink created  for a
file (filesymbolic.txt)  and tried to read the target of the filesymlink
created and it returns an error .This happens for Directory also.



When this Function used on accessing symlinks over remote share  it
returns an error with 'Bad File Descriptor'.

Test script:
---
getLinkTarget());

?>

Expected result:

bool(true)

string(16) filesymbolic.txt

Actual result:
--
bool(true)

Fatal error: Uncaught exception 'RuntimeException' with message 'Unable
to read link C:\Program Files (x86)\Apache Software
Foundation\Apache2.2\htdocs\symlinktodir, error: No such file or
directory' in C:\Program Files (x86)\Apache Software
Foundation\Apache2.2\htdocs\getLinkTarget.php:5 Stack trace: #0
C:\Program Files (x86)\Apache Software
Foundation\Apache2.2\htdocs\getLinkTarget.php(5):
SplFileInfo->getLinkTarget() #1 {main} thrown in C:\Program Files
(x86)\Apache Software Foundation\Apache2.2\htdocs\getLinkTarget.php on
line 5










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


Req #51922 [Opn->Bgs]: Controlled typecasting for objects that implement the "Countable" interface

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=51922&edit=1

 ID: 51922
 Updated by: johan...@php.net
 Reported by:korchasa at gmail dot com
 Summary:Controlled typecasting for objects that implement
 the "Countable" interface
-Status: Open
+Status: Bogus
 Type:   Feature/Change Request
 Package:SPL related
 Operating System:   Any
 PHP Version:5.3.2
 Block user comment: N

 New Comment:

Even with count() returning null an object often is a "true" value and
we decided not to add other casting functions (other than __toString())


Previous Comments:

[2010-05-26 15:06:27] korchasa at gmail dot com

Description:

Now we have no ways to controll type casting of Countable-objects to
boolean 

type. We would like to work with the SPL-derivatives, as well as with
the built-

in types.

Test script:
---
http://bugs.php.net/bug.php?id=51922&edit=1


Req #52300 [Opn->Wfx]: spl_get_object_by_hash()

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=52300&edit=1

 ID: 52300
 Updated by: johan...@php.net
 Reported by:olamedia at gmail dot com
 Summary:spl_get_object_by_hash()
-Status: Open
+Status: Wont fix
 Type:   Feature/Change Request
 Package:SPL related
 PHP Version:5.3.3RC2
 Block user comment: N

 New Comment:

There's no good way to implement this.


Previous Comments:

[2010-07-11 13:24:51] olamedia at gmail dot com

Of course, the real problem is in garbage collector, which can't handle


crossreferences. This function is quicker to-do alternative.


[2010-07-11 12:26:17] cataphr...@php.net

If you want weak references, this seems like a poor substitute. Who
would want to store a reference that may yield another object in the
future?


[2010-07-09 07:41:21] olamedia at gmail dot com

Description:

class a{}

$object = new a();

$object2 = spl_get_object_by_hash(spl_object_hash($object));

var_dump($object === $object2); // true (same object)



NOTE: When using spl_get_object_by_hash, you must know that $object must
be alive 

else function can return another object.



Primary usage example in test script:

Test script:
---
class a{

  protected $_b;

  public function getB(){

 return spl_get_object_by_hash($this->_b);

  }

  public function doSomething(){

$b = $this->getB();

// here I can use $b !

  }

  public function __construct($b){

 $this->_b = spl_object_hash($b);

  }

}

class b{

  protected $_a;

  public function getA(){

 return $this->_a;

  }

  public function __construct(){

 $this->_a = new a($this);

  }

  public function __destruct(){

echo 'destroyed';

  }

}

$b = new b();

$b->getA()->doSomething();

unset($b); // destroyed  !! this IS NOT POSSIBLE without
spl_get_object_by_hash()







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


Req #52385 [Opn]: Support for autoloading functions

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=52385&edit=1

 ID: 52385
 Updated by: johan...@php.net
 Reported by:php-bugs at majkl578 dot cz
 Summary:Support for autoloading functions
 Status: Open
 Type:   Feature/Change Request
 Package:SPL related
 Operating System:   Irrelevant
 PHP Version:5.3.3RC3
 Block user comment: N

 New Comment:

With classes you often have one class per file, with functions not which
makes the lookup usually way more complex; I don't see us adding this.


Previous Comments:

[2010-07-24 07:00:14] php-bugs at majkl578 dot cz

Decoded version (really nice bug :)):



Would it be possible to add a support for autoloading user-defined
functions? Currently only classes are supported by either __autoload or
spl_autoload or spl_autoload_register.



Including all functions is really awful job whereas classess could be
autoloaded nicely (imagine implementation for spl_autoload_register
which scans a directory for classess and then includes specific file).



I suggest to make possible something similar to the example above for
normal functions (global as well as those in namespaces).



PS: I know that it could be hacked by emulating namespace with class
(eg. static method String::webalize()) but since PHP 5.3 it would be
probably nicier not to hack it with classes, but place it to namespace
as a regular function (String\webalize()).


[2010-07-21 05:29:55] php-bugs at majkl578 dot cz

Description:

Would it be possible to add a support for autoloading user-defined
functions? Currently only classes are supported by either __autoload or
spl_autoload or spl_autoload_register.

Including all
functions is really awful job whereas classess could be autoloaded
nicely (imagine implementation for spl_autoload_register which scans a
directory for classess and then includes specific
file).

I suggest to make possible something similar
to the example above for normal functions (global as well as those in
namespaces).

PS: I know that it could be hacked by
emulating namespace with class (eg. static method String::webalize())
but since PHP 5.3 it would be probably nicier not to hack it with
classes, but place it to namespace as a regular function
(String\webalize()).







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


Req #7028 [Ana->Bgs]: xml=shared and wddx do not work together

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=7028&edit=1

 ID: 7028
 Updated by: johan...@php.net
 Reported by:ipv4 at mail dot ru
 Summary:xml=shared and wddx do not work together
-Status: Analyzed
+Status: Bogus
 Type:   Feature/Change Request
-Package:Feature/Change Request
+Package:*General Issues
 Operating System:   Linux
 PHP Version:4.0.3RC2
 Block user comment: N

 New Comment:

XML stuff was redone in PHP 5.


Previous Comments:

[2010-07-02 00:15:19] gmblar+php at gmail dot com

$ php -r "wddx_deserialize('foo');"



dyld: lazy symbol binding failed: Symbol not found: _XML_ParserCreate

  Referenced from:
/usr/lib/php/extensions/no-debug-non-zts-20090626/wddx.so

  Expected in: flat namespace



dyld: Symbol not found: _XML_ParserCreate

  Referenced from:
/usr/lib/php/extensions/no-debug-non-zts-20090626/wddx.so

  Expected in: flat namespace



Trace/BPT trap


[2000-11-29 08:39:07] s...@php.net

I guess yes, this is by design. If you build WDDX, session

module uses it, so you have to build it statically. If you

have WDDX as static, you need XML to be static too, since

WDDX uses XML.



So, while it'd be nice to have such a possibility, currently

it doesn't work by design.



Thus I reclassify it as feature request.


[2000-11-29 04:41:24] sni...@php.net

reclassified


[2000-10-05 01:46:43] ipv4 at mail dot ru

configure ... --with-xml=shared --enable-wddx



or



--with-xml=shared --enable-wddx=shared



doesn't work. wddx support is always compiled in statically 

and resulting module (or standalone php) becomes unusable as it contains
unresolved symbols from xml module.



Currently the only way to build php with xml and wddx is to build xml
support statically. :( Is that by design?









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


Req #7006 [Opn]: preg_replace ( string pattern, array replacement, string subject );

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=7006&edit=1

 ID: 7006
 Updated by: johan...@php.net
 Reported by:joel dot jacobson at mobigym dot se
 Summary:preg_replace ( string pattern, array replacement,
 string subject );
 Status: Open
 Type:   Feature/Change Request
-Package:Feature/Change Request
+Package:*General Issues
 Operating System:   Linux 2.4.0-test7
 PHP Version:4.0.2
 Block user comment: N

 New Comment:

.


Previous Comments:

[2002-06-08 10:06:49] bigredlinux at yahoo dot com

I meant to say "pass it an array of matches and an array of
replacements"


[2002-06-08 10:06:14] bigredlinux at yahoo dot com

First of all, using preg_replace here is a sin!  You should be using
str_replace, and if you were using str_replace you would not have to
worry, since it has this feature.  But, assuming that you did need to
match a regular expression, well, then just do array_fill for your
search and pass it an array of matches and an array of keys and you will
be good to go.  So no, you don't really need this feature.


[2000-10-04 02:52:34] joel dot jacobson at mobigym dot se

''If pattern is an array and replacement is a string; then this
replacement string is used for every value of pattern. The converse
would not make sense, though.''
(http://www.php.net/manual/function.preg-replace.php)



I don't agree. The converse is a feature that I would like to be
available.



Have a look at the following example:

%col%%col%%col%';

$htmlDoc = preg_replace ( '/%col%/', $tvPrograms, $data );

print $htmlDoc;

?>



This will not work. But wouldn't it be nice if it did?

That is, replace match number n with $tvPrograms[n] in $data.



Thanks in advance for any comments.

Best regards, Joel Jacobson





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


Req #6932 [Opn->Bgs]: Filesize / File_exists and include_path

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=6932&edit=1

 ID: 6932
 Updated by: johan...@php.net
 Reported by:richard dot heyes at heyes-computing dot net
 Summary:Filesize / File_exists and include_path
-Status: Open
+Status: Bogus
 Type:   Feature/Change Request
-Package:Feature/Change Request
+Package:*General Issues
 Operating System:   Any
 PHP Version:4.0.2
 Block user comment: N

 New Comment:

.


Previous Comments:

[2009-05-13 08:27:56] gw at spamspamspam dot fsnet dot co dot uk

Please add bzopen to the list of functions that really should support
"use_include_path".  



Having to code full paths or loop through the include_path manually is
amateurish for a language this evolved. :(


[2009-03-06 16:46:41] paul at edunation dot co dot uk

This is one of those things that really should be added... Why am I
still looping though the include paths?



$array = explode(PATH_SEPARATOR, get_include_path());



Come on, let's fix this in under 10 years!


[2008-10-29 18:23:00] b_farrell60 at hotmail dot com

Ping!  This is still important (to me).


[2008-06-08 17:44:32] pablo at rauzy dot name

This is another request for this feature. This has already been said :
__autoload users need this feature !


[2007-02-18 16:36:19] zzarbi at free dot fr

Moreover with auload we can't "officialy" get an excepetion so add this
parameter to this function is very important !!!




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/bug.php?id=6932


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


Req #6911 [Opn->Bgs]: Problem with array_merge(_recursive)

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=6911&edit=1

 ID: 6911
 Updated by: johan...@php.net
 Reported by:john at elysium dot ltd dot uk
 Summary:Problem with array_merge(_recursive)
-Status: Open
+Status: Bogus
 Type:   Feature/Change Request
-Package:Feature/Change Request
+Package:*General Issues
 Operating System:   RH 6.2
 PHP Version:4.0.2
 Block user comment: N

 New Comment:

array_combine meanwhile exists


Previous Comments:

[2000-09-27 21:25:13] john at elysium dot ltd dot uk

I had a problem with array_merge_recursive, in that I wanted any
replicated content (by key) in the source array, to replace (and not be
added to) the destination array.  I wanted this as I was updating
HTTP_SESSION_VARS with HTTP_POST_VARS



e.g.



Using array_merge_recursive:



$source = array("new_value", "string_key" => array("bob", "billy",
"fred"));

$destination = array("value", "string_key" => array("bob", "frank",
"fred"), "another_value"); 



Resulting array will be:



 array("value", "string_key" => array("bob", "frank", "fred", "bob",
"billy", "fred"), "another_value", "new_value");



I required  the output to be:



array("new_value",  "string_key" => array("bob", "billy", "fred"),
"another_value");



Rgds



John Legg



diff -cPr php-4.0.2.orig/ext/standard/array.c
php-4.0.2/ext/standard/array.c

*** php-4.0.2.orig/ext/standard/array.c Tue Aug 22 19:39:29 2000

--- php-4.0.2/ext/standard/array.c  Wed Sep 27 15:00:00 2000

***

*** 1832,1837 

--- 1832,1919 

  }

  /* }}} */



+ static void php_array_combine_impl(HashTable *dest, HashTable *src,
int recursive)

+ {

+   zval**src_entry, **dest_entry;

+   char*string_key;

+   ulong   num_key;

+

+   zend_hash_internal_pointer_reset(src);

+   while(zend_hash_get_current_data(src, (void **)&src_entry) ==
SUCCESS) {

+   switch (zend_hash_get_current_key(src, &string_key,
&num_key)) {

+   case HASH_KEY_IS_STRING:

+   if (recursive && (*src_entry)->type ==
IS_ARRAY &&

+   zend_hash_find(dest, string_key,
strlen(string_key) + 1,

+  (void
**)&dest_entry) == SUCCESS) {

+  
php_array_combine_impl(Z_ARRVAL_PP(dest_entry),

+   
Z_ARRVAL_PP(src_entry), recursive);

+   } else {

+   (*src_entry)->refcount++;

+   zend_hash_update(dest,
string_key, strlen(string_key)+1,

+   
src_entry, sizeof(zval *), NULL);

+   }

+   efree(string_key);

+   break;

+

+   case HASH_KEY_IS_LONG:

+   (*src_entry)->refcount++;

+   if (zend_hash_index_exists(dest,
num_key)) {

+   zend_hash_index_update(dest,
num_key, src_entry, sizeof(zval *), NULL);

+   } else {

+  
zend_hash_next_index_insert(dest, src_entry, sizeof(zval *), NULL);

+   }

+   break;

+   }

+   zend_hash_move_forward(src);

+   }

+ }

+

+ static void php_array_combine(INTERNAL_FUNCTION_PARAMETERS, int
recursive)

+ {

+   zval  ***args = NULL;

+   int  argc,

+i;

+

+   /* Get the argument count and check it */

+   argc = ZEND_NUM_ARGS();

+   if (argc < 2) {

+   WRONG_PARAM_COUNT;

+   }

+

+   /* Allocate arguments array and get the arguments, checking for
errors. */

+   args = (zval ***)emalloc(argc * sizeof(zval **));

+   if (zend_get_parameters_array_ex(argc, args) == FAILURE) {

+   efree(args);

+   WRONG_PARAM_COUNT;

+   }

+

+   array_init(return_value);

+

+   for (i=0; ihttp://bugs.php.net/bug.php?id=6911&edit=1


Req #6680 [Opn->Bgs]: regexps (ereg*) ignores locale settings

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=6680&edit=1

 ID: 6680
 Updated by: johan...@php.net
 Reported by:mbravo at tag-ltd dot spb dot ru
 Summary:regexps (ereg*) ignores locale settings
-Status: Open
+Status: Bogus
 Type:   Feature/Change Request
-Package:Feature/Change Request
+Package:*General Issues
 Operating System:   FreeBSD 4.1-RELEASE
 PHP Version:4.0.1pl2
 Block user comment: N

 New Comment:

ereg is deprecated in favor of preg


Previous Comments:

[2001-08-31 06:32:07] san...@php.net

Moved to feature request.


[2000-09-17 16:30:36] s...@php.net

You may want to use PCRE extension - it supports locale settings.


[2000-09-12 05:54:33] mbravo at tag-ltd dot spb dot ru

");

} else {

  printf("not alnum");

}

 

?>



when invoked with $t1= (example
- "×ÁÓÑ") and correct locale settings (see below) prints "not alnum"



while at the command line grep -E with the same input matches:



---

mbr...@tag-ltd:pages$ grep -E '[[:alnum:]]+'

×ÁÓÑ

×ÁÓÑ

---





PHP configured as - 



'./configure' '--prefix=/opt/www' '--with-apxs=/opt/www/bin/apxs'

'--with-mod_charset' '--with-mysql=/opt' '--with-pgsql=/opt'



posix

Revision$Revision: 1.17 $



LANG  ru_RU.KOI8-R

HTTP_ENV_VARS["LANG"] ru_RU.KOI8-R









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


Req #6574 [Opn->Bgs]: SMTP functions via IMAP c-client library

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=6574&edit=1

 ID: 6574
 Updated by: johan...@php.net
 Reported by:cahagn_o at epita dot fr
 Summary:SMTP functions via IMAP c-client library
-Status: Open
+Status: Bogus
 Type:   Feature/Change Request
-Package:Feature/Change Request
+Package:*General Issues
 Operating System:   Any
 PHP Version:4.0 Latest CVS (06/09/2000)
 Block user comment: N

 New Comment:

c-client itself isn't maintained properly anymore, we won't add
fucntions from there, there exist good PHP-space SMTP libs nowadays.


Previous Comments:

[2000-09-06 07:51:25] cahagn_o at epita dot fr

Is adding support for SMTP functions through IMAP c-client

library planned ?



pop3, imap and nntp work fine but I'd like to see smtp

functions too, as I don't want to use mail() function on my

system for various reason.



I know the IMAP c-client library already support SMTP, it

"just" needs to be "enabled" in PHP.





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


Req #6512 [Ana->Bgs]: sort() Does not sort stings as expected

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=6512&edit=1

 ID: 6512
 Updated by: johan...@php.net
 Reported by:jmo...@php.net
 Summary:sort() Does not sort stings as expected
-Status: Analyzed
+Status: Bogus
 Type:   Feature/Change Request
-Package:Feature/Change Request
+Package:*General Issues
 Operating System:   *
 PHP Version:4.0.2
 Block user comment: N

 New Comment:

Expected behavior.


Previous Comments:

[2000-09-03 08:35:55] jmo...@php.net

OK Chaning to feature/change request and reopening. (The function isnt
really misbehaving...)


[2000-09-03 08:31:45] waldschr...@php.net

well, natcasesort() does this for natural sorting, but

regular/string/numeric sorting can´t be sorted cased...

not sure if it should be closed...


[2000-09-03 08:26:36] jmo...@php.net

natcasesort() and natsort() do this, I will add a see also for
natcasesort to sort.


[2000-09-03 07:21:36] waldschr...@php.net

I´d vote for adding another option to all sorting functions,

like SORT_CASED, maybe the bit way



asort($x,SORT_STRING|SORT_CASED)




[2000-09-03 07:12:43] jmo...@php.net

When using sort, it sorts by ASCII code and not alphabetically, this
might be what was intended but the function does not behave as might be
expected, take the following example:







Does not ourput



AA,Ab,AC,AJ,AR



But infact



AA,AC,AJ,AR,Ab



Now this is due to Ascii Char codes. Perhaps a warning should be added
to the manual if this behaviour stays the same.



James





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


Req #6427 [Opn->Bgs]: func_get_arg() does not support references

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=6427&edit=1

 ID: 6427
 Updated by: johan...@php.net
 Reported by:waldschr...@php.net
 Summary:func_get_arg() does not support references
-Status: Open
+Status: Bogus
 Type:   Feature/Change Request
-Package:Feature/Change Request
+Package:*General Issues
 Operating System:   *
 PHP Version:4.0.1pl2
 Block user comment: N

 New Comment:

this isn't possiblewith the engine and since PHP 5 way less needed.


Previous Comments:

[2003-01-18 14:53:21] moriyo...@php.net

There are the same requests as this one:



Bug #14705

Bug #15098

Bug #16464




[2000-09-23 12:22:57] j...@php.net

Stas:

 If I possible, I would like to better understand you statement...here
is what I am thinking you mean,

please correct me if I am wrong:

$o=1;

test($o);

echo $o;

function test() {

   $a = &func_get_args();

   /** $a[0] has already been passed as a copy. We have no idea what to
reference it back to! */

}


[2000-09-20 21:40:09] waldschr...@php.net

a function func_get_rarg() should avoid this by treating any function
parameter as a reference (if possible), moved to feature request


[2000-09-20 18:23:08] s...@php.net

I fear this cannot be done - you should pass a variable by reference
from the start, otherwise you will just assign a reference to a copy.


[2000-08-29 21:38:56] waldschr...@php.net

func_get_arg() does not support references (see example),



$o=1;

test($o);

echo $o;

function test() {

   $l=&func_get_arg(0);

   $l=2; }



displays 1, should 2, I think it should be possible changing this
without impact, if not perhaps a func_get_rarg() be fine





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


Req #5804 [Opn->Bgs]: parser error if any spaces follow indentifier in with here doc syntax

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=5804&edit=1

 ID: 5804
 Updated by: johan...@php.net
 Reported by:goforth at worldempires dot com
 Summary:parser error if any spaces follow indentifier in
 with here doc syntax
-Status: Open
+Status: Bogus
 Type:   Feature/Change Request
-Package:Feature/Change Request
+Package:*General Issues
 Operating System:   Linux
 PHP Version:4.0.0
 Block user comment: N

 New Comment:

Wechanged the parser quite heavil over ten years. closing this bug.


Previous Comments:

[2000-07-27 13:00:57] hholz...@php.net

feature request: whitespace behind a label 

shouldn't matter


[2000-07-27 12:45:23] s...@php.net

label should be immediately followed by newline (i.e., no spaces). 


[2000-07-27 12:00:25] hholz...@php.net

"... such as here with the space represented by a # ..."



please do a s/#/ /  before reading the statement

to see what it is all about 



re-opened


[2000-07-27 11:07:53] s...@php.net

EOD# is not a valid identifier.


[2000-07-27 00:34:20] goforth at worldempires dot com

When using the multi-line echo (here doc syntax) if there are any spaces
immediatly following the indenifier, such as here with the space
represented by a #



echo <

Req #5601 [Ana->Wfx]: @function() should not turn of error reporting for critical errors

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=5601&edit=1

 ID: 5601
 Updated by: johan...@php.net
 Reported by:hartmut at six dot de
 Summary:@function() should not turn of error reporting for
 critical errors
-Status: Analyzed
+Status: Wont fix
 Type:   Feature/Change Request
-Package:Feature/Change Request
+Package:*General Issues
 Operating System:   *
 PHP Version:4.0.1pl2
 Block user comment: N

 New Comment:

The purpose of @ is to silence all down


Previous Comments:

[2000-07-28 18:26:29] hholz...@php.net

or maybe we could add another error type

called E_UNIGNORABLE_ERROR ...


[2000-07-28 18:19:08] hholz...@php.net

so i would suggest the following patch:



zend_execute.c line 2330ff

  case ZEND_BEGIN_SILENCE:

Ts[opline->result.u.var].tmp_var.value.lval = EG(error_reporting);

Ts[opline->result.u.var].tmp_var.type = IS_LONG;  

-   EG(error_reporting) = 0;

+   EG(error_reporting) = E_ERROR | E_USER_ERROR; 

NEXT_OPCODE();




[2000-07-26 22:02:44] z...@php.net

This is certainly not a misbehaving function problem!


[2000-07-15 10:11:50] hholzgra at cvs dot php dot net

yes, but on *critical* errors (and i was refering 

only to those) php terminates so that i have no

chance to check anything



this is what this report is about 


[2000-07-15 09:29:56] sterling at cvs dot php dot net

The purpose of the '@' is to turn off errors surrounding the function
and leave you to do the checking.




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/bug.php?id=5601


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


Req #5575 [Opn]: open_basedir to ~

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=5575&edit=1

 ID: 5575
 Updated by: johan...@php.net
 Reported by:greg at netserv dot net dot au
 Summary:open_basedir to ~
 Status: Open
 Type:   Feature/Change Request
-Package:Feature/Change Request
+Package:*General Issues
 Operating System:   Linux
 PHP Version:4.0.1pl2
 Block user comment: N

 New Comment:

This won't make sense in mostconfiguartions, it can be setper vhost in
httpd.conf, though.


Previous Comments:

[2000-07-14 04:56:20] greg at netserv dot net dot au

is it possible to make open_basedir setable to ~ so the base of the
script can be the home directory of the owner of the script.

I have set it to . so one users cant just do a fopen on another users
scripts

This has the side effect that using mutiple directories for a set of
scripts is very tricky as the scripts cant include files from
directories next to or below them selves. 



I havent fully tested this but it also seems that the restrictions that
mean you cant create a file in safe mode with open_basedir set seem to
mean that the tmp_uploads arent possible Is it possible to make
tmp_uploaddir  also setable to ~/tmp



or allow tmp_upload to over ride the create restrictions to allow for
dynamic tempoary file names.



It seems to me that many people are relying on the security of their
phpscripts when another user on the system can simply read their files
useing the common "nobody" permissions



Thanks Greg









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


Req #5169 [Opn->Bgs]: Missing recursive behavior

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=5169&edit=1

 ID: 5169
 Updated by: johan...@php.net
 Reported by:stefan at digiconcept dot net
 Summary:Missing recursive behavior
-Status: Open
+Status: Bogus
 Type:   Feature/Change Request
-Package:Feature/Change Request
+Package:*General Issues
 Operating System:   WinNT 4.0
 PHP Version:4.0 Latest CVS (21/06/2000)
 Block user comment: N

 New Comment:

In the few cases where this is needed this can be done manually and
cover the relevant edge cases.


Previous Comments:

[2000-06-22 20:14:20] hholzgra at cvs dot php dot net

moved to feature request



and, by the way, how would such a feature cope

with reference cycles? (ever tried print_r($GLOBALS)?)


[2000-06-21 12:56:12] stefan at digiconcept dot net

i'm really missing a recursiv behavior in functions like in_array() and
so on!





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


Req #52243 [Opn->Bgs]: post 5.3 - keyword: delete, "force destruct"

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=52243&edit=1

 ID: 52243
 Updated by: johan...@php.net
 Reported by:mazdak1 at telia dot com
 Summary:post 5.3 - keyword: delete, "force destruct"
-Status: Open
+Status: Bogus
 Type:   Feature/Change Request
 Package:Variables related
 Operating System:   Windows XP (Irrelevant)
 PHP Version:5.3.2
 Block user comment: N

 New Comment:

Adding such a method would give us tons of errors from users destroying
their objects and getting fatal Errors somewhere far away.



It is better if you add a custom "invalidate" method to your classes
where this is needed and track that ourself to react gracefully.


Previous Comments:

[2010-07-04 09:28:23] mazdak1 at telia dot com

Description:

Currently, it is impossible to force destruct/delete/destroy an object
or any variable for that matter. Instead, you must unset all references
until ref_count is at 0, at which point the variable/object is
destructed/removed from memory.



This works is fine as long as you know where all references are, but not
if you don't. And this can happen e.g: when you're a lib developer and
have to destruct something that the developer might reference several
times, or if you're using a Singleton with a "destroy" method.



Therefore, I propose a new language construct called "delete" (or some
other fancy name), which deletes the variable immediately with all it's
references and calling destructor if object & available.



Having both unset & delete at your disposal would give you great
freedom, both are useful for different situations.

Test script:
---
See: http://pastebin.com/pGdsed5M



Note: as long as variables are in the same scope, all will be nulled
with:



But this does not satisfy situations where references may be spread over
many scopes.



"pseudocode" of what delete($x) should do:



$referencing_x = get_references_to($x);

foreach($referencing_x as $ref)

{

   $ref = null;

}



unset($x);

Expected result:

With "delete" keyword implemented:

--

A destructed



Notice:  Undefined variable: a in
D:\Programming\UV\public\TEST\delete.php on line 48



NULL

NULL

NULL

Actual result:
--
With unset:

---

Notice:  Undefined variable: a in
D:\Programming\UV\public\TEST\delete.php on line 52



NULL

object(A)#30 (0) {

}

object(A)#30 (0) {

}



A destructed






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


Bug #50121 [Fbk]: installer doesn't install 5.3.0 on winxp 64

2010-08-06 Thread pajoye
Edit report at http://bugs.php.net/bug.php?id=50121&edit=1

 ID: 50121
 Updated by: paj...@php.net
 Reported by:arjen dot vellinga at gmail dot com
 Summary:installer doesn't install 5.3.0 on winxp 64
 Status: Feedback
 Type:   Bug
 Package:IIS related
 Operating System:   win xp 64
 PHP Version:5.3.0
 Block user comment: N

 New Comment:

file not found is not an error from PHP. Are you sure you configured
your site root correctly?


Previous Comments:

[2010-08-07 01:18:30] johan...@php.net

Please try a newer version of PHP.


[2009-11-09 11:37:45] arjen dot vellinga at gmail dot com

Description:

LS, 



After installing VC9 x86 Non Thread Safe (2009-Jun-30 08:52:54)

with the installer php doesn't work on iis, on the installer i used all
te standard options and made the choice for fast cgi as it was
recommended on the site. during install it came with the message that
fast-cgi was not installed, after installing fast-cgi through the
permalink. i installed php again with the installer made a simple php
page () saved it as index.php.

iis kept telling me that file can't be found.

i runned through all the steps in the manual installation again nothing
happend.

is this because the installer is x86 and not 64bit?



Reproduce code:
---


Expected result:

php 5.3.0 working in iis on win xp 64 after installing with fast-cgi

Actual result:
--
file not found 






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


Req #52478 [Opn->Bgs]: parse_str should accept string encoding as a parameter

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=52478&edit=1

 ID: 52478
 Updated by: johan...@php.net
 Reported by:lgandras at gmail dot com
 Summary:parse_str should accept string encoding as a
 parameter
-Status: Open
+Status: Bogus
 Type:   Feature/Change Request
 Package:*URL Functions
 Operating System:   NA
 PHP Version:5.2.14
 Block user comment: N

 New Comment:

PHP has no understanding of encodings therefore there is no reason for
such a parameter there.


Previous Comments:

[2010-07-29 01:06:02] lgandras at gmail dot com

Description:

It would be nice to have parse_str($str, $arrout) accepting a third
parameter allowing to specify string encoding. Typically javascript
encoded strings will be in UTF-8. My server for example uses ISO-8859-1
for everything.



I'm willing to try to develop a patch for this (never done it before).
It would be nice if somebody pointed out what internal functions should
i use to get this working.







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


Req #52190 [Opn->Bgs]: send php scripts finished message

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=52190&edit=1

 ID: 52190
 Updated by: johan...@php.net
 Reported by:christian dot gnoth at arcor dot de
 Summary:send php scripts finished message
-Status: Open
+Status: Bogus
 Type:   Feature/Change Request
 Package:*Web Server problem
 Operating System:   Linux - Windows
 PHP Version:5.2.13
 Block user comment: N

 New Comment:

See flush() and output buffer documentation. more can't be done.


Previous Comments:

[2010-06-26 13:05:02] christian dot gnoth at arcor dot de

Description:

Hello,

I have a long running PHP script - with Web-Browser Interface and MySQL
access.



The user starts a migration of data in MySQL - it can take a lot of
time. The script generates for each step it takes output and sends it to
the web browser.



I used output buffering.



On few PC the anti-virus software helds the output back and the user do
not gets any message. For long running task it may be difficult for the
user to decide if the script hangs or it is still active.



So I wanted send a PHP script finished message - so that the output is
released from the anti virus software and shown in the browser.



sending a HTTP header() 200 status code is not possible - I am getting a
warning: 'header already sent - output started at'

Test script:
---
wordpress plugin - joomla to wordpress migrator:



http://wordpress.org/extend/plugins/joomla-to-wordpress-migrator/

Expected result:

a function which sends PHP script status code from the server to the
browser.







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


Bug #50121 [Opn->Fbk]: installer doesn't install 5.3.0 on winxp 64

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=50121&edit=1

 ID: 50121
 Updated by: johan...@php.net
 Reported by:arjen dot vellinga at gmail dot com
 Summary:installer doesn't install 5.3.0 on winxp 64
-Status: Open
+Status: Feedback
 Type:   Bug
 Package:IIS related
 Operating System:   win xp 64
 PHP Version:5.3.0
 Block user comment: N

 New Comment:

Please try a newer version of PHP.


Previous Comments:

[2009-11-09 11:37:45] arjen dot vellinga at gmail dot com

Description:

LS, 



After installing VC9 x86 Non Thread Safe (2009-Jun-30 08:52:54)

with the installer php doesn't work on iis, on the installer i used all
te standard options and made the choice for fast cgi as it was
recommended on the site. during install it came with the message that
fast-cgi was not installed, after installing fast-cgi through the
permalink. i installed php again with the installer made a simple php
page () saved it as index.php.

iis kept telling me that file can't be found.

i runned through all the steps in the manual installation again nothing
happend.

is this because the installer is x86 and not 64bit?



Reproduce code:
---


Expected result:

php 5.3.0 working in iis on win xp 64 after installing with fast-cgi

Actual result:
--
file not found 






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


Bug #52533 [Opn->Csd]: ext/curl/tests/curl_multi_getcontent_basic3.phpt broken due php.net/robots.txt

2010-08-06 Thread felipe
Edit report at http://bugs.php.net/bug.php?id=52533&edit=1

 ID: 52533
 Updated by: fel...@php.net
 Reported by:glen at delfi dot ee
 Summary:ext/curl/tests/curl_multi_getcontent_basic3.phpt
 broken due php.net/robots.txt
-Status: Open
+Status: Closed
 Type:   Bug
 Package:*General Issues
 PHP Version:5.3.3
-Assigned To:
+Assigned To:felipe
 Block user comment: N

 New Comment:

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Thanks for the patch.


Previous Comments:

[2010-08-07 00:57:43] fel...@php.net

Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=301954
Log: - Fixed bug #52533
(ext/curl/tests/curl_multi_getcontent_basic3.phpt broken due
php.net/robots.txt)
  patch by: glen at delfi dot ee


[2010-08-04 16:04:28] glen at delfi dot ee

Description:

ext/curl/tests/curl_multi_getcontent_basic3.phpt test is broken due 

php.net/robots.txt content change.

Test script:
---
test with --show-all







=

PHP :
/home/users/glen/rpm/BUILD.i686-linux/php-5.3.3/sapi/cli/php

PHP_SAPI: cli

PHP_VERSION : 5.3.3

ZEND_VERSION: 2.3.0

PHP_OS  : Linux - Linux carme-pld-i686 2.6.34.1-3 #1 SMP Tue Jul 6
16:15:11 CEST 2010 i686

INI actual  :
/home/users/glen/rpm/BUILD.i686-linux/php-5.3.3/tmp-php.ini

More .INIs  :

CWD : /home/users/glen/rpm/BUILD.i686-linux/php-5.3.3

Extra dirs  :

VALGRIND: Not used

=

Running selected tests.

TEST 1/1 [ext/curl/tests/curl_multi_getcontent_basic3.phpt]

SKIP



DONE



TEST

http://php.net/robots.txt";);

curl_setopt($ch2, CURLOPT_URL,
"file://".dirname(__FILE__)."/curl_testdata2.txt");

curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);



//CREATE MULTIPLE CURL HANDLE

$mh=curl_multi_init();



//ADD THE 2 HANDLES

curl_multi_add_handle($mh,$ch1);

curl_multi_add_handle($mh,$ch2);



//EXECUTE

$running=0;

do {

curl_multi_exec($mh,$running);

} while ($running>0);



$results1=curl_multi_getcontent($ch1);

$results2=curl_multi_getcontent($ch2);



//CLOSE

curl_multi_remove_handle($mh,$ch1);

curl_multi_remove_handle($mh,$ch2);

curl_multi_close($mh);



echo $results1;

echo $results2;



?>

DONE



OUT

User-agent: *

Disallow: /backend/

Disallow: /distributions/

Disallow: /stats/

Disallow: /source.php

Disallow: /search.php

Disallow: /mod.php

Disallow: /manual/add-note.php



Disallow: /harming/humans

Disallow: /ignoring/human/orders

Disallow: /harm/to/self



CURL2

DONE



EXP

User-agent: *

Disallow: /backend/

Disallow: /distributions/

Disallow: /stats/

Disallow: /source.php

Disallow: /search.php

Disallow: /mod.php

Disallow: /manual/add-note.php

CURL2

DONE



DIFF

009+

010+ Disallow: /harming/humans

011+ Disallow: /ignoring/human/orders

012+ Disallow: /harm/to/self

013+

DONE

FAIL Curl_multi_getcontent() basic test with different sources (local
file/http) [ext/curl/tests/curl_multi_getcontent_basic3.phpt]

=

Number of tests :1 1

Tests skipped   :0 (  0.0%) 

Tests warned:0 (  0.0%) (  0.0%)

Tests failed:1 (100.0%) (100.0%)

Expected fail   :0 (  0.0%) (  0.0%)

Tests passed:0 (  0.0%) (  0.0%)

-

Time taken  :1 seconds

=



=

FAILED TEST SUMMARY

-

Curl_multi_getcontent() basic test with different sources (local
file/http) [ext/curl/tests/curl_multi_getcontent_basic3.phpt]

=

make: [test] Error 1 (ignored)









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


Bug #52519 [Opn->Asn]: microseconds in DateInterval are missing

2010-08-06 Thread felipe
Edit report at http://bugs.php.net/bug.php?id=52519&edit=1

 ID: 52519
 Updated by: fel...@php.net
 Reported by:giorgio dot liscio at email dot it
 Summary:microseconds in DateInterval are missing
-Status: Open
+Status: Assigned
 Type:   Bug
 Package:Date/time related
 Operating System:   xp x64 all
 PHP Version:5.3.3
-Assigned To:
+Assigned To:derick
 Block user comment: N



Previous Comments:

[2010-08-02 23:06:30] giorgio dot liscio at email dot it

Description:

hi, the property $seconds should be float or a $microseconds property is
missing in the class DateInterval



http://www.php.net/manual/en/class.dateinterval.php



thank you







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


Bug #52514 [Opn->Asn]: microseconds are missing in DateTime class

2010-08-06 Thread felipe
Edit report at http://bugs.php.net/bug.php?id=52514&edit=1

 ID: 52514
 Updated by: fel...@php.net
 Reported by:giorgio dot liscio at email dot it
 Summary:microseconds are missing in DateTime class
-Status: Open
+Status: Assigned
 Type:   Bug
 Package:Date/time related
 Operating System:   all? xp x64
 PHP Version:5.3.3
-Assigned To:
+Assigned To:derick
 Block user comment: N



Previous Comments:

[2010-08-02 13:44:52] giorgio dot liscio at email dot it

Description:

hi



i expected to dump microseconds too when i use



new DateTime("now");

new DateTime(date('Y-m-d H:i:s.283020,time()));



but apparently they are not stored at all in datetime objects



echo date('Y-m-d H:i:s.u',microtime(true));



or in classical php functions



thank you







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


Bug #52550 [Ana]: integer undefined behaviors executed during "make test"

2010-08-06 Thread regehr at cs dot utah dot edu
Edit report at http://bugs.php.net/bug.php?id=52550&edit=1

 ID: 52550
 User updated by:regehr at cs dot utah dot edu
 Reported by:regehr at cs dot utah dot edu
 Summary:integer undefined behaviors executed during "make
 test"
 Status: Analyzed
 Type:   Bug
 Package:*General Issues
 Operating System:   linux
 PHP Version:trunk-SVN-2010-08-06 (snap)
 Block user comment: N

 New Comment:

FYI there are a few bogus errors in the list I posted earlier. 
Obviously (35 - 33) is well-defined in C.  Sorry about that.  It should
be easy to recognize and ignore these.


Previous Comments:

[2010-08-06 22:04:30] il...@php.net

Automatic comment from SVN on behalf of iliaa
Revision: http://svn.php.net/viewvc/?view=revision&revision=301939
Log: Another fix for issue indentified in bug #52550


[2010-08-06 21:55:12] il...@php.net

Automatic comment from SVN on behalf of iliaa
Revision: http://svn.php.net/viewvc/?view=revision&revision=301938
Log: Fixed issues inside str_pad() identified by bug #52550


[2010-08-06 21:42:55] regehr at cs dot utah dot edu

The tool isn't yet available.  It is a modified version of LLVM's Clang
compiler and it still has some rough edges that we're working out. 
However, we'll contribute it to the LLVM project fairly soon, at which
point it'll be really easy to run as you suggest.  In the meantime I'd
be happy to rerun it in a few weeks or whenever seems good to you.


[2010-08-06 21:20:43] ras...@php.net

Hey, we are starting to see the light on these.  Some of them are quite
subtle.  Is this tool available so we can check out fixes and run it on
a continuous basis before new releases?


[2010-08-06 21:11:35] il...@php.net

Automatic comment from SVN on behalf of iliaa
Revision: http://svn.php.net/viewvc/?view=revision&revision=301936
Log: Use correct order of operations. Second of many fixes for bug
#52550




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/bug.php?id=52550


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


Bug #52550 [Ana]: integer undefined behaviors executed during "make test"

2010-08-06 Thread regehr at cs dot utah dot edu
Edit report at http://bugs.php.net/bug.php?id=52550&edit=1

 ID: 52550
 User updated by:regehr at cs dot utah dot edu
 Reported by:regehr at cs dot utah dot edu
 Summary:integer undefined behaviors executed during "make
 test"
 Status: Analyzed
 Type:   Bug
 Package:*General Issues
 Operating System:   linux
 PHP Version:trunk-SVN-2010-08-06 (snap)
 Block user comment: N

 New Comment:

The tool isn't yet available.  It is a modified version of LLVM's Clang
compiler and it still has some rough edges that we're working out. 
However, we'll contribute it to the LLVM project fairly soon, at which
point it'll be really easy to run as you suggest.  In the meantime I'd
be happy to rerun it in a few weeks or whenever seems good to you.


Previous Comments:

[2010-08-06 21:20:43] ras...@php.net

Hey, we are starting to see the light on these.  Some of them are quite
subtle.  Is this tool available so we can check out fixes and run it on
a continuous basis before new releases?


[2010-08-06 21:11:35] il...@php.net

Automatic comment from SVN on behalf of iliaa
Revision: http://svn.php.net/viewvc/?view=revision&revision=301936
Log: Use correct order of operations. Second of many fixes for bug
#52550


[2010-08-06 20:19:24] ras...@php.net

Automatic comment from SVN on behalf of rasmus
Revision: http://svn.php.net/viewvc/?view=revision&revision=301934
Log: Do these ops in the right order here.  First of many fixes for
bug #52550


[2010-08-06 19:21:57] regehr at cs dot utah dot edu

Is there a way to attach files here?  Anyway I've put a verbose error
log here:



http://www.cs.utah.edu/~regehr/php-trunk-201008060430-errors.txt



Searching for lines containing the string "CLANG UNDEFINED" in this log
should give you the right information.


[2010-08-06 17:43:56] ras...@php.net

Do you have a way to generate the list with the test case filename that
triggered 

the problem?




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/bug.php?id=52550


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


Bug #52550 [Ana]: integer undefined behaviors executed during "make test"

2010-08-06 Thread rasmus
Edit report at http://bugs.php.net/bug.php?id=52550&edit=1

 ID: 52550
 Updated by: ras...@php.net
 Reported by:regehr at cs dot utah dot edu
 Summary:integer undefined behaviors executed during "make
 test"
 Status: Analyzed
 Type:   Bug
 Package:*General Issues
 Operating System:   linux
 PHP Version:trunk-SVN-2010-08-06 (snap)
 Block user comment: N

 New Comment:

Hey, we are starting to see the light on these.  Some of them are quite
subtle.  Is this tool available so we can check out fixes and run it on
a continuous basis before new releases?


Previous Comments:

[2010-08-06 21:11:35] il...@php.net

Automatic comment from SVN on behalf of iliaa
Revision: http://svn.php.net/viewvc/?view=revision&revision=301936
Log: Use correct order of operations. Second of many fixes for bug
#52550


[2010-08-06 20:19:24] ras...@php.net

Automatic comment from SVN on behalf of rasmus
Revision: http://svn.php.net/viewvc/?view=revision&revision=301934
Log: Do these ops in the right order here.  First of many fixes for
bug #52550


[2010-08-06 19:21:57] regehr at cs dot utah dot edu

Is there a way to attach files here?  Anyway I've put a verbose error
log here:



http://www.cs.utah.edu/~regehr/php-trunk-201008060430-errors.txt



Searching for lines containing the string "CLANG UNDEFINED" in this log
should give you the right information.


[2010-08-06 17:43:56] ras...@php.net

Do you have a way to generate the list with the test case filename that
triggered 

the problem?


[2010-08-06 16:57:55] regehr at cs dot utah dot edu

To reiterate: this isn't static analysis.  Our tool runs your code under
your test suite and looks for integer operations that the C standard
tells us are undefined.  I manually verified a few more of these
reported bugs and they were also real.  Anyway, I leave the rest to you.
 Thanks.




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/bug.php?id=52550


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


Bug #52257 [Com]: module php5-librdf causes libxslt's security module to fail

2010-08-06 Thread dave at dajobe dot org
Edit report at http://bugs.php.net/bug.php?id=52257&edit=1

 ID: 52257
 Comment by: dave at dajobe dot org
 Reported by:matth at mlalonde dot net
 Summary:module php5-librdf causes libxslt's security module
 to fail
 Status: Open
 Type:   Bug
 Package:XSLT related
 Operating System:   Ubuntu LTS
 PHP Version:5.3.2
 Block user comment: N

 New Comment:

(Found the add comment button!)



Just to explain a bit more why raptor does this.



It's using libxslt as part of the GRDDL rdf parser to execute XSLT
scripts off the web, never from local files.  So it makes sense to
refuse any local file read/write as the default security policy.



This does however conflict with general user-use of libxslt on local
files in another module, such as PHP's xslt module.



So in one memory namespace, you need to be both restrictive and
permissive, yet the *default* security policy can only be set
libxslt-wide:

http://www.xmlsoft.org/XSLT/html/libxslt-security.html#xsltSetDefaultSecurityPrefs



The context-specific policy can be different:

http://www.xmlsoft.org/XSLT/html/libxslt-security.html#xsltSetCtxtSecurityPrefs


Previous Comments:

[2010-08-06 18:58:02] lsm...@php.net

some additional infos from Dave Beckett:

but anyway, more info at

http://bugs.librdf.org/mantis/view.php?id=379



I found I could duplicate the error and as I suspected if I made raptor
skip 

over xsltSetSecurityPrefs()  and xsltSetDefaultSecurityPrefs() calls,
the 

program works as expected.



I can probably patch raptor to fix this, then patch the librdf-php to
use that 

fix, but that's quite indirect.



Seems all libxslt users in the same memory space will have this issue.


[2010-08-06 15:35:38] lsm...@php.net

to add some more context about the issue, i talked to the author of php
rdf ext 

on the #reland freenode IRC channel:



[15:23]  lsmith: it's not the php module, it's raptor which
redland uses

[15:23]  it sets the libxslt security policy

[15:24]  http://librdf.org/raptor/api-1.4/raptor-section-

general.html#raptor-set-libxslt-security-preferences

[15:25]  it's hard to do - how is raptor/redland suppose to know
when a 

calling application is also wanting to adjust parameters of a shared
library

[15:26]  it's the calling app's responsibility - php in this
case


[2010-07-30 10:55:44] penny at liip dot ch

I had exactly the same problem with the following versions:



libxslt1.1  1.1.24-2

php55.2.6.dfsg.1-1+lenny8

php5-librdf 1.0.7.1-1+b1



Purging php5-librdf fixed the problem.


[2010-07-06 00:46:03] matth at mlalonde dot net

Description:

I have been able to replicate under three environment running Ubuntu LTS
php5 (cli, cgi or mod_php), libxslt 1.1.26 and the php5 module and
librdf0 and the php5 module.



With the above setup, any  call will
fail with the error



XSLTProcessor::importStylesheet(): Local file read for
/path/to/local/file.xsl refused



Using XSLCache will result in a segfault and no errors.



Removing php5's librdf module fixes the issue.

Test script:
---
# a.php 

load($xsl_filename);

$xsl->importStyleSheet($doc);



$doc->load($xml_filename);

echo $xsl->transformToXML($doc);



# collection.xml



 

  Fight for your mind

  Ben Harper

  1995

 

 

  Electric Ladyland

  Jimi Hendrix

  1997

 





# collection.xsl

http://www.w3.org/1999/XSL/Transform";>

 

 

 

 

  Hey! Welcome to 's sweet CD
collection!

  

 

 

  

  by  - 

  

 





# collection2.xsl

http://www.w3.org/1999/XSL/Transform";>

 

 

 

  Hey! Welcome to 's sweet CD
collection!

  

 

 

  

  by00  - 

  

 





Expected result:

A parsed XSLT document with the imported stylesheets. And no errors ;)

Actual result:
--
Warning: XSLTProcessor::importStylesheet(): error in /var/www/temp/a.php
on line 14



Call Stack:

0.0002 627304   1. {main}() /var/www/temp/a.php:0

0.0006 631128   2. XSLTProcessor->importStylesheet()
/var/www/temp/a.php:14





Warning: XSLTProcessor::importStylesheet(): Local file read for
file:///var/www/pgadmin/temp/collection2.xsl refused in
/var/www/temp/a.php on line 14



Call Stack:

0.0002 627304   1. {main}() /var/www/temp/a.php:0

0.0006 631128   2. XSLTProcessor->importStylesheet()
/var/www/temp/a.php:14








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


Bug #52550 [Ana]: integer undefined behaviors executed during "make test"

2010-08-06 Thread regehr at cs dot utah dot edu
Edit report at http://bugs.php.net/bug.php?id=52550&edit=1

 ID: 52550
 User updated by:regehr at cs dot utah dot edu
 Reported by:regehr at cs dot utah dot edu
 Summary:integer undefined behaviors executed during "make
 test"
 Status: Analyzed
 Type:   Bug
 Package:*General Issues
 Operating System:   linux
 PHP Version:trunk-SVN-2010-08-06 (snap)
 Block user comment: N

 New Comment:

Is there a way to attach files here?  Anyway I've put a verbose error
log here:



http://www.cs.utah.edu/~regehr/php-trunk-201008060430-errors.txt



Searching for lines containing the string "CLANG UNDEFINED" in this log
should give you the right information.


Previous Comments:

[2010-08-06 17:43:56] ras...@php.net

Do you have a way to generate the list with the test case filename that
triggered 

the problem?


[2010-08-06 16:57:55] regehr at cs dot utah dot edu

To reiterate: this isn't static analysis.  Our tool runs your code under
your test suite and looks for integer operations that the C standard
tells us are undefined.  I manually verified a few more of these
reported bugs and they were also real.  Anyway, I leave the rest to you.
 Thanks.


[2010-08-06 16:52:44] regehr at cs dot utah dot edu

Hi Rasmus-- You're right, this overflow is not totally obvious. It
occurs when '2147483647;' is passed to parse_iv2() in this test:



  ext/standard/tests/serialize/serialization_miscTypes_001.phpt



The first problem is that the signed add in (result * 10 + cursor)
overflows; the subtraction overflow is secondary.  If you re-associate
the expression and instead compute (result * 10 + (cursor - '0')) the
problems go away.


[2010-08-06 08:33:38] ras...@php.net

No, it isn't obvious since that line of code is only executed when the
value of 

cursor is between '0' and '9'.  It would require the argument to
parse_iv2() to be  

above MAXINT which re2c checks for earlier.


[2010-08-06 08:10:22] regehr at cs dot utah dot edu

Hi--  It's not static analysis and there are no false positives.  These
behaviors really happen (unless our tool is buggy, of course this is
always possible).



Yes, I should have edited out the undefined behavior that occurred
during conftest.



My copy of var_unserializer.c has this code at line 228:



result = result * 10 + cursor - '0';



It looks to me like "result * 10 + cursor" evaluates to -2147483601 and
then the subtraction overflow occurs.  This is not obvious?  Anyway,
this is easy to verify: put an appropriate assertion in the code and run
"make test" yourself.




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/bug.php?id=52550


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


Bug #52257 [Opn]: module php5-librdf causes libxslt's security module to fail

2010-08-06 Thread lsmith
Edit report at http://bugs.php.net/bug.php?id=52257&edit=1

 ID: 52257
 Updated by: lsm...@php.net
 Reported by:matth at mlalonde dot net
 Summary:module php5-librdf causes libxslt's security module
 to fail
 Status: Open
 Type:   Bug
 Package:XSLT related
 Operating System:   Ubuntu LTS
 PHP Version:5.3.2
 Block user comment: N

 New Comment:

some additional infos from Dave Beckett:

but anyway, more info at

http://bugs.librdf.org/mantis/view.php?id=379



I found I could duplicate the error and as I suspected if I made raptor
skip 

over xsltSetSecurityPrefs()  and xsltSetDefaultSecurityPrefs() calls,
the 

program works as expected.



I can probably patch raptor to fix this, then patch the librdf-php to
use that 

fix, but that's quite indirect.



Seems all libxslt users in the same memory space will have this issue.


Previous Comments:

[2010-08-06 15:35:38] lsm...@php.net

to add some more context about the issue, i talked to the author of php
rdf ext 

on the #reland freenode IRC channel:



[15:23]  lsmith: it's not the php module, it's raptor which
redland uses

[15:23]  it sets the libxslt security policy

[15:24]  http://librdf.org/raptor/api-1.4/raptor-section-

general.html#raptor-set-libxslt-security-preferences

[15:25]  it's hard to do - how is raptor/redland suppose to know
when a 

calling application is also wanting to adjust parameters of a shared
library

[15:26]  it's the calling app's responsibility - php in this
case


[2010-07-30 10:55:44] penny at liip dot ch

I had exactly the same problem with the following versions:



libxslt1.1  1.1.24-2

php55.2.6.dfsg.1-1+lenny8

php5-librdf 1.0.7.1-1+b1



Purging php5-librdf fixed the problem.


[2010-07-06 00:46:03] matth at mlalonde dot net

Description:

I have been able to replicate under three environment running Ubuntu LTS
php5 (cli, cgi or mod_php), libxslt 1.1.26 and the php5 module and
librdf0 and the php5 module.



With the above setup, any  call will
fail with the error



XSLTProcessor::importStylesheet(): Local file read for
/path/to/local/file.xsl refused



Using XSLCache will result in a segfault and no errors.



Removing php5's librdf module fixes the issue.

Test script:
---
# a.php 

load($xsl_filename);

$xsl->importStyleSheet($doc);



$doc->load($xml_filename);

echo $xsl->transformToXML($doc);



# collection.xml



 

  Fight for your mind

  Ben Harper

  1995

 

 

  Electric Ladyland

  Jimi Hendrix

  1997

 





# collection.xsl

http://www.w3.org/1999/XSL/Transform";>

 

 

 

 

  Hey! Welcome to 's sweet CD
collection!

  

 

 

  

  by  - 

  

 





# collection2.xsl

http://www.w3.org/1999/XSL/Transform";>

 

 

 

  Hey! Welcome to 's sweet CD
collection!

  

 

 

  

  by00  - 

  

 





Expected result:

A parsed XSLT document with the imported stylesheets. And no errors ;)

Actual result:
--
Warning: XSLTProcessor::importStylesheet(): error in /var/www/temp/a.php
on line 14



Call Stack:

0.0002 627304   1. {main}() /var/www/temp/a.php:0

0.0006 631128   2. XSLTProcessor->importStylesheet()
/var/www/temp/a.php:14





Warning: XSLTProcessor::importStylesheet(): Local file read for
file:///var/www/pgadmin/temp/collection2.xsl refused in
/var/www/temp/a.php on line 14



Call Stack:

0.0002 627304   1. {main}() /var/www/temp/a.php:0

0.0006 631128   2. XSLTProcessor->importStylesheet()
/var/www/temp/a.php:14








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


Bug #52546 [Com]: pdo_dblib segmentation fault when iterating MONEY values

2010-08-06 Thread rgagnon24 at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=52546&edit=1

 ID: 52546
 Comment by: rgagnon24 at gmail dot com
 Reported by:rgagnon24 at gmail dot com
 Summary:pdo_dblib segmentation fault when iterating MONEY
 values
 Status: Closed
 Type:   Bug
 Package:PDO related
 Operating System:   CentOS 5.5
 PHP Version:5.2.14
 Assigned To:felipe
 Block user comment: N

 New Comment:

Patch uploaded as diff of actual SVN checkout this time.



Patch made from PHP_5_2 branch, but appears to be the same for PHP_5_3


Previous Comments:

[2010-08-06 17:42:01] rgagnon24 at gmail dot com

With patch committed to SVN (r301916), segmentation fault still occurs.



The issue is the val->data pointer is null at the time of spprintf()
being called.  Using "8" in place of "val->len" or sizeof(DBFLT8) in the
dbconvert() call does not help at all.


[2010-08-06 01:32:47] fel...@php.net

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Thanks.


[2010-08-06 01:32:19] fel...@php.net

Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=301916
Log: - Fixed bug #52546 (pdo_dblib segmentation fault when iterating
MONEY values)


[2010-08-05 22:04:37] rgagnon24 at gmail dot com

Description:

Fix for bug 51213 released into 5.2.14 and 5.3.3 causes segmentation
fault when an SQL query attempts to read MSSQL MONEY type columns, or
aggregates of those column types.



Problem appears to be invalid val->data pointer passed to spprintf()
call at line 174 of dblib_stmt.c



Oddly, the patch attached to bug 51213 works properly, but is not the
same as what was comitted to the code base.



In the patch attached to 51213, val->data is properly emalloc'd some
memory before any sprintf()-type of operation is performed.

Test script:
---
// On a table containing a MONEY (field named "amount");



$sql = "SELECT SUM(amount) FROM table";

$rs = $pdo->query($sql, PDO::FETCH_OBJ);

foreach($rs as $row) {

   var_dump($row);

}

Expected result:

Expected to see rows dumped from table.

Actual result:
--
Segmentation fault.






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


Bug #52550 [Ana]: integer undefined behaviors executed during "make test"

2010-08-06 Thread rasmus
Edit report at http://bugs.php.net/bug.php?id=52550&edit=1

 ID: 52550
 Updated by: ras...@php.net
 Reported by:regehr at cs dot utah dot edu
 Summary:integer undefined behaviors executed during "make
 test"
 Status: Analyzed
 Type:   Bug
 Package:*General Issues
 Operating System:   linux
 PHP Version:trunk-SVN-2010-08-06 (snap)
 Block user comment: N

 New Comment:

Do you have a way to generate the list with the test case filename that
triggered 

the problem?


Previous Comments:

[2010-08-06 16:57:55] regehr at cs dot utah dot edu

To reiterate: this isn't static analysis.  Our tool runs your code under
your test suite and looks for integer operations that the C standard
tells us are undefined.  I manually verified a few more of these
reported bugs and they were also real.  Anyway, I leave the rest to you.
 Thanks.


[2010-08-06 16:52:44] regehr at cs dot utah dot edu

Hi Rasmus-- You're right, this overflow is not totally obvious. It
occurs when '2147483647;' is passed to parse_iv2() in this test:



  ext/standard/tests/serialize/serialization_miscTypes_001.phpt



The first problem is that the signed add in (result * 10 + cursor)
overflows; the subtraction overflow is secondary.  If you re-associate
the expression and instead compute (result * 10 + (cursor - '0')) the
problems go away.


[2010-08-06 08:33:38] ras...@php.net

No, it isn't obvious since that line of code is only executed when the
value of 

cursor is between '0' and '9'.  It would require the argument to
parse_iv2() to be  

above MAXINT which re2c checks for earlier.


[2010-08-06 08:10:22] regehr at cs dot utah dot edu

Hi--  It's not static analysis and there are no false positives.  These
behaviors really happen (unless our tool is buggy, of course this is
always possible).



Yes, I should have edited out the undefined behavior that occurred
during conftest.



My copy of var_unserializer.c has this code at line 228:



result = result * 10 + cursor - '0';



It looks to me like "result * 10 + cursor" evaluates to -2147483601 and
then the subtraction overflow occurs.  This is not obvious?  Anyway,
this is easy to verify: put an appropriate assertion in the code and run
"make test" yourself.


[2010-08-06 08:00:32] ras...@php.net

They don't make much sense to me.  Starting from the bottom,
conftest.cpp is a 

test file generated by the autoconf/libtool chain and only used during
the 

configure run.  So even if there was an issue in that, it really
wouldn't matter 

since no user data ever gets to it, and even if it did, you are
reporting it to 

the wrong project.



Next one up, ext/standard/var_unserializer.c line 228?  There is no
substraction 

there.  But assuming it means close to line 228, it would be in the
parse_iv2() 

function?  I see nothing wrong with that code.  The only code in it that
does 

any sort of addition is:



if (cursor >= '0' && cursor <= '9') {

result = result * 10 + cursor - '0';



How exactly do you get a signed subtraction overflow from that?  cursor
is 

constrained and result is initialized to 0.



The 3rd last one seems to point at the same code.



There may very well be bugs hiding in there, but a static analysis full
of false 

positives isn't very useful.




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/bug.php?id=52550


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


Bug #52546 [Com]: pdo_dblib segmentation fault when iterating MONEY values

2010-08-06 Thread rgagnon24 at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=52546&edit=1

 ID: 52546
 Comment by: rgagnon24 at gmail dot com
 Reported by:rgagnon24 at gmail dot com
 Summary:pdo_dblib segmentation fault when iterating MONEY
 values
 Status: Closed
 Type:   Bug
 Package:PDO related
 Operating System:   CentOS 5.5
 PHP Version:5.2.14
 Assigned To:felipe
 Block user comment: N

 New Comment:

With patch committed to SVN (r301916), segmentation fault still occurs.



The issue is the val->data pointer is null at the time of spprintf()
being called.  Using "8" in place of "val->len" or sizeof(DBFLT8) in the
dbconvert() call does not help at all.


Previous Comments:

[2010-08-06 01:32:47] fel...@php.net

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Thanks.


[2010-08-06 01:32:19] fel...@php.net

Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=301916
Log: - Fixed bug #52546 (pdo_dblib segmentation fault when iterating
MONEY values)


[2010-08-05 22:04:37] rgagnon24 at gmail dot com

Description:

Fix for bug 51213 released into 5.2.14 and 5.3.3 causes segmentation
fault when an SQL query attempts to read MSSQL MONEY type columns, or
aggregates of those column types.



Problem appears to be invalid val->data pointer passed to spprintf()
call at line 174 of dblib_stmt.c



Oddly, the patch attached to bug 51213 works properly, but is not the
same as what was comitted to the code base.



In the patch attached to 51213, val->data is properly emalloc'd some
memory before any sprintf()-type of operation is performed.

Test script:
---
// On a table containing a MONEY (field named "amount");



$sql = "SELECT SUM(amount) FROM table";

$rs = $pdo->query($sql, PDO::FETCH_OBJ);

foreach($rs as $row) {

   var_dump($row);

}

Expected result:

Expected to see rows dumped from table.

Actual result:
--
Segmentation fault.






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


Bug #52549 [Com]: No 'M' in memory_limit variable returns 'Could not startup.' Possible mem leak?

2010-08-06 Thread zack_gold at yahoo dot com
Edit report at http://bugs.php.net/bug.php?id=52549&edit=1

 ID: 52549
 Comment by: zack_gold at yahoo dot com
 Reported by:zack_gold at yahoo dot com
 Summary:No 'M' in memory_limit variable returns 'Could not
 startup.' Possible mem leak?
 Status: Feedback
 Type:   Bug
 Package:PHP options/info functions
 Operating System:   Linux (Arch Linux)
 PHP Version:5.3.3
 Block user comment: N

 New Comment:

Oh, interesting.


Previous Comments:

[2010-08-06 11:40:23] m...@php.net

It actually is set properly, you set it to 50 bytes, which is too less
to start up.


[2010-08-06 04:00:32] zack_gold at yahoo dot com

Description:

When you put this into php.ini:

memory_limit = 50;



The output results in:

Could not startup.





There should be a notification to let you know that the memory_limit
isn't set 

properly. Maybe it's possible to do memory leaking or something like
that through 

this? My knowledge for memory-related stuff is one to none, but maybe
there's a 

potential bug here...

Test script:
---
Change php.ini memory_limit to "50" like so:



memory_limit = 50;







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


Bug #52550 [Ana]: integer undefined behaviors executed during "make test"

2010-08-06 Thread regehr at cs dot utah dot edu
Edit report at http://bugs.php.net/bug.php?id=52550&edit=1

 ID: 52550
 User updated by:regehr at cs dot utah dot edu
 Reported by:regehr at cs dot utah dot edu
 Summary:integer undefined behaviors executed during "make
 test"
 Status: Analyzed
 Type:   Bug
 Package:*General Issues
 Operating System:   linux
 PHP Version:trunk-SVN-2010-08-06 (snap)
 Block user comment: N

 New Comment:

To reiterate: this isn't static analysis.  Our tool runs your code under
your test suite and looks for integer operations that the C standard
tells us are undefined.  I manually verified a few more of these
reported bugs and they were also real.  Anyway, I leave the rest to you.
 Thanks.


Previous Comments:

[2010-08-06 16:52:44] regehr at cs dot utah dot edu

Hi Rasmus-- You're right, this overflow is not totally obvious. It
occurs when '2147483647;' is passed to parse_iv2() in this test:



  ext/standard/tests/serialize/serialization_miscTypes_001.phpt



The first problem is that the signed add in (result * 10 + cursor)
overflows; the subtraction overflow is secondary.  If you re-associate
the expression and instead compute (result * 10 + (cursor - '0')) the
problems go away.


[2010-08-06 08:33:38] ras...@php.net

No, it isn't obvious since that line of code is only executed when the
value of 

cursor is between '0' and '9'.  It would require the argument to
parse_iv2() to be  

above MAXINT which re2c checks for earlier.


[2010-08-06 08:10:22] regehr at cs dot utah dot edu

Hi--  It's not static analysis and there are no false positives.  These
behaviors really happen (unless our tool is buggy, of course this is
always possible).



Yes, I should have edited out the undefined behavior that occurred
during conftest.



My copy of var_unserializer.c has this code at line 228:



result = result * 10 + cursor - '0';



It looks to me like "result * 10 + cursor" evaluates to -2147483601 and
then the subtraction overflow occurs.  This is not obvious?  Anyway,
this is easy to verify: put an appropriate assertion in the code and run
"make test" yourself.


[2010-08-06 08:00:32] ras...@php.net

They don't make much sense to me.  Starting from the bottom,
conftest.cpp is a 

test file generated by the autoconf/libtool chain and only used during
the 

configure run.  So even if there was an issue in that, it really
wouldn't matter 

since no user data ever gets to it, and even if it did, you are
reporting it to 

the wrong project.



Next one up, ext/standard/var_unserializer.c line 228?  There is no
substraction 

there.  But assuming it means close to line 228, it would be in the
parse_iv2() 

function?  I see nothing wrong with that code.  The only code in it that
does 

any sort of addition is:



if (cursor >= '0' && cursor <= '9') {

result = result * 10 + cursor - '0';



How exactly do you get a signed subtraction overflow from that?  cursor
is 

constrained and result is initialized to 0.



The 3rd last one seems to point at the same code.



There may very well be bugs hiding in there, but a static analysis full
of false 

positives isn't very useful.


[2010-08-06 07:30:29] regehr at cs dot utah dot edu

Description:

I run php-trunk-201008060430's "make test" under a tool that detects
integer undefined behaviors.  This is on an x86 box running Ubuntu
10.04.  The list of problems is below.  Some of these could be security
problems waiting to happen.



Hopefully the error messages are self-explanatory.  If more details are
required, please let me know.



 :
Op: +, Reason : Signed Addition Overflow, BINARY OPERATION: left
(int32): 2147483640 right (int32): 9 



 :
Op: -, Reason : Signed Subtraction Overflow, UNARY OPERATION: left
(int32): 0 right (int32): -2147483648 



 :
Op: +, Reason : Signed Addition Overflow, BINARY OPERATION: left
(int32): 2147483640 right (int32): 8 



 :
Op: -, Reason : Signed Subtraction Overflow, UNARY OPERATION: left
(int32): 0 right (int32): -2147483648 



 : Op:
+, Reason : Signed Addition Overflow, BINARY OPERATION: left (int32):
2147483640 right (int32): 8 



 : Op:
-, Reason : Signed Subtraction Overflow, UNARY OPERATION: left (int32):
0 right (int32): -2147483648 




: Op: <<, Reason : Signed Left Shift Error: Right operand is negative or
is greater than or equal to the width of the promoted left operand,
BINARY OPERATION: left (int32): 0 right (int32): 65 




: Op: >>, Reason : Signed Right Shift Error: Right operand is negative
or is greater than or equal to the width of the p

Bug #52550 [Ana]: integer undefined behaviors executed during "make test"

2010-08-06 Thread regehr at cs dot utah dot edu
Edit report at http://bugs.php.net/bug.php?id=52550&edit=1

 ID: 52550
 User updated by:regehr at cs dot utah dot edu
 Reported by:regehr at cs dot utah dot edu
 Summary:integer undefined behaviors executed during "make
 test"
 Status: Analyzed
 Type:   Bug
 Package:*General Issues
 Operating System:   linux
 PHP Version:trunk-SVN-2010-08-06 (snap)
 Block user comment: N

 New Comment:

Hi Rasmus-- You're right, this overflow is not totally obvious. It
occurs when '2147483647;' is passed to parse_iv2() in this test:



  ext/standard/tests/serialize/serialization_miscTypes_001.phpt



The first problem is that the signed add in (result * 10 + cursor)
overflows; the subtraction overflow is secondary.  If you re-associate
the expression and instead compute (result * 10 + (cursor - '0')) the
problems go away.


Previous Comments:

[2010-08-06 08:33:38] ras...@php.net

No, it isn't obvious since that line of code is only executed when the
value of 

cursor is between '0' and '9'.  It would require the argument to
parse_iv2() to be  

above MAXINT which re2c checks for earlier.


[2010-08-06 08:10:22] regehr at cs dot utah dot edu

Hi--  It's not static analysis and there are no false positives.  These
behaviors really happen (unless our tool is buggy, of course this is
always possible).



Yes, I should have edited out the undefined behavior that occurred
during conftest.



My copy of var_unserializer.c has this code at line 228:



result = result * 10 + cursor - '0';



It looks to me like "result * 10 + cursor" evaluates to -2147483601 and
then the subtraction overflow occurs.  This is not obvious?  Anyway,
this is easy to verify: put an appropriate assertion in the code and run
"make test" yourself.


[2010-08-06 08:00:32] ras...@php.net

They don't make much sense to me.  Starting from the bottom,
conftest.cpp is a 

test file generated by the autoconf/libtool chain and only used during
the 

configure run.  So even if there was an issue in that, it really
wouldn't matter 

since no user data ever gets to it, and even if it did, you are
reporting it to 

the wrong project.



Next one up, ext/standard/var_unserializer.c line 228?  There is no
substraction 

there.  But assuming it means close to line 228, it would be in the
parse_iv2() 

function?  I see nothing wrong with that code.  The only code in it that
does 

any sort of addition is:



if (cursor >= '0' && cursor <= '9') {

result = result * 10 + cursor - '0';



How exactly do you get a signed subtraction overflow from that?  cursor
is 

constrained and result is initialized to 0.



The 3rd last one seems to point at the same code.



There may very well be bugs hiding in there, but a static analysis full
of false 

positives isn't very useful.


[2010-08-06 07:30:29] regehr at cs dot utah dot edu

Description:

I run php-trunk-201008060430's "make test" under a tool that detects
integer undefined behaviors.  This is on an x86 box running Ubuntu
10.04.  The list of problems is below.  Some of these could be security
problems waiting to happen.



Hopefully the error messages are self-explanatory.  If more details are
required, please let me know.



 :
Op: +, Reason : Signed Addition Overflow, BINARY OPERATION: left
(int32): 2147483640 right (int32): 9 



 :
Op: -, Reason : Signed Subtraction Overflow, UNARY OPERATION: left
(int32): 0 right (int32): -2147483648 



 :
Op: +, Reason : Signed Addition Overflow, BINARY OPERATION: left
(int32): 2147483640 right (int32): 8 



 :
Op: -, Reason : Signed Subtraction Overflow, UNARY OPERATION: left
(int32): 0 right (int32): -2147483648 



 : Op:
+, Reason : Signed Addition Overflow, BINARY OPERATION: left (int32):
2147483640 right (int32): 8 



 : Op:
-, Reason : Signed Subtraction Overflow, UNARY OPERATION: left (int32):
0 right (int32): -2147483648 




: Op: <<, Reason : Signed Left Shift Error: Right operand is negative or
is greater than or equal to the width of the promoted left operand,
BINARY OPERATION: left (int32): 0 right (int32): 65 




: Op: >>, Reason : Signed Right Shift Error: Right operand is negative
or is greater than or equal to the width of the promoted left operand,
BINARY OPERATION: left (int32): 0 right (int32): 65 




: Op: +, Reason : Signed Addition Overflow, BINARY OPERATION: left
(int32): 2147483647 right (int32): 1 




: Op: -, Reason : Signed Subtraction Overflow, BINARY OPERATION: left
(int32): -2147483648 right (int32): 1 



 : Op: *, Reason : Signed Multiplication Overflow, BINARY
OPERATION: left (int32): 255 right (int32): 16777216 



 

Bug #52257 [Opn]: module php5-librdf causes libxslt's security module to fail

2010-08-06 Thread lsmith
Edit report at http://bugs.php.net/bug.php?id=52257&edit=1

 ID: 52257
 Updated by: lsm...@php.net
 Reported by:matth at mlalonde dot net
 Summary:module php5-librdf causes libxslt's security module
 to fail
 Status: Open
 Type:   Bug
 Package:XSLT related
 Operating System:   Ubuntu LTS
 PHP Version:5.3.2
 Block user comment: N

 New Comment:

to add some more context about the issue, i talked to the author of php
rdf ext 

on the #reland freenode IRC channel:



[15:23]  lsmith: it's not the php module, it's raptor which
redland uses

[15:23]  it sets the libxslt security policy

[15:24]  http://librdf.org/raptor/api-1.4/raptor-section-

general.html#raptor-set-libxslt-security-preferences

[15:25]  it's hard to do - how is raptor/redland suppose to know
when a 

calling application is also wanting to adjust parameters of a shared
library

[15:26]  it's the calling app's responsibility - php in this
case


Previous Comments:

[2010-07-30 10:55:44] penny at liip dot ch

I had exactly the same problem with the following versions:



libxslt1.1  1.1.24-2

php55.2.6.dfsg.1-1+lenny8

php5-librdf 1.0.7.1-1+b1



Purging php5-librdf fixed the problem.


[2010-07-06 00:46:03] matth at mlalonde dot net

Description:

I have been able to replicate under three environment running Ubuntu LTS
php5 (cli, cgi or mod_php), libxslt 1.1.26 and the php5 module and
librdf0 and the php5 module.



With the above setup, any  call will
fail with the error



XSLTProcessor::importStylesheet(): Local file read for
/path/to/local/file.xsl refused



Using XSLCache will result in a segfault and no errors.



Removing php5's librdf module fixes the issue.

Test script:
---
# a.php 

load($xsl_filename);

$xsl->importStyleSheet($doc);



$doc->load($xml_filename);

echo $xsl->transformToXML($doc);



# collection.xml



 

  Fight for your mind

  Ben Harper

  1995

 

 

  Electric Ladyland

  Jimi Hendrix

  1997

 





# collection.xsl

http://www.w3.org/1999/XSL/Transform";>

 

 

 

 

  Hey! Welcome to 's sweet CD
collection!

  

 

 

  

  by  - 

  

 





# collection2.xsl

http://www.w3.org/1999/XSL/Transform";>

 

 

 

  Hey! Welcome to 's sweet CD
collection!

  

 

 

  

  by00  - 

  

 





Expected result:

A parsed XSLT document with the imported stylesheets. And no errors ;)

Actual result:
--
Warning: XSLTProcessor::importStylesheet(): error in /var/www/temp/a.php
on line 14



Call Stack:

0.0002 627304   1. {main}() /var/www/temp/a.php:0

0.0006 631128   2. XSLTProcessor->importStylesheet()
/var/www/temp/a.php:14





Warning: XSLTProcessor::importStylesheet(): Local file read for
file:///var/www/pgadmin/temp/collection2.xsl refused in
/var/www/temp/a.php on line 14



Call Stack:

0.0002 627304   1. {main}() /var/www/temp/a.php:0

0.0006 631128   2. XSLTProcessor->importStylesheet()
/var/www/temp/a.php:14








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


Bug #52557 [Com]: php_mcrypt.dll missing

2010-08-06 Thread lars at abusiness dot dk
Edit report at http://bugs.php.net/bug.php?id=52557&edit=1

 ID: 52557
 Comment by: lars at abusiness dot dk
 Reported by:lars at abusiness dot dk
 Summary:php_mcrypt.dll missing
 Status: Bogus
 Type:   Bug
 Package:Windows Installer
 Operating System:   Windows
 PHP Version:5.3.3
 Block user comment: N

 New Comment:

It seems to be present anyway.

It's compiled with the argument "--with-mcrypt=static"


Previous Comments:

[2010-08-06 15:13:09] paj...@php.net

what's about checking your phpinfo?


[2010-08-06 15:02:23] lars at abusiness dot dk

Description:

The php_mcrypt.dll is missing from the installer files of version 5.3.3.
However it is present in version 5.2.14. 

Test script:
---
no sample code







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


Bug #52557 [Opn->Bgs]: php_mcrypt.dll missing

2010-08-06 Thread pajoye
Edit report at http://bugs.php.net/bug.php?id=52557&edit=1

 ID: 52557
 Updated by: paj...@php.net
 Reported by:lars at abusiness dot dk
 Summary:php_mcrypt.dll missing
-Status: Open
+Status: Bogus
 Type:   Bug
 Package:Windows Installer
 Operating System:   Windows
 PHP Version:5.3.3
 Block user comment: N

 New Comment:

what's about checking your phpinfo?


Previous Comments:

[2010-08-06 15:02:23] lars at abusiness dot dk

Description:

The php_mcrypt.dll is missing from the installer files of version 5.3.3.
However it is present in version 5.2.14. 

Test script:
---
no sample code







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


[PHP-BUG] Bug #52558 [NEW]: multi curl fails to return response, where curl does.

2010-08-06 Thread malaimo at sesda2 dot com
From: 
Operating system: linux 2.6.32-24 libcurl 7.21.0
PHP version:  5.3.3
Package:  cURL related
Bug Type: Bug
Bug description:multi curl fails to return response, where curl does.

Description:

When using both curl and multi_curl i get a curl_errno of 0 for each handle
while an curl_error results a string error.



When using multi_curl the error string is:  Failed connect to
ftp.nmh.ac.uk:21; Operation now in progress



When using curl the error string is: couldn't connect to host



Using multi_curl results in a null body returned with
curl_multi_getcontent

Using curl yields the data of the file when using curl_exec

Test script:
---
two scripts are below to reproduce.



# multi_curl method

ftp://ftp.nmh.ac.uk/wdc/obsdata/hourval/single_year/1914/sod1914.wdc',

  'http://spc.igpp.ucla.edu/uclamag/ffi/lal/B99300_LAL.ffd',

  'ftp://ftp.nmh.ac.uk/wdc/obsdata/hourval/single_year/1922/hua1922.wdc',

 
'http://vmo.igpp.ucla.edu/data1/Weygand/ProcessedSolarWindGSE/ACE/mag/2000/acemag21.dat'

);



foreach ($dlFiles as $x => $file) {

  $curls[$x] = curl_init();

  curl_setopt($curls[$x], CURLOPT_URL, $file);

  curl_setopt($curls[$x], CURLOPT_RETURNTRANSFER, 1);

  curl_setopt($curls[$x], CURLOPT_FOLLOWLOCATION, 1);

  curl_multi_add_handle($cmh, $curls[$x]);

}



$active = null;



do {

  $mrc = curl_multi_exec($cmh, $active);

} while ($mrc == CURLM_CALL_MULTI_PERFORM);



while ($active && $mrc == CURLM_OK) {

  if (curl_multi_select($cmh) != -1) {

do {

 $mrc = curl_multi_exec($cmh, $active);

} while ($mrc == CURLM_CALL_MULTI_PERFORM);

  }

}



foreach ($dlFiles as $x => $file) {

  var_dump(substr(curl_multi_getcontent($curls[$x]), 0, 10),
curl_errno($curls[$x]), curl_error($curls[$x]));

  curl_multi_remove_handle($cmh, $curls[$x]);

  curl_close($curls[$x]);

}



curl_multi_close($cmh);





?>



# curl method

ftp://ftp.nmh.ac.uk/wdc/obsdata/hourval/single_year/1914/sod1914.wdc',

  'http://spc.igpp.ucla.edu/uclamag/ffi/lal/B99300_LAL.ffd',

  'ftp://ftp.nmh.ac.uk/wdc/obsdata/hourval/single_year/1922/hua1922.wdc',

 
'http://vmo.igpp.ucla.edu/data1/Weygand/ProcessedSolarWindGSE/ACE/mag/2000/acemag21.dat'

);



foreach ($dlFiles as $x => $file) {

  $ch = curl_init();

  curl_setopt($ch, CURLOPT_URL, $file);

  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);



  var_dump(substr(curl_exec($ch), 0, 10), curl_errno($ch),
curl_error($ch));



  curl_close($ch);

}



?>

Expected result:

no errors at all and multi_curl letting me get the contents of the curl.

Actual result:
--
multi_curl



bool(false)

int(0)

string(61) "Failed connect to ftp.nmh.ac.uk:21; Operation now in progress"

string(10) "����

int(0)

string(0) ""

bool(false)

int(0)

string(61) "Failed connect to ftp.nmh.ac.uk:21; Operation now in progress"

string(10) "01 01 2000"

int(0)

string(0) ""



for curl

string(10) "SOD1401X01"

int(0)

string(24) "couldn't connect to host"

string(10) "����

int(0)

string(0) ""

string(10) "HUA22 1D 1"

int(0)

string(24) "couldn't connect to host"

string(10) "01 01 2000"

int(0)

string(0) ""

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

[PHP-BUG] Bug #52557 [NEW]: php_mcrypt.dll missing

2010-08-06 Thread lars at abusiness dot dk
From: 
Operating system: Windows
PHP version:  5.3.3
Package:  Windows Installer
Bug Type: Bug
Bug description:php_mcrypt.dll missing

Description:

The php_mcrypt.dll is missing from the installer files of version 5.3.3.
However it is present in version 5.2.14. 

Test script:
---
no sample code


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



Bug #52556 [Opn]: PEAR, PECL and PHAR does not respect --program_suffix

2010-08-06 Thread php-bugs at majkl578 dot cz
Edit report at http://bugs.php.net/bug.php?id=52556&edit=1

 ID: 52556
 User updated by:php-bugs at majkl578 dot cz
 Reported by:php-bugs at majkl578 dot cz
 Summary:PEAR, PECL and PHAR does not respect
 --program_suffix
 Status: Open
 Type:   Bug
 Package:PHAR related
 Operating System:   Linux Debian
 PHP Version:trunk-SVN-2010-08-06 (snap)
 Block user comment: N

 New Comment:

Sorry, --program_suffix should obviously be --program-suffix.


Previous Comments:

[2010-08-06 14:16:39] php-bugs at majkl578 dot cz

Description:

PEAR, PECL and PHAR does not respect --program_suffix.

Test script:
---
./configure --program-suffix=-trunk

Expected result:

Binaries:

pear-trunk

peardev-trunk

pecl-trunk

phar-trunk

phar-trunk.phar

Actual result:
--
Binaries:

pear

peardev

pecl

phar

phar.phar






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


[PHP-BUG] Bug #52556 [NEW]: PEAR, PECL and PHAR does not respect --program_suffix

2010-08-06 Thread php-bugs at majkl578 dot cz
From: 
Operating system: Linux Debian
PHP version:  trunk-SVN-2010-08-06 (snap)
Package:  PHAR related
Bug Type: Bug
Bug description:PEAR, PECL and PHAR does not respect --program_suffix

Description:

PEAR, PECL and PHAR does not respect --program_suffix.

Test script:
---
./configure --program-suffix=-trunk

Expected result:

Binaries:

pear-trunk

peardev-trunk

pecl-trunk

phar-trunk

phar-trunk.phar

Actual result:
--
Binaries:

pear

peardev

pecl

phar

phar.phar

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



Bug #52555 [Com]: Headers_List not returning HTTP Status Code

2010-08-06 Thread dragoo...@php.net
Edit report at http://bugs.php.net/bug.php?id=52555&edit=1

 ID: 52555
 Comment by: dragoo...@php.net
 Reported by:dragoo...@php.net
 Summary:Headers_List not returning HTTP Status Code
 Status: Bogus
 Type:   Bug
 Package:*Web Server problem
 PHP Version:5.3.3
 Assigned To:dragoonis
 Block user comment: N

 New Comment:

As per IRC conversations, the status_line or http_response_code are not
headers therefore should not be returned from headers_list() so the
conclusion is to make a new function to give you http_response_code. I
will update this ticket with the patch.


Previous Comments:

[2010-08-06 13:42:58] johan...@php.net

RFC 2616 (Hypertext Transfer Protocol -- HTTP/1.1) makes a difference
between the Status-Line (6.1) and the Headers (6.2) that we allow
setting the Status-Line via header() is kind of a hack, headers_list()
should only list headers so users can work with them easily (like
splitting up at ": " etc.)


[2010-08-06 12:50:43] dragoo...@php.net

Description:

Ok so i've found the reason why this doesn't work but i'd like feedback
on the appropriate area to change as this looks like it was
intentionally developed this way.



headers_list() gets passed SG(sapi_headers).headers and prints them.

This works however when you do header() -> sapi_header_op() and you set
a response code such as 'HTTP/1.0 404 Not Found'.

It does not put this header into SG(sapi_headers).headers but it puts it
into SG(sapi_headers).http_response_code instead.



This looks to be intentional as there are special functions for updating
the response code such as sapi_update_response_code()



So the end question is, should I modify sapi_header_op() to also include
the response code in SG(sapi_headers).headers or should I modify
headers_list() to receive SG(sapi_headers).headers and
SG(sapi_headers).http_response_code.



I could also make a new function which only returns
SG(sapi_headers).http_response_code but i think that's a waste of time
and could update headers_list() or whatnot. 



FYI: I tested apache_response_headers() and got no http response code in
their either.



Test script:
---


string(34) "X-Powered-By: PHP/5.3.2-1ubuntu4.2"

  [1]=>

string(30) "Content-type: text/plain"

  [2]=>

string(22) "HTTP/1.0 404 Not Found"

}

Actual result:
--
array(2) {

  [0]=>

string(34) "X-Powered-By: PHP/5.3.2-1ubuntu4.2"

  [1]=>

string(30) "Content-type: text/plain"

}






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


Bug #52555 [Asn->Bgs]: Headers_List not returning HTTP Status Code

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=52555&edit=1

 ID: 52555
 Updated by: johan...@php.net
 Reported by:dragoo...@php.net
 Summary:Headers_List not returning HTTP Status Code
-Status: Assigned
+Status: Bogus
 Type:   Bug
 Package:*Web Server problem
 PHP Version:5.3.3
 Assigned To:dragoonis
 Block user comment: N

 New Comment:

RFC 2616 (Hypertext Transfer Protocol -- HTTP/1.1) makes a difference
between the Status-Line (6.1) and the Headers (6.2) that we allow
setting the Status-Line via header() is kind of a hack, headers_list()
should only list headers so users can work with them easily (like
splitting up at ": " etc.)


Previous Comments:

[2010-08-06 12:50:43] dragoo...@php.net

Description:

Ok so i've found the reason why this doesn't work but i'd like feedback
on the appropriate area to change as this looks like it was
intentionally developed this way.



headers_list() gets passed SG(sapi_headers).headers and prints them.

This works however when you do header() -> sapi_header_op() and you set
a response code such as 'HTTP/1.0 404 Not Found'.

It does not put this header into SG(sapi_headers).headers but it puts it
into SG(sapi_headers).http_response_code instead.



This looks to be intentional as there are special functions for updating
the response code such as sapi_update_response_code()



So the end question is, should I modify sapi_header_op() to also include
the response code in SG(sapi_headers).headers or should I modify
headers_list() to receive SG(sapi_headers).headers and
SG(sapi_headers).http_response_code.



I could also make a new function which only returns
SG(sapi_headers).http_response_code but i think that's a waste of time
and could update headers_list() or whatnot. 



FYI: I tested apache_response_headers() and got no http response code in
their either.



Test script:
---


string(34) "X-Powered-By: PHP/5.3.2-1ubuntu4.2"

  [1]=>

string(30) "Content-type: text/plain"

  [2]=>

string(22) "HTTP/1.0 404 Not Found"

}

Actual result:
--
array(2) {

  [0]=>

string(34) "X-Powered-By: PHP/5.3.2-1ubuntu4.2"

  [1]=>

string(30) "Content-type: text/plain"

}






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


[PHP-BUG] Bug #52555 [NEW]: Headers_List not returning HTTP Status Code

2010-08-06 Thread dragoo...@php.net
From: dragoonis
Operating system: 
PHP version:  5.3.3
Package:  *Web Server problem
Bug Type: Bug
Bug description:Headers_List not returning HTTP Status Code

Description:

Ok so i've found the reason why this doesn't work but i'd like feedback on
the appropriate area to change as this looks like it was intentionally
developed this way.



headers_list() gets passed SG(sapi_headers).headers and prints them.

This works however when you do header() -> sapi_header_op() and you set a
response code such as 'HTTP/1.0 404 Not Found'.

It does not put this header into SG(sapi_headers).headers but it puts it
into SG(sapi_headers).http_response_code instead.



This looks to be intentional as there are special functions for updating
the response code such as sapi_update_response_code()



So the end question is, should I modify sapi_header_op() to also include
the response code in SG(sapi_headers).headers or should I modify
headers_list() to receive SG(sapi_headers).headers and
SG(sapi_headers).http_response_code.



I could also make a new function which only returns
SG(sapi_headers).http_response_code but i think that's a waste of time and
could update headers_list() or whatnot. 



FYI: I tested apache_response_headers() and got no http response code in
their either.



Test script:
---


string(34) "X-Powered-By: PHP/5.3.2-1ubuntu4.2"

  [1]=>

string(30) "Content-type: text/plain"

  [2]=>

string(22) "HTTP/1.0 404 Not Found"

}

Actual result:
--
array(2) {

  [0]=>

string(34) "X-Powered-By: PHP/5.3.2-1ubuntu4.2"

  [1]=>

string(30) "Content-type: text/plain"

}

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



[PHP-BUG] Bug #52554 [NEW]: Sporadic PHP Segmentation fault in combination with unixODBC

2010-08-06 Thread cameron dot moller at gmail dot com
From: 
Operating system: 2.6.34-gentoo-r1  x86_64
PHP version:  5.3SVN-2010-08-06 (SVN)
Package:  ODBC related
Bug Type: Bug
Bug description:Sporadic PHP Segmentation fault in combination with unixODBC

Description:

Gentoo Linux x86_64

Kernel 2.6.34-gentoo-r1

unixODBC-2.3.0

freeTDS 0.64

PHP 5.3.2 (from Gentoo portage (~ = experimental))

(problem started on PHP 5.2.13 - I upgraded to ~5.3.2)

Apache 2.2.15

gcc 4.4.3-r2

glibc 2.11.2

MSSQL 2005 (remote server)



I have multiple pages that query the database successfully.  However, 2
queries always result in a segmentation fault.  I ran the page through gdb
and generated a backtrace.  Shown below.



The suspect sql is simply "select distinct asgn_group from
csc_report_active order by asgn_group asc"

FYI - sql via isql gives me 773 rows - no problems.



php.ini is vanilla - no changes - but dated Jul 30 - about when the problem
started.  Though I do not remember ever making any changes to php.ini

httpd.conf also vanilla as is /etc/conf.d/apache2



[I] dev-lang/php

 Available versions:  (5) 5.2.13 ~5.2.14 (~)5.3.2 ~5.3.3

{adabas apache2 bcmath berkdb birdstep bzip2 calendar cdb cgi cjk
(+)cli concurrentmodphp crypt (+)ctype curl curlwrappers db2 dbase dbmaker
debug discard-path doc embed empress empress-bcs enchant esoob exif
fastbuild fdftk +fileinfo (+)filter firebird flatfile force-cgi-redirect
fpm frontbase ftp gd gd-external gdbm gmp (+)hash (+)iconv imap inifile
interbase intl iodbc ipv6 java-external (+)json kerberos kolab ldap
ldap-sasl libedit mcve mhash msql mssql mysql mysqli mysqlnd ncurses nls
oci8 oci8-instant-client odbc pcntl (+)pcre pdo +phar pic (+)posix postgres
qdbm readline recode reflection sapdb (+)session sharedext sharedmem
(+)simplexml snmp soap sockets solid spell spl sqlite sqlite3 ssl suhosin
sybase sybase-ct sysvipc threads tidy (+)tokenizer truetype unicode wddx
xml xmlreader xmlrpc xmlwriter xpm xsl yaz zip zlib}

 Installed versions:  5.3.2(5)(08:26:30 07/30/10)(apache2 berkdb bzip2
cli crypt ctype fileinfo filter gd gdbm hash iconv imap json kerberos ldap
mssql mysql nls odbc phar posix postgres readline session simplexml ssl
tokenizer truetype unicode xml zlib -adabas -bcmath -birdstep -calendar
-cdb -cgi -cjk -concurrentmodphp -curl -curlwrappers -db2 -dbmaker -debug
-doc -embed -empress -empress-bcs -enchant -esoob -exif -firebird -flatfile
-frontbase -ftp -gd-external -gmp -inifile -interbase -intl -iodbc -ipv6
-kolab -ldap-sasl -libedit -mysqli -mysqlnd -oci8 -oci8-instant-client
-pcntl -pdo -pic -qdbm -recode -sapdb -sharedext -sharedmem -snmp -soap
-sockets -solid -spell -sqlite -sqlite3 -suhosin -sybase-ct -sysvipc
-threads -tidy -wddx -xmlreader -xmlrpc -xmlwriter -xpm -xsl -zip)





gdb /usr/bin/php



warning: Can not parse XML syscalls information; XML support was disabled
at compile time.

GNU gdb (Gentoo 7.0.1 p1) 7.0.1

Copyright (C) 2009 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later


This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.  Type "show copying"

and "show warranty" for details.

This GDB was configured as "x86_64-pc-linux-gnu".

For bug reporting instructions, please see:

...

Reading symbols from /usr/bin/php...(no debugging symbols found)...done.

(gdb) r ccc_assign_groups_activity.php

Starting program: /usr/bin/php ccc_assign_groups_activity.php

[Thread debugging using libthread_db enabled]



Program received signal SIGSEGV, Segmentation fault.

0x726cd15a in memcpy () from /lib/libc.so.6

(gdb) bt

#0  0x726cd15a in memcpy () from /lib/libc.so.6

#1  0x00644412 in _estrndup ()

#2  0x005474c8 in zif_odbc_result ()

#3  0x006828ff in ?? ()

#4  0x0067d747 in execute ()

#5  0x0065bf7f in zend_execute_scripts ()

#6  0x0061205d in php_execute_script ()

#7  0x006d569c in main ()

(gdb)





I am re-emergeing glibc just to see what happens.







Actual result:
--
gdb /usr/bin/php



warning: Can not parse XML syscalls information; XML support was disabled
at compile time.

GNU gdb (Gentoo 7.0.1 p1) 7.0.1

Copyright (C) 2009 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later


This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.  Type "show copying"

and "show warranty" for details.

This GDB was configured as "x86_64-pc-linux-gnu".

For bug reporting instructions, please see:

...

Reading symbols from /usr/bin/php...(no debugging symbols found)...done.

(gdb) r ccc_assign_groups_activity.php

Starting program: /usr/bin/php ccc_assign_groups_activity.php

[Thread debugging using libthread_db enabled]



Program received signal SIGS

Bug #52549 [Opn->Fbk]: No 'M' in memory_limit variable returns 'Could not startup.' Possible mem leak?

2010-08-06 Thread mike
Edit report at http://bugs.php.net/bug.php?id=52549&edit=1

 ID: 52549
 Updated by: m...@php.net
 Reported by:zack_gold at yahoo dot com
 Summary:No 'M' in memory_limit variable returns 'Could not
 startup.' Possible mem leak?
-Status: Open
+Status: Feedback
 Type:   Bug
 Package:PHP options/info functions
 Operating System:   Linux (Arch Linux)
 PHP Version:5.3.3
 Block user comment: N

 New Comment:

It actually is set properly, you set it to 50 bytes, which is too less
to start up.


Previous Comments:

[2010-08-06 04:00:32] zack_gold at yahoo dot com

Description:

When you put this into php.ini:

memory_limit = 50;



The output results in:

Could not startup.





There should be a notification to let you know that the memory_limit
isn't set 

properly. Maybe it's possible to do memory leaking or something like
that through 

this? My knowledge for memory-related stuff is one to none, but maybe
there's a 

potential bug here...

Test script:
---
Change php.ini memory_limit to "50" like so:



memory_limit = 50;







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


[PHP-BUG] Bug #52553 [NEW]: the result is different between php versions

2010-08-06 Thread dataget2001 at yahoo dot co dot jp
From: 
Operating system: 
PHP version:  Irrelevant
Package:  SimpleXML related
Bug Type: Bug
Bug description:the result is different between php versions

Description:

the result of test script below is different between php version 5.1.6 and
version 5.3.2.



Test script:
---
');

$foo1->addChild("x", htmlspecialchars(""));



$foo2 = new SimpleXMLElement('');

$foo2->x = htmlspecialchars("");



var_dump($foo1->x);

var_dump($foo2->x);

var_dump($foo1->asXML() === $foo2->asXML());



?>

Expected result:

string(5) "5.1.6"

object(SimpleXMLElement)#3 (1) {

  [0]=>

  string(8) ""

}

object(SimpleXMLElement)#3 (1) {

  [0]=>

  string(8) ""

}

bool(true)





Actual result:
--
string(5) "5.3.2"

object(SimpleXMLElement)#3 (1) {

  [0]=>

  string(8) ""

}

object(SimpleXMLElement)#3 (1) {

  [0]=>

  string(14) ""

}

bool(false)



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



Bug #52552 [Opn->Bgs]: create_function on stdClass Object

2010-08-06 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=52552&edit=1

 ID: 52552
 Updated by: johan...@php.net
 Reported by:andree at froglogic dot com
 Summary:create_function on stdClass Object
-Status: Open
+Status: Bogus
 Type:   Bug
 Package:Class/Object related
 Operating System:   linux
 PHP Version:5.2.14
 Block user comment: N

 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

PHP differentiates between properties and methods.


Previous Comments:

[2010-08-06 10:19:06] andree at froglogic dot com

Description:

The create_function doesn't work on stdClass Object's like the below
source.







Test script:
---
$foo = new stdClass;

$foo->bar = create_function('','echo "bar";');

$foo->bar(); // doesn't work 

Expected result:

The expected result ist, to get the return value of the attached
function.







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


[PHP-BUG] Bug #52552 [NEW]: create_function on stdClass Object

2010-08-06 Thread andree at froglogic dot com
From: 
Operating system: linux
PHP version:  5.2.14
Package:  Class/Object related
Bug Type: Bug
Bug description:create_function on stdClass Object

Description:

The create_function doesn't work on stdClass Object's like the below
source.







Test script:
---
$foo = new stdClass;

$foo->bar = create_function('','echo "bar";');

$foo->bar(); // doesn't work 

Expected result:

The expected result ist, to get the return value of the attached function.


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