#40602 [NEW]: spl

2007-02-23 Thread andoriyu at gmail dot com
From: andoriyu at gmail dot com
Operating system: FreeBSD 6.0-Realese
PHP version:  5.2.1
PHP Bug Type: Compile Failure
Bug description:  spl

Description:

Problem in SPL

Reproduce code:
---
http://pastebin.ru/7923


-- 
Edit bug report at http://bugs.php.net/?id=40602&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40602&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40602&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40602&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40602&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=40602&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=40602&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=40602&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=40602&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=40602&r=support
Expected behavior:http://bugs.php.net/fix.php?id=40602&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=40602&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=40602&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40602&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40602&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40602&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=40602&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=40602&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40602&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=40602&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=40602&r=mysqlcfg


#40578 [Csd]: Thread safety issue with imagettftext

2007-02-23 Thread derick
 ID:   40578
 Updated by:   [EMAIL PROTECTED]
 Reported By:  scottmacvicar at ntlworld dot com
 Status:   Closed
 Bug Type: GD related
 Operating System: RHEL 4
 PHP Version:  5.2.1
 Assigned To:  pajoye
 New Comment:

Yes, sure.


Previous Comments:


[2007-02-23 01:12:46] scottmacvicar at ntlworld dot com

Antony backported the initial fix to PHP_4_4, can this be 
backported too please.



[2007-02-23 01:04:17] [EMAIL PROTECTED]

This bug has been fixed in CVS.

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.

Fixed in 5.2 and HEAD.

Thanks for the tests



[2007-02-23 00:52:41] scottmacvicar at ntlworld dot com

Been going for almost 24 hours now without any more crashes, 
the patch makes sense though. Since there was another race 
condition on shutdown if one thread is accessing the cache 
while another is trying to delete it.



[2007-02-22 01:48:56] scottmacvicar at ntlworld dot com

Applied now to one of our production boxes, When I'm back in 
the office tomorrow I'll see if I can spend a little time 
working out a test case to reproduce it.



[2007-02-22 00:57:19] [EMAIL PROTECTED]

It looks like something else.

Can you try:

http://pecl.php.net/~pierre/40568.txt





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/40578

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


#40602 [Opn->Bgs]: spl

2007-02-23 Thread derick
 ID:   40602
 Updated by:   [EMAIL PROTECTED]
 Reported By:  andoriyu at gmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Compile Failure
 Operating System: FreeBSD 6.0-Realese
 PHP Version:  5.2.1
 New Comment:

Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


Looks like a patched source as well. You need to try the official
source.


Previous Comments:


[2007-02-23 08:08:08] andoriyu at gmail dot com

Description:

Problem in SPL

Reproduce code:
---
http://pastebin.ru/7923






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


#40603 [NEW]: informix moved to PECL

2007-02-23 Thread kprzemek at coig dot katowice dot pl
From: kprzemek at coig dot katowice dot pl
Operating system: RHEL 4
PHP version:  5.2.1
PHP Bug Type: Feature/Change Request
Bug description:  informix moved to PECL

Description:

Hello
I guess why in the php5.2.1 the current support for the driver for
Informix  DB has been changed. I can't switch to php5.2.1, because there
is no --with-informix in the compilation options. 90% of my applications
are mission critical and Informix DB based. I use AdoDB and native
functions. How I'm supposed to tell our developers that they would have to
rewrite the application and change all the instructions e.g.: ifx_connect,
etc for PDO. This is the worst fitcher I have ever heard I'm sure I'm
not the only one with this problem, because IBM Informix is used by
millions of peole all over the world. I need your help in order to compile
 php5.2.1  with --with-informix option if  "...are strongly encouraged to
upgrade to it as soon as possible..."
I have no options to compile it!!!
Regards Przemek


-- 
Edit bug report at http://bugs.php.net/?id=40603&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40603&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40603&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40603&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40603&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=40603&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=40603&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=40603&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=40603&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=40603&r=support
Expected behavior:http://bugs.php.net/fix.php?id=40603&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=40603&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=40603&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40603&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40603&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40603&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=40603&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=40603&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40603&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=40603&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=40603&r=mysqlcfg


#40603 [Opn->Fbk]: informix moved to PECL

2007-02-23 Thread derick
 ID:   40603
 Updated by:   [EMAIL PROTECTED]
 Reported By:  kprzemek at coig dot katowice dot pl
-Status:   Open
+Status:   Feedback
 Bug Type: Feature/Change Request
 Operating System: RHEL 4
 PHP Version:  5.2.1
 New Comment:

Why can't you install it from PECL?


Previous Comments:


[2007-02-23 08:27:49] kprzemek at coig dot katowice dot pl

Description:

Hello
I guess why in the php5.2.1 the current support for the driver for
Informix  DB has been changed. I can't switch to php5.2.1, because
there is no --with-informix in the compilation options. 90% of my
applications are mission critical and Informix DB based. I use AdoDB
and native functions. How I'm supposed to tell our developers that they
would have to rewrite the application and change all the instructions
e.g.: ifx_connect, etc for PDO. This is the worst fitcher I have ever
heard I'm sure I'm not the only one with this problem, because IBM
Informix is used by millions of peole all over the world. I need your
help in order to compile  php5.2.1  with --with-informix option if 
"...are strongly encouraged to upgrade to it as soon as possible..."
I have no options to compile it!!!
Regards Przemek






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


#40542 [Com]: "ORA-02248: invalid option for ALTER SESSION" on OCIPLogon

2007-02-23 Thread jmgonet at iware dot ch
 ID:   40542
 Comment by:   jmgonet at iware dot ch
 Reported By:  marvin at chag dot net
 Status:   Open
 Bug Type: OCI8 related
 Operating System: Linux
 PHP Version:  5.2.1
 New Comment:

I've found the following workaround for that problem:

- Instead of setting the NLS_LANG environment variable, you can specify
the charset while establishing the connection:

$conn=oci_connect("USER","PASSWORD","SERVER","CHARSET");

Where charset should be the one used by PHP client (not the one used by
the Oracle server). In the case of a windows system, it is
"WE8MSWIN1252" (In my PHP server, this code is specified in the
NLS_LANG registry key, but oci_connect doesn't take it as default
value). It is "WE8MSWIN1252" even if the PHP is executed as a script,
from the command line.

The CHARSET for a linux/unix system may be "WE8ISO8851P1", or at least
it seems to be usual in Europe.


Previous Comments:


[2007-02-23 07:31:42] jmgonet at iware dot ch

I have just the same problem, executing a PHP script as a Windows'
batch. I've set the NLS_LANG environment variable to
'NLS_LANG=FRENCH_SWITZERLAND.WE8PC850'.

I'm using Oracle 10 light client.

I've found in this (http://dbforums.com/t927204.html) and other forums,
a possible explanation:

'NLS_LANG cannot be changed by alter session, NLS_LANGUAGE and
NLS_TERRITORY can.'



[2007-02-22 07:13:19] marvin at chag dot net

Hi Tony2001, 
Thank you very much for the kind offer. Unfortunately our companies
security policies does not allow such an approach. But I will happily
investigate the problem according to your requirements and send you the
debugging information & results you need to isolate the problematic
lines.



[2007-02-20 10:03:38] [EMAIL PROTECTED]

>So I kindly ask, wether you please can tell me what else
>should cause this problem, if not PHP / OCI8?

Sure. I'd look in Oracle or in the client library.
With such an old version it's no wonder there are problems.

Though, we can try do it this way:
Please install 5.1.1 and make sure it does work fine.
Then I'll need an unprivileged ssh account on your machine to install
5.2.1, reproduce the problem and investigate it.
I'll also need Oracle connection details.



[2007-02-20 07:52:53] marvin at chag dot net

open again



[2007-02-19 13:37:20] marvin at chag dot net

Hi Tony2001, 

The only change to our systems is switching between PHP <= 5.1.1 and
PHP >= 5.1.2 (today it was 5.2.1). 

The result is: for PHP <= 5.1.1 the database connections are working
fine and for PHP >= 5.1.2 they are not.

So I kindly ask, wether you please can tell me what else should cause
this problem, if not PHP / OCI8?
 
Sadly upgrading this databases in this special configuration is no
option. PHP documentation http://de.php.net/manual/en/ref.oci8.php
states that OCI8 can be used for Oracle 7 and 8 databases, though.



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/40542

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


#40604 [NEW]: Objects disappear from the global scope

2007-02-23 Thread dagdamor at simps dot ru
From: dagdamor at simps dot ru
Operating system: Windows
PHP version:  5.2.1
PHP Bug Type: Class/Object related
Bug description:  Objects disappear from the global scope

Description:

Objects seem to disappear from the global scope when you try to access
them from the output buffer callback function. Regular variables (i.e. not
objects) don't disappear and work alright.

After some additional research I've noticed that if your PHP program has
many objects in the global scope, some of them don't disappear, while
others do. Looks very strange...

I hope this is not documentation misinterpretation, because I used global
variables, objects including in OB callbacks in PHP4, and it worked fine.
In other words, I hope this is not "You can't use global variables there"
case.

Reproduce code:
---


Expected result:

OK

Actual result:
--
Error

-- 
Edit bug report at http://bugs.php.net/?id=40604&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40604&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40604&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40604&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40604&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=40604&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=40604&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=40604&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=40604&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=40604&r=support
Expected behavior:http://bugs.php.net/fix.php?id=40604&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=40604&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=40604&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40604&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40604&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40604&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=40604&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=40604&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40604&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=40604&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=40604&r=mysqlcfg


#40603 [Fbk->Opn]: informix moved to PECL

2007-02-23 Thread kprzemek at coig dot katowice dot pl
 ID:   40603
 User updated by:  kprzemek at coig dot katowice dot pl
 Reported By:  kprzemek at coig dot katowice dot pl
-Status:   Feedback
+Status:   Open
 Bug Type: Feature/Change Request
 Operating System: RHEL 4
 PHP Version:  5.2.1
 New Comment:

I installed from PECL but in the PECL there is only PDO version, which
means I can't use ifx_connect, ifx_query,etc. but PDO(informix:...),
query(); Shall I rewrite the application?


Previous Comments:


[2007-02-23 08:41:24] [EMAIL PROTECTED]

Why can't you install it from PECL?



[2007-02-23 08:27:49] kprzemek at coig dot katowice dot pl

Description:

Hello
I guess why in the php5.2.1 the current support for the driver for
Informix  DB has been changed. I can't switch to php5.2.1, because
there is no --with-informix in the compilation options. 90% of my
applications are mission critical and Informix DB based. I use AdoDB
and native functions. How I'm supposed to tell our developers that they
would have to rewrite the application and change all the instructions
e.g.: ifx_connect, etc for PDO. This is the worst fitcher I have ever
heard I'm sure I'm not the only one with this problem, because IBM
Informix is used by millions of peole all over the world. I need your
help in order to compile  php5.2.1  with --with-informix option if 
"...are strongly encouraged to upgrade to it as soon as possible..."
I have no options to compile it!!!
Regards Przemek






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


#40604 [Opn->Bgs]: Objects disappear from the global scope

2007-02-23 Thread helly
 ID:   40604
 Updated by:   [EMAIL PROTECTED]
 Reported By:  dagdamor at simps dot ru
-Status:   Open
+Status:   Bogus
 Bug Type: Class/Object related
 Operating System: Windows
 PHP Version:  5.2.1
 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

the object gets destroyed before you get output - well actually you
don't produce output


Previous Comments:


[2007-02-23 08:49:07] dagdamor at simps dot ru

Description:

Objects seem to disappear from the global scope when you try to access
them from the output buffer callback function. Regular variables (i.e.
not objects) don't disappear and work alright.

After some additional research I've noticed that if your PHP program
has many objects in the global scope, some of them don't disappear,
while others do. Looks very strange...

I hope this is not documentation misinterpretation, because I used
global variables, objects including in OB callbacks in PHP4, and it
worked fine. In other words, I hope this is not "You can't use global
variables there" case.

Reproduce code:
---


Expected result:

OK

Actual result:
--
Error





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


#40542 [Opn]: "ORA-02248: invalid option for ALTER SESSION" on OCIPLogon

2007-02-23 Thread marvin at chag dot net
 ID:   40542
 User updated by:  marvin at chag dot net
 Reported By:  marvin at chag dot net
 Status:   Open
 Bug Type: OCI8 related
 Operating System: Linux
 PHP Version:  5.2.1
 New Comment:

I tried the workaround jmgonet kindly rovided and removed all NLS_LANG
setting from environment and startup scripts of the Apache server. The
problem persists in exactly the same way as before. Adding the charset
to the OCILogon did not help either. So maybe another env. variable
tries to "alter session"?


Previous Comments:


[2007-02-23 08:43:23] jmgonet at iware dot ch

I've found the following workaround for that problem:

- Instead of setting the NLS_LANG environment variable, you can specify
the charset while establishing the connection:

$conn=oci_connect("USER","PASSWORD","SERVER","CHARSET");

Where charset should be the one used by PHP client (not the one used by
the Oracle server). In the case of a windows system, it is
"WE8MSWIN1252" (In my PHP server, this code is specified in the
NLS_LANG registry key, but oci_connect doesn't take it as default
value). It is "WE8MSWIN1252" even if the PHP is executed as a script,
from the command line.

The CHARSET for a linux/unix system may be "WE8ISO8851P1", or at least
it seems to be usual in Europe.



[2007-02-23 07:31:42] jmgonet at iware dot ch

I have just the same problem, executing a PHP script as a Windows'
batch. I've set the NLS_LANG environment variable to
'NLS_LANG=FRENCH_SWITZERLAND.WE8PC850'.

I'm using Oracle 10 light client.

I've found in this (http://dbforums.com/t927204.html) and other forums,
a possible explanation:

'NLS_LANG cannot be changed by alter session, NLS_LANGUAGE and
NLS_TERRITORY can.'



[2007-02-22 07:13:19] marvin at chag dot net

Hi Tony2001, 
Thank you very much for the kind offer. Unfortunately our companies
security policies does not allow such an approach. But I will happily
investigate the problem according to your requirements and send you the
debugging information & results you need to isolate the problematic
lines.



[2007-02-20 10:03:38] [EMAIL PROTECTED]

>So I kindly ask, wether you please can tell me what else
>should cause this problem, if not PHP / OCI8?

Sure. I'd look in Oracle or in the client library.
With such an old version it's no wonder there are problems.

Though, we can try do it this way:
Please install 5.1.1 and make sure it does work fine.
Then I'll need an unprivileged ssh account on your machine to install
5.2.1, reproduce the problem and investigate it.
I'll also need Oracle connection details.



[2007-02-20 07:52:53] marvin at chag dot net

open again



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/40542

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


#40603 [Opn]: informix moved to PECL

2007-02-23 Thread pajoye
 ID:   40603
 Updated by:   [EMAIL PROTECTED]
 Reported By:  kprzemek at coig dot katowice dot pl
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: RHEL 4
 PHP Version:  5.2.1
 New Comment:

You can fetch it from CVS:

http://cvs.php.net/viewvc.cgi/pecl/informix/




Previous Comments:


[2007-02-23 08:59:26] kprzemek at coig dot katowice dot pl

I installed from PECL but in the PECL there is only PDO version, which
means I can't use ifx_connect, ifx_query,etc. but PDO(informix:...),
query(); Shall I rewrite the application?



[2007-02-23 08:41:24] [EMAIL PROTECTED]

Why can't you install it from PECL?



[2007-02-23 08:27:49] kprzemek at coig dot katowice dot pl

Description:

Hello
I guess why in the php5.2.1 the current support for the driver for
Informix  DB has been changed. I can't switch to php5.2.1, because
there is no --with-informix in the compilation options. 90% of my
applications are mission critical and Informix DB based. I use AdoDB
and native functions. How I'm supposed to tell our developers that they
would have to rewrite the application and change all the instructions
e.g.: ifx_connect, etc for PDO. This is the worst fitcher I have ever
heard I'm sure I'm not the only one with this problem, because IBM
Informix is used by millions of peole all over the world. I need your
help in order to compile  php5.2.1  with --with-informix option if 
"...are strongly encouraged to upgrade to it as soon as possible..."
I have no options to compile it!!!
Regards Przemek






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


#40601 [Opn->Bgs]: imagesavealpha() has opposite effect on transparent color

2007-02-23 Thread pajoye
 ID:   40601
 Updated by:   [EMAIL PROTECTED]
 Reported By:  seth at pricepages dot org
-Status:   Open
+Status:   Bogus
 Bug Type: GD related
 Operating System: Mac 10.4
 PHP Version:  5.2.1
-Assigned To:  
+Assigned To:  pajoye
 New Comment:

Transparent color and alpha cannot work together when you save a file.
PNG supports one or another not both (PNG is also the only format
supporting alpha).

You will get a warning/error in libpng if you try to do the same calls
(for example in C).

not a bug > bogus.



Previous Comments:


[2007-02-23 03:04:57] seth at pricepages dot org

Description:

The function imagesavealpha() has an opposite effect on the 
output image if the color is marked as transparent. For 
example, the code below should always create a clear image. 
But it renders as black.

The interesting thing is that if you remove the imagesavealpha
, the image renders as expected (clear).

Reproduce code:
---


Expected result:

nothing (a clear image)

Actual result:
--
a solid black image





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


#40326 [Com]: Can't open file from cwd if parent folder not readable

2007-02-23 Thread tlaramie at superb dot net
 ID:   40326
 Comment by:   tlaramie at superb dot net
 Reported By:  sborrill at precedence dot co dot uk
 Status:   No Feedback
 Bug Type: Streams related
 Operating System: NetBSD 3.1_STABLE
 PHP Version:  5.2.0
 New Comment:

I can replicate the issue verbatim on PHP 5.2.1 on Solaris 9 (SPARC).
Login information for testing by one of the developers is available per
their request.


Previous Comments:


[2007-02-20 01:00:00] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".



[2007-02-12 17:49:28] [EMAIL PROTECTED]

Please provide an account on this machine.



[2007-02-10 21:39:07] sborrill at precedence dot co dot uk

I've tracked this down to changes to virtual_file_ex() which is called
from expand_filepath(). expand_filepath() returns "/file" from "file"
with 5.2.0 (and later), but returns "file" with 5.1.6 and earlier. This
is down to changes between revisions 1.74.2.9 (v5.1.6) and 1.74.2.9.2.9
(v5.2.0) of TSRM/tsrm_virtual_cwd.c. I've not yet tracked it down
further.



[2007-02-10 19:25:28] sborrill at precedence dot co dot uk

Yes, as per my original bug report, it is not fixed in the daily
snapshots. I've confirmed it today's too.

I can recreate it with the cli php binary too (i.e. I don't have to
test it from Apache).



[2007-02-05 13:51:27] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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





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/40326

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


#39351 [Com]: require and include fails to open file in current directory

2007-02-23 Thread webtech at get-telecom dot fr
 ID:   39351
 Comment by:   webtech at get-telecom dot fr
 Reported By:  lampiluoto at gmail dot com
 Status:   Open
 Bug Type: *Directory/Filesystem functions
 Operating System: Solaris10
 PHP Version:  5.2.0
 New Comment:

Is there a solution for this bug ?
We're using PHP 5.1.6 and can't upgrade...


Previous Comments:


[2007-02-09 16:54:55] lampiluoto at gmail dot com

Hello,

This bug seem to exist also in PHP 5.2.1, it
is behaving similarly to the 5.2.0 snapshot I 
tested. This is same PHP code I tested earlier.

I remind that this is situation where httpd user
doesn't have read privilege to every directory 
level in path. It has only execute/access (x) 
to some of the directories.

#
# 5.1.6 truss output
#
24204:  stat("./inc/config.php", 0xFD7FFFDFE470)= 0
24204:  resolvepath("./inc/config.php", "inc/config.php", 1024) = 14
24204:  getcwd(0xFD7FFFDFD6F0, 1024)Err#13 EACCES
[file_dac_read]
24204:  stat("./inc/config.php", 0xFD7FFFDFE390)= 0
24204:  getcwd(0xFD7FFFDFDFA0, 1024)Err#13 EACCES
[file_dac_read]
24204:  resolvepath("./inc/config.php", "inc/config.php", 1024) = 14
24204:  getcwd(0xFD7FFFDFD270, 1024)Err#13 EACCES
[file_dac_read]
24204:  open("./inc/config.php", O_RDONLY)  = 34
24204:  fstat(34, 0x007E4F90)   = 0
24204:  lseek(34, 0, SEEK_CUR)  = 0
24204:  read(34, " < ? p h p\n\n / /  ".., 8192)= 1572
24204:  read(34, 0x007E27F8, 8192)  = 0
24204:  read(34, 0x007E27F8, 8192)  = 0
24204:  close(34)   = 0
24204:  time()  = 1171039558
24204: 
resolvepath("/data/sites/www.lampiluoto.net/dev-html/inc/func_prepare.php",
"/data/sites/www.mysite.example/dev-html/inc/func_prepare.php", 1024) =
60
24204: 
stat("/data/sites/www.mysite.example/dev-html/inc/func_prepare.php",
0xFD7FFFDFE360) = 0
24204: 
resolvepath("/data/sites/www.mysite.example/dev-html/inc/func_prepare.php",
"/data/sites/www.mysite.example/dev-html/inc/func_prepare.php", 1024) =
60
24204: 
open("/data/sites/www.mysite.example/dev-html/inc/func_prepare.php",
O_RDONLY) = 34
24204:  fstat(34, 0x007E5F10)   = 0
24204:  lseek(34, 0, SEEK_CUR)  = 0
24204:  read(34, " < ? p h p\n\n / /\n".., 8192)= 1171
24204:  read(34, 0x007E6C28, 8192)  = 0
24204:  read(34, 0x007E6C28, 8192)  = 0
24204:  brk(0x007E8F20) = 0
24204:  brk(0x007ECF20) = 0
24204:  brk(0x007ECF20) = 0
24204:  brk(0x007ECF20) = 0
24204:  brk(0x007F0F20) = 0
24204:  close(34)   = 0
24204:  stat("./inc/db_interface.php", 0xFD7FFFDFD9C0) = 0
24204:  resolvepath("./inc/db_interface.php", "inc/db_interface.php",
1024) = 20
24204:  getcwd(0xFD7FFFDFCC40, 1024)Err#13 EACCES
[file_dac_read]
24204:  stat("./inc/db_interface.php", 0xFD7FFFDFD8E0) = 0
24204:  getcwd(0xFD7FFFDFD4F0, 1024)Err#13 EACCES
[file_dac_read]
24204:  resolvepath("./inc/db_interface.php", "inc/db_interface.php",
1024) = 20
24204:  getcwd(0xFD7FFFDFC7C0, 1024)Err#13 EACCES
[file_dac_read]
24204:  open("./inc/db_interface.php", O_RDONLY)= 34
24204:  fstat(34, 0x007E2E30)   = 0
24204:  lseek(34, 0, SEEK_CUR)  = 0
24204:  read(34, " < ? p h p\n\n / /\n / /".., 8192)= 502
24204:  read(34, 0x007E6C28, 8192)  = 0
24204:  read(34, 0x007E6C28, 8192)  = 0
24204:  close(34)   = 0


#
# 5.2.1 truss output
#
23485:  stat("./inc/config.php", 0xFD7FFFDFE0D0)= 0
23485:  getcwd(0xFD7FFFDFD360, 1024)Err#13 EACCES
[file_dac_read]
23485:  resolvepath("./inc/config.php", "inc/config.php", 1024) = 14
23485:  getcwd(0xFD7FFFDFC660, 1024)Err#13 EACCES
[file_dac_read]
23485:  stat("/inc/config.php", 0xFD7FFFDFDFF0) Err#2 ENOENT
23485:  stat("/opt/httpd/dev-installation/php5/lib/php/inc/config.php",
0xFD7FFFDFE0D0) Err#2 ENOENT
23485:  stat("/data/sites/www.mysite.example/dev-html/inc/config.php",
0xFD7FFFDFE0D0) = 0
23485: 
resolvepath("/data/sites/www.mysite.example/dev-html/inc/config.php",
"/data/sites/www.mysite.example/dev-html/inc/config.php", 1024) = 54
23485:  stat("/data/sites/www.mysite.example/dev-html/inc/config.php",
0xFD7FFFDFDFF0) = 0
23485: 
resolvepath("/data/sites/www.mysite.example/dev-html/inc/config.php",
"/data/sites/www.mysite.example/dev-html/inc/config.php", 1024) = 54
23485:  open("/data/sites

#40603 [Opn]: informix moved to PECL

2007-02-23 Thread kprzemek at coig dot katowice dot pl
 ID:   40603
 User updated by:  kprzemek at coig dot katowice dot pl
 Reported By:  kprzemek at coig dot katowice dot pl
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: RHEL 4
 PHP Version:  5.2.1
 New Comment:

OK,I downloaded source from
http://cvs.php.net/viewvc.cgi/pecl/informix/ but how I need to know how
to compile it now? In configure script ther's no --with-informix option


Previous Comments:


[2007-02-23 09:32:28] [EMAIL PROTECTED]

You can fetch it from CVS:

http://cvs.php.net/viewvc.cgi/pecl/informix/





[2007-02-23 08:59:26] kprzemek at coig dot katowice dot pl

I installed from PECL but in the PECL there is only PDO version, which
means I can't use ifx_connect, ifx_query,etc. but PDO(informix:...),
query(); Shall I rewrite the application?



[2007-02-23 08:41:24] [EMAIL PROTECTED]

Why can't you install it from PECL?



[2007-02-23 08:27:49] kprzemek at coig dot katowice dot pl

Description:

Hello
I guess why in the php5.2.1 the current support for the driver for
Informix  DB has been changed. I can't switch to php5.2.1, because
there is no --with-informix in the compilation options. 90% of my
applications are mission critical and Informix DB based. I use AdoDB
and native functions. How I'm supposed to tell our developers that they
would have to rewrite the application and change all the instructions
e.g.: ifx_connect, etc for PDO. This is the worst fitcher I have ever
heard I'm sure I'm not the only one with this problem, because IBM
Informix is used by millions of peole all over the world. I need your
help in order to compile  php5.2.1  with --with-informix option if 
"...are strongly encouraged to upgrade to it as soon as possible..."
I have no options to compile it!!!
Regards Przemek






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


#40600 [Fbk->Opn]: [PATCH]:getgrgid_r, getgrnam_r etc functions regression(crash)

2007-02-23 Thread stas at FreeBSD dot org
 ID:   40600
 User updated by:  stas at FreeBSD dot org
 Reported By:  stas at FreeBSD dot org
-Status:   Feedback
+Status:   Open
 Bug Type: POSIX related
 Operating System: FreeBSD
 PHP Version:  5.2.1
 New Comment:

-   if (buflen < 1) {
-   RETURN_FALSE;
-   }
+   if (buflen < 0)
+   buflen = 1024;

>It might be safe to do it on FreeBSD when you know for sure >that this
functionality is missing and it's safe to use 1K >buffer, but other
systems might behave differently.

This patch covers two problems:
1) The POSIX says that sysconf will return -1 on failure, thus the ( <
1) check is definitely incorrect
2) It's safe to use the buffer of any size (according to POSIX), since
you give the buffer length to these functions. They'll return error if
the buffer lenght isn't enough - it's better then give up on retriving
this info just in case the sysconf doesn't has these limit values.


Previous Comments:


[2007-02-22 23:39:18] [EMAIL PROTECTED]

+   if (grbuflen < 0)
+   grbuflen = 1024;

I definitely agree with this part of the patch.
But other parts look to me as a "workaround" for FreeBSD problems.

-   if (buflen < 1) {
-   RETURN_FALSE;
-   }
+   if (buflen < 0)
+   buflen = 1024;

It might be safe to do it on FreeBSD when you know for sure that this
functionality is missing and it's safe to use 1K buffer, but other
systems might behave differently.



[2007-02-22 23:34:54] stas at FreeBSD dot org

The patch itself:

--- posix.c.origFri Jan 12 04:46:11 2007
+++ posix.c Thu Feb 22 14:56:56 2007
@@ -837,9 +837,8 @@

 #if defined(ZTS) && defined(HAVE_GETGRNAM_R) &&
defined(_SC_GETGR_R_SIZE_MAX)
buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
-   if (buflen < 1) {
-   RETURN_FALSE;
-   }
+   if (buflen < 0)
+   buflen = 1024;
buf = emalloc(buflen);
g = &gbuf;

@@ -887,6 +886,8 @@
 #ifdef HAVE_GETGRGID_R

grbuflen = sysconf(_SC_GETGR_R_SIZE_MAX);
+   if (grbuflen < 0)
+   grbuflen = 1024;
grbuf = emalloc(grbuflen);

ret = getgrgid_r(gid, &_g, grbuf, grbuflen, &retgrptr);
@@ -950,9 +951,9 @@

 #if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) &&
defined(HAVE_GETPWNAM_R)
buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
-   if (buflen < 1) {
-   RETURN_FALSE;
-   }
+   if (buflen < 0)
+   buflen = 1024;
+
buf = emalloc(buflen);
pw = &pwbuf;

@@ -999,9 +1000,8 @@
}
 #if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) &&
defined(HAVE_GETPWUID_R)
pwbuflen = sysconf(_SC_GETPW_R_SIZE_MAX);
-   if (pwbuflen < 1) {
-   RETURN_FALSE;
-   }
+   if (pwbuflen < 0)
+   pwbuflen = 1024;
pwbuf = emalloc(pwbuflen);

ret = getpwuid_r(uid, &_pw, pwbuf, pwbuflen, &retpwptr);
--



[2007-02-22 23:32:39] stas at FreeBSD dot org

Description:

This module has problems with functions like getgrgid_r etc. It tries
to find out limits using sysconf, but FreeBSD doesn't have, e.g.
_SC_GETPW_R_SIZE_MAX. Since it does't try to check the return value it
effectively leads to attempt to allocate (size_t)-1 bytes, which
obviously fails, since trying to allocate (size_t)-1 bytes exceeds any
limits.

Reproduce code:
---
$groupinfo = posix_getgrgid(0);
print_r($groupinfo);

Expected result:

something meaningful






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


#40603 [Opn->Bgs]: informix moved to PECL

2007-02-23 Thread pajoye
 ID:   40603
 Updated by:   [EMAIL PROTECTED]
 Reported By:  kprzemek at coig dot katowice dot pl
-Status:   Open
+Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: RHEL 4
 PHP Version:  5.2.1
 New Comment:

See:

http://www.php.net/manual/en/install.pecl.phpize.php


Previous Comments:


[2007-02-23 10:29:44] kprzemek at coig dot katowice dot pl

OK,I downloaded source from
http://cvs.php.net/viewvc.cgi/pecl/informix/ but how I need to know how
to compile it now? In configure script ther's no --with-informix option



[2007-02-23 09:32:28] [EMAIL PROTECTED]

You can fetch it from CVS:

http://cvs.php.net/viewvc.cgi/pecl/informix/





[2007-02-23 08:59:26] kprzemek at coig dot katowice dot pl

I installed from PECL but in the PECL there is only PDO version, which
means I can't use ifx_connect, ifx_query,etc. but PDO(informix:...),
query(); Shall I rewrite the application?



[2007-02-23 08:41:24] [EMAIL PROTECTED]

Why can't you install it from PECL?



[2007-02-23 08:27:49] kprzemek at coig dot katowice dot pl

Description:

Hello
I guess why in the php5.2.1 the current support for the driver for
Informix  DB has been changed. I can't switch to php5.2.1, because
there is no --with-informix in the compilation options. 90% of my
applications are mission critical and Informix DB based. I use AdoDB
and native functions. How I'm supposed to tell our developers that they
would have to rewrite the application and change all the instructions
e.g.: ifx_connect, etc for PDO. This is the worst fitcher I have ever
heard I'm sure I'm not the only one with this problem, because IBM
Informix is used by millions of peole all over the world. I need your
help in order to compile  php5.2.1  with --with-informix option if 
"...are strongly encouraged to upgrade to it as soon as possible..."
I have no options to compile it!!!
Regards Przemek






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


#40485 [Com]: Test cases fail

2007-02-23 Thread spunkmeyer at free dot fr
 ID:   40485
 Comment by:   spunkmeyer at free dot fr
 Reported By:  wdierkes at 5dollarwhitebox dot org
 Status:   No Feedback
 Bug Type: Session related
 Operating System: Rhel3 / Rhel4
 PHP Version:  4.4.5
 New Comment:

I have used the snapshot php4-STABLE-200702230930 and it fixed these
two FAILs over 4.4.5.


Previous Comments:


[2007-02-23 01:00:00] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".



[2007-02-15 09:41:41] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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





[2007-02-14 20:50:24] wdierkes at 5dollarwhitebox dot org

Description:

The following test cases fail on Rhel3/Rhel4 (i386 and 
x86_64):

bug compatibility: unset($c) with enabled register_globals 
[ext/session/tests/007.phpt]

serializing references test case using globals [ext/session/
tests/019.phpt]

Reproduce code:
---
./configure, Then make and make test as usual.


Actual configure line can be provided if necessary... but should be
required.

Expected result:

Test cases should not fail.

Actual result:
--
Test cases fail:


=
TIME END 2007-02-14 13:53:00

=
TEST RESULT SUMMARY

-
Exts skipped:   56
Exts tested :   30

-
Number of tests :  626
Tests skipped   :  201 (32.1%)
Tests warned:0 (0.0%)
Tests failed:2 (0.3%)
Tests passed:  423 (67.6%)

-
Time taken  :   60 seconds

=


=
FAILED TEST SUMMARY

-
bug compatibility: unset($c) with enabled register_globals 
[ext/session/tests/007.phpt]
serializing references test case using globals [ext/session/
tests/019.phpt]

=
>> TEST FAILURE: ../ext/session/tests/007.diff --
001- float(3.14)
001+ 
002- array(1) {
003-   ["c"]=>
004-   &float(3.14)
005- }
006- float(3.14)
007- array(1) {
008-   ["c"]=>
009-   &float(3.14)
010- }
<< ../ext/session/tests/007.diff result ends.
>> TEST FAILURE: ../ext/session/tests/019.diff --
001- array(2) {
001+ 
002-   ["o1"]=>
003-   &object(tfoo)(1) {
004- ["c"]=>
005- int(42)
006-   }
007-   ["o2"]=>
008-   &object(tfoo)(1) {
009- ["c"]=>
010- int(42)
011-   }
012- }
013- array(2) {
014-   ["o1"]=>
015-   &object(tfoo)(1) {
016- ["c"]=>
017- int(44)
018-   }
019-   ["o2"]=>
020-   &object(tfoo)(1) {
021- ["c"]=>
022- int(44)
023-   }
024- }
<< ../ext/session/tests/019.diff result ends.





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


#40598 [Opn->Csd]: libxml segfault

2007-02-23 Thread rrichards
 ID:   40598
 Updated by:   [EMAIL PROTECTED]
 Reported By:  incastrix at yahoo dot it
-Status:   Open
+Status:   Closed
 Bug Type: XML related
 Operating System: debian etch
 PHP Version:  5CVS-2007-02-22 (CVS)
 New Comment:

This bug has been fixed in CVS.

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.

*NOTE*: LIBXML_COMPACT should really only be used when reading a
document as it is unpredictable (within the libxml2 library itself)
when using it and modifying a document.


Previous Comments:


[2007-02-22 23:08:01] incastrix at yahoo dot it

Description:

libxml segfaults when xml document was loaded with  LIBXML_COMPACT flag
and try to remove a node.

libxml 2.6.27

Reproduce code:
---
$doc = DOMDocument::loadXML('', LIBXML_COMPACT);
$node = $doc->getElementByID('remove');
$node->parentNode->removeChild( $node );

Actual result:
--
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1210758944 (LWP 27086)]
php_libxml_node_free_list (node=0x70706970) at
/usr/local/src/php5.2-20070130/ext/libxml/libxml.c:236
236 switch (node->type) {
(gdb) bt
#0  php_libxml_node_free_list (node=0x70706970) at
/usr/local/src/php5.2-20070130/ext/libxml/libxml.c:236
#1  0xb7a310b0 in php_libxml_node_free_list (node=)
at /usr/local/src/php5.2-20070130/ext/libxml/libxml.c:253
#2  0xb7a310f9 in php_libxml_node_free_list (node=)
at /usr/local/src/php5.2-20070130/ext/libxml/libxml.c:249
#3  0xb7a3115b in php_libxml_node_free_resource (node=0x82247c0)
at /usr/local/src/php5.2-20070130/ext/libxml/libxml.c:1005
#4  0xb7a311f8 in php_libxml_node_decrement_resource
(object=0xb7799708)
at /usr/local/src/php5.2-20070130/ext/libxml/libxml.c:1028
#5  0xb7a65864 in dom_objects_free_storage (object=0xb7799708) at
/usr/local/src/php5.2-20070130/ext/dom/php_dom.c:974
#6  0xb7c298a7 in zend_objects_store_del_ref_by_handle (handle=2)
at /usr/local/src/php5.2-20070130/Zend/zend_objects_API.c:206
#7  0xb7c298e7 in zend_objects_store_del_ref (zobject=0xb7799848)
at /usr/local/src/php5.2-20070130/Zend/zend_objects_API.c:168
#8  0xb7c02199 in _zval_ptr_dtor (zval_ptr=0xb7796f60) at
/usr/local/src/php5.2-20070130/Zend/zend_variables.h:35
#9  0xb7c17667 in zend_hash_apply_deleter (ht=0xb7d53990,
p=0xb7796f54)
at /usr/local/src/php5.2-20070130/Zend/zend_hash.c:611
#10 0xb7c17768 in zend_hash_reverse_apply (ht=0xb7d53990,
apply_func=0xb7c018d0 )
at /usr/local/src/php5.2-20070130/Zend/zend_hash.c:760
#11 0xb7c020fe in shutdown_destructors () at
/usr/local/src/php5.2-20070130/Zend/zend_execute_API.c:211
#12 0xb7c0e300 in zend_call_destructors () at
/usr/local/src/php5.2-20070130/Zend/zend.c:846
#13 0xb7bcfd88 in php_request_shutdown (dummy=0x0) at
/usr/local/src/php5.2-20070130/main/main.c:1279
#14 0xb7c8642d in php_handler (r=0x821d578) at
/usr/local/src/php5.2-20070130/sapi/apache2handler/sapi_apache2.c:463
#15 0x08074617 in ap_run_handler (r=0x821d578) at config.c:157
#16 0x08077707 in ap_invoke_handler (r=0x821d578) at config.c:372
#17 0x0808deb8 in ap_process_request (r=0x821d578) at
http_request.c:258
#18 0x0808b15e in ap_process_http_connection (c=0x8219558) at
http_core.c:184
#19 0x0807b4d7 in ap_run_process_connection (c=0x8219558) at
connection.c:43
#20 0x080a10a4 in child_main (child_num_arg=) at
prefork.c:640
#21 0x080a1304 in make_child (s=0x80ccc80, slot=0) at prefork.c:680
#22 0x080a20ca in ap_mpm_run (_pconf=0x80c80a8, plog=0x81061a0,
s=0x80ccc80) at prefork.c:956
#23 0x0806222f in main (argc=135029024, argv=0x0) at main.c:717






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


#39858 [Com]: Lost connection to MySQL server during query by a repeated call stored proced

2007-02-23 Thread martin dot schmitz at uni-bielefeld dot de
 ID:   39858
 Comment by:   martin dot schmitz at uni-bielefeld dot de
 Reported By:  develar at gmail dot com
 Status:   Assigned
 Bug Type: PDO related
 Operating System: Windows XP SP2
 PHP Version:  5.2.0
 Assigned To:  wez
 New Comment:

I've got a dirty solution for your problem (works under linux, not
tested on windows)

if i do:

$dbh->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$dbh->setAttribute( PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);

$datasets = $dbh->query( 'SELECT * FROM table_name_1 WHERE id=5);
$datasets->execute();
$result_1 = $datasets->fetch( PDO::FETCH_ASSOC);

$datasets = $dbh->query( 'SELECT * FROM table_name_2 WHERE id=7);
$datasets->execute();
$address = $datasets->fetch( PDO::FETCH_ASSOC);

it gets the same unbuffered error. But if I do a fetch twice on the
first result and store it to a dummy array, the second query works:

$datasets = $dbh->query( 'SELECT * FROM table_name_1 WHERE id=5);
$datasets->execute();
$result_1 = $datasets->fetch( PDO::FETCH_ASSOC);

// test, remove if bug is fixed
$dummy = $datasets->fetch( PDO::FETCH_ASSOC);

$datasets = $dbh->query( 'SELECT * FROM table_name_2 WHERE id=7);
$datasets->execute();
$address = $datasets->fetch( PDO::FETCH_ASSOC);

I think the cursor-pointer does not work correctly?? You can also do a
fetchAll(), but then your result looks like:

array[0] => ( array=>([prename] => 'Martin' [name] => 'Schmitz'))

instead of

array=>([prename] => 'Martin' [name] => 'Schmitz')

Hope it works for you


Previous Comments:


[2007-02-22 12:39:23] james dot cordon at btinternet dot com

AHH

My bodge-it above doesn't work correctly, it just opens but doesn't
close many connections.

This does work (tried several times on 200 consec' queries)
added closeCursor().


$i=100;

while($i>0){
echo 'LOOP NUM:'.$i.'';
try{
$stmt=$pdodl_1->query("call testMany()");
$stmt->setFetchMode(PDO::FETCH_ASSOC);

echo 'PDODL OBJ: ';
var_dump($pdodl_1);
echo 'PDO::STATEMENT OBJ: ';
var_dump($stmt);
echo '';

while ($row= $stmt->fetch()) {
echo '';
var_dump($row);
echo '';
}
$i--;


}catch(PDOException $e){
if($e->getCode()=='HY000'){
$stmt->closeCursor();
$pdodl_1->connect();
$i--;
} else {
throw $e;
}
}
}



[2007-02-22 11:37:01] james dot cordon at btinternet dot com

php 5.2.1
win xp pro
mysql 5x
apache 2x

I also built a project assuming stored procedures would work
as they are mentioned in the php docs, anyway.

to cut a long story short, I extended PDO with methods that included
not connectimg to DB until actually needed.

public function connect(){
try{
parent::__construct($this->connect_a['DSN'], $this->connect_a['U'],
$this->connect_a['P']);
} catch (Exception $e) {
throw($e);
}
### always use exception error handling
$this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$this->connected=1;
}//

When  calling a 2nd query (after a stored procedure) I get the
"SQLSTATE[HY000]:
General error: 2013 Lost connection to MySQL server during query" every
time.

I discovered calling "$pdoextended->connect();" after each use of a
stored procedure revived the connection (without instantiating another
PDOextended obj) with no errors.

This is ONLY a bodge-it but it is a very lightweight one.



[2007-02-20 14:24:37] barney dot hanlon at markettiers4dc dot com

That would technically be a workaround rather then a fix.  The issue is
still there, and switching to ODBC is not necessarily a good or
acceptable solution.  Also as we have taken onboard the Zend Framework
prior to beginning work on Zend Platform, creating non-standard
solutions doesn't sound like a forward step.  

However, until the PHP team pull their fingers out and assess PDO to
work with Windows properly, I may have to implement it.  Thank goodness
that the partnership with Microsoft will force PHP to stop treating IIS
as a perochial platform and get proper support.



[2007-02-19 18:45:52] denis dot podgurskiy at cofelab dot ru

Hi once again.
Step by step instruction how to work with MySQL sp/transaction under
Win XP SP 2
1. Install MySQL ODBC driver.
2. Cre

#40326 [NoF->Opn]: Can't open file from cwd if parent folder not readable

2007-02-23 Thread sborrill at precedence dot co dot uk
 ID:   40326
 User updated by:  sborrill at precedence dot co dot uk
 Reported By:  sborrill at precedence dot co dot uk
-Status:   No Feedback
+Status:   Open
 Bug Type: Streams related
 Operating System: NetBSD 3.1_STABLE
 PHP Version:  5.2.0
 New Comment:

What sort of account? FTP/ssh/something else? Alternatively, big thanks
to tlaramie at superb dot net for offering a suitable account.

The error was introduced in revision 1.74.2.9.2.4 and is around line
584 for TSRM/tsrm_virtual_cwd.c in the loop that begins:
ptr = tsrm_strtok_r(path_copy, TOKENIZER_STRING, &tok);

This loop is not run in 1.74.2.9.2.3 if the cwdlen is 0. With
1.74.2.9.2.4 and later it is always run and so prepends a / on the file
name, i.e. the actual file that is opened with fopen("file","r") is
"/file". This strikes me as a potential security problem too.


Previous Comments:


[2007-02-23 09:47:34] tlaramie at superb dot net

I can replicate the issue verbatim on PHP 5.2.1 on Solaris 9 (SPARC).
Login information for testing by one of the developers is available per
their request.



[2007-02-20 01:00:00] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".



[2007-02-12 17:49:28] [EMAIL PROTECTED]

Please provide an account on this machine.



[2007-02-10 21:39:07] sborrill at precedence dot co dot uk

I've tracked this down to changes to virtual_file_ex() which is called
from expand_filepath(). expand_filepath() returns "/file" from "file"
with 5.2.0 (and later), but returns "file" with 5.1.6 and earlier. This
is down to changes between revisions 1.74.2.9 (v5.1.6) and 1.74.2.9.2.9
(v5.2.0) of TSRM/tsrm_virtual_cwd.c. I've not yet tracked it down
further.



[2007-02-10 19:25:28] sborrill at precedence dot co dot uk

Yes, as per my original bug report, it is not fixed in the daily
snapshots. I've confirmed it today's too.

I can recreate it with the cli php binary too (i.e. I don't have to
test it from Apache).



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/40326

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


#39858 [Com]: Lost connection to MySQL server during query by a repeated call stored proced

2007-02-23 Thread james dot cordon at btinternet dot com
 ID:   39858
 Comment by:   james dot cordon at btinternet dot com
 Reported By:  develar at gmail dot com
 Status:   Assigned
 Bug Type: PDO related
 Operating System: Windows XP SP2
 PHP Version:  5.2.0
 Assigned To:  wez
 New Comment:

previous doesn't address stored procedure prob (from what i've read
this is a win prob only).

my revised approach:
Essentialy after you use a stored procedure call, burn another  query
to force an exception.

###
private $connect_a=array();
private $connected=0;

public function __construct($dsn=NULL, $user=NULL, $pass=NULL){
if(is_array($dsn)){
$this->connect_a['DSN']=$dsn[0];
$this->connect_a['U']=$dsn[1];
$this->connect_a['P']=$dsn[2];
} else {
$this->connect_a['DSN']=$dsn;
$this->connect_a['U']=$user;
$this->connect_a['P']=$pass;
}
}//

public function query($q){
if($this->connected==0){
$this->connect();
}
return parent::query($q);
}//

public function dropConnection($stmt){
$stmt->closeCursor();
$this->connected=0;
}##


public function callStoredProcedure($stmt){
$resultset;
try{
#multi array
while ($row= $stmt->fetch()) {
$resultset[]=$row;
echo '';
var_dump($row);
echo '';
   }
#burn
if(stripos($_SERVER['SERVER_SOFTWARE'], 'win') ){
$stmt=$this->query("select 1+1");
}


}catch(PDOException $e){
if($e->getCode()=='HY000' AND strpos ($e->getMessage(), 'Lost
connection' )){
print "<-!!!- Error!: Caught 'Lost connection error, dropConnection()
-!!!->";
$this->dropConnection($stmt);
} else {
throw $e;
}
}
return $resultset;
}//

public function connect(){
#if($this->connected==1) return true;
try{
parent::__construct($this->connect_a['DSN'], $this->connect_a['U'],
$this->connect_a['P']);
} catch (Exception $e) {
throw($e);
}
$this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$this->connected=1;
}//

#EXAMPLE
#just to prove obj is same one
$pdodl_1->temp_id='AA';

$i=100;

do{
echo 'LOOP NUM:'.$i.'';
echo 'PDODL OBJ: ';
var_dump($pdodl_1);
echo '';
$stmt=$pdodl_1->query("call testMany()");
$stmt->setFetchMode(PDO::FETCH_ASSOC);
$rset=$pdodl_1->callStoredProcedure($stmt);

$i--;
} while($i>0);

This is all from another project, so may need some tinkering.


Previous Comments:


[2007-02-23 11:29:16] martin dot schmitz at uni-bielefeld dot de

I've got a dirty solution for your problem (works under linux, not
tested on windows)

if i do:

$dbh->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$dbh->setAttribute( PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);

$datasets = $dbh->query( 'SELECT * FROM table_name_1 WHERE id=5);
$datasets->execute();
$result_1 = $datasets->fetch( PDO::FETCH_ASSOC);

$datasets = $dbh->query( 'SELECT * FROM table_name_2 WHERE id=7);
$datasets->execute();
$address = $datasets->fetch( PDO::FETCH_ASSOC);

it gets the same unbuffered error. But if I do a fetch twice on the
first result and store it to a dummy array, the second query works:

$datasets = $dbh->query( 'SELECT * FROM table_name_1 WHERE id=5);
$datasets->execute();
$result_1 = $datasets->fetch( PDO::FETCH_ASSOC);

// test, remove if bug is fixed
$dummy = $datasets->fetch( PDO::FETCH_ASSOC);

$datasets = $dbh->query( 'SELECT * FROM table_name_2 WHERE id=7);
$datasets->execute();
$address = $datasets->fetch( PDO::FETCH_ASSOC);

I think the cursor-pointer does not work correctly?? You can also do a
fetchAll(), but then your result looks like:

array[0] => ( array=>([prename] => 'Martin' [name] => 'Schmitz'))

instead of

array=>([prename] => 'Martin' [name] => 'Schmitz')

Hope it works for you



[2007-02-22 12:39:23] james dot cordon at btinternet dot com

AHH

My bodge-it above doesn't work correctly, it just opens but doesn't
close many connections.

This does work (tried several times on 200 consec' queries)
added closeCursor().


$i=100;

while($i>0){
echo 'LOOP NUM:'.$i.'';
try{
$stmt=$pdodl_1->query("call testMany()");
$stmt->setFetchMode(PDO::FETCH_ASSOC);

echo 'PDODL OBJ: ';
var_dump($pdodl_1);
echo 'PDO::STATEMENT OBJ: ';
var_dump($stmt);
echo '';

while ($row= $stmt->fetch()) {
echo '';
var_dump($row);
echo '';
}
$i--

#40600 [Opn->Fbk]: [PATCH]:getgrgid_r, getgrnam_r etc functions regression(crash)

2007-02-23 Thread tony2001
 ID:   40600
 Updated by:   [EMAIL PROTECTED]
 Reported By:  stas at FreeBSD dot org
-Status:   Open
+Status:   Feedback
 Bug Type: POSIX related
 Operating System: FreeBSD
 PHP Version:  5.2.1
 New Comment:

>This patch covers two problems:
>1) The POSIX says that sysconf will return -1 on failure,
> thus the ( < check is definitely incorrect

Oh? Care to elaborate?

>2) It's safe to use the buffer of any size (according to
> POSIX), since you give the buffer length to these
> functions. 

Yeah, according to POSIX those functions must be implemented.
But they are not.

>it's better then give up on retriving this info just in
>case the sysconf doesn't has these limit values.

I don't think it's any better to use hacks to workaround missing
FreeBSD functionality.



Previous Comments:


[2007-02-23 10:47:13] stas at FreeBSD dot org

-   if (buflen < 1) {
-   RETURN_FALSE;
-   }
+   if (buflen < 0)
+   buflen = 1024;

>It might be safe to do it on FreeBSD when you know for sure >that this
functionality is missing and it's safe to use 1K >buffer, but other
systems might behave differently.

This patch covers two problems:
1) The POSIX says that sysconf will return -1 on failure, thus the ( <
1) check is definitely incorrect
2) It's safe to use the buffer of any size (according to POSIX), since
you give the buffer length to these functions. They'll return error if
the buffer lenght isn't enough - it's better then give up on retriving
this info just in case the sysconf doesn't has these limit values.



[2007-02-22 23:39:18] [EMAIL PROTECTED]

+   if (grbuflen < 0)
+   grbuflen = 1024;

I definitely agree with this part of the patch.
But other parts look to me as a "workaround" for FreeBSD problems.

-   if (buflen < 1) {
-   RETURN_FALSE;
-   }
+   if (buflen < 0)
+   buflen = 1024;

It might be safe to do it on FreeBSD when you know for sure that this
functionality is missing and it's safe to use 1K buffer, but other
systems might behave differently.



[2007-02-22 23:34:54] stas at FreeBSD dot org

The patch itself:

--- posix.c.origFri Jan 12 04:46:11 2007
+++ posix.c Thu Feb 22 14:56:56 2007
@@ -837,9 +837,8 @@

 #if defined(ZTS) && defined(HAVE_GETGRNAM_R) &&
defined(_SC_GETGR_R_SIZE_MAX)
buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
-   if (buflen < 1) {
-   RETURN_FALSE;
-   }
+   if (buflen < 0)
+   buflen = 1024;
buf = emalloc(buflen);
g = &gbuf;

@@ -887,6 +886,8 @@
 #ifdef HAVE_GETGRGID_R

grbuflen = sysconf(_SC_GETGR_R_SIZE_MAX);
+   if (grbuflen < 0)
+   grbuflen = 1024;
grbuf = emalloc(grbuflen);

ret = getgrgid_r(gid, &_g, grbuf, grbuflen, &retgrptr);
@@ -950,9 +951,9 @@

 #if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) &&
defined(HAVE_GETPWNAM_R)
buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
-   if (buflen < 1) {
-   RETURN_FALSE;
-   }
+   if (buflen < 0)
+   buflen = 1024;
+
buf = emalloc(buflen);
pw = &pwbuf;

@@ -999,9 +1000,8 @@
}
 #if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) &&
defined(HAVE_GETPWUID_R)
pwbuflen = sysconf(_SC_GETPW_R_SIZE_MAX);
-   if (pwbuflen < 1) {
-   RETURN_FALSE;
-   }
+   if (pwbuflen < 0)
+   pwbuflen = 1024;
pwbuf = emalloc(pwbuflen);

ret = getpwuid_r(uid, &_pw, pwbuf, pwbuflen, &retpwptr);
--



[2007-02-22 23:32:39] stas at FreeBSD dot org

Description:

This module has problems with functions like getgrgid_r etc. It tries
to find out limits using sysconf, but FreeBSD doesn't have, e.g.
_SC_GETPW_R_SIZE_MAX. Since it does't try to check the return value it
effectively leads to attempt to allocate (size_t)-1 bytes, which
obviously fails, since trying to allocate (size_t)-1 bytes exceeds any
limits.

Reproduce code:
---
$groupinfo = posix_getgrgid(0);
print_r($groupinfo);

Expected result:

something meaningful






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


#40603 [Bgs->Csd]: informix moved to PECL

2007-02-23 Thread kprzemek at coig dot katowice dot pl
 ID:   40603
 User updated by:  kprzemek at coig dot katowice dot pl
 Reported By:  kprzemek at coig dot katowice dot pl
-Status:   Bogus
+Status:   Closed
 Bug Type: Feature/Change Request
 Operating System: RHEL 4
 PHP Version:  5.2.1
 New Comment:

It works. Thanks for your help. I had some problems with rebuild
configure script but it works. I hope that Informix in its next version
shall be available not only in PDO!


Previous Comments:


[2007-02-23 10:53:53] [EMAIL PROTECTED]

See:

http://www.php.net/manual/en/install.pecl.phpize.php



[2007-02-23 10:29:44] kprzemek at coig dot katowice dot pl

OK,I downloaded source from
http://cvs.php.net/viewvc.cgi/pecl/informix/ but how I need to know how
to compile it now? In configure script ther's no --with-informix option



[2007-02-23 09:32:28] [EMAIL PROTECTED]

You can fetch it from CVS:

http://cvs.php.net/viewvc.cgi/pecl/informix/





[2007-02-23 08:59:26] kprzemek at coig dot katowice dot pl

I installed from PECL but in the PECL there is only PDO version, which
means I can't use ifx_connect, ifx_query,etc. but PDO(informix:...),
query(); Shall I rewrite the application?



[2007-02-23 08:41:24] [EMAIL PROTECTED]

Why can't you install it from PECL?



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/40603

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


#39984 [Sus]: Response header sent as 302 despite being set to 301

2007-02-23 Thread marc dot bau at gmx dot net
 ID:   39984
 User updated by:  marc dot bau at gmx dot net
 Reported By:  marc dot bau at gmx dot net
 Status:   Suspended
 Bug Type: IIS related
 Operating System: WinXP
 PHP Version:  5.2.1
 Assigned To:  edink
 New Comment:

i wonder why there shouldn't be a way to handle this. 

As one example ActiveState (www.activestate.com) Perl have a CGI
version and this works well, too. You should spend some time on the
Perl Code, maybe there is a small trick inside.


Previous Comments:


[2007-02-19 23:23:06] [EMAIL PROTECTED]

Seems that there is no way a CGI script can convince IIS to output
something else than 302 response if you have location header.

Same IIS using Microsofts latest FCGI isapi has no problems with PHP
outputing correct status code.

I recommend that you switch to that instead of using raw cgi, the
perfomance icrease is dramatic as well.

http://www.iis.net/default.aspx?tabid=151




[2007-02-18 12:05:02] marc dot bau at gmx dot net

Additional to this a header('HTTP/1.0 404 Not Found') produces a "404
OK".



[2007-01-11 10:02:47] [EMAIL PROTECTED]

Edin, could you plz verify if this problem is still valid?



[2007-01-04 22:14:28] marc dot bau at gmx dot net

open



[2007-01-01 17:03:04] marc dot bau at gmx dot net

If Perl, ColdFusion and ASP Pages are correct and PHP not, what do you
think is wrong?

I think PHP! Maybe there is something wrong in the way how the status
is set or how the status is transfered to IIS... i don't know if there
is something special in IIS, but it looks like a PHP Bug, while all
other script languages are correct.



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/39984

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


#39984 [Sus]: Response header sent as 302 despite being set to 301

2007-02-23 Thread marc dot bau at gmx dot net
 ID:   39984
 User updated by:  marc dot bau at gmx dot net
 Reported By:  marc dot bau at gmx dot net
 Status:   Suspended
 Bug Type: IIS related
 Operating System: WinXP
 PHP Version:  5.2.1
 Assigned To:  edink
 New Comment:

Have a look to this headers. "Undescribed" is are wrong, too. I tryed
to use "php5isapi.dll" for PHP extension.


GET /test.php HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.1)
Gecko/20061204 Firefox/2.0.0.1
Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: de,en;q=0.8,en-us;q=0.6,de-de;q=0.4,es;q=0.2
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: PHPSESSID=nihrgij25siffg5r9dbr17boq5

HTTP/1.x 301 Undescribed
Server: Microsoft-IIS/5.1
Date: Fri, 23 Feb 2007 13:38:19 GMT
X-Powered-By: ASP.NET, PHP/5.2.1
Connection: close
Location: http://www.example.com
Content-Type: text/html


Previous Comments:


[2007-02-23 13:28:44] marc dot bau at gmx dot net

i wonder why there shouldn't be a way to handle this. 

As one example ActiveState (www.activestate.com) Perl have a CGI
version and this works well, too. You should spend some time on the
Perl Code, maybe there is a small trick inside.



[2007-02-19 23:23:06] [EMAIL PROTECTED]

Seems that there is no way a CGI script can convince IIS to output
something else than 302 response if you have location header.

Same IIS using Microsofts latest FCGI isapi has no problems with PHP
outputing correct status code.

I recommend that you switch to that instead of using raw cgi, the
perfomance icrease is dramatic as well.

http://www.iis.net/default.aspx?tabid=151




[2007-02-18 12:05:02] marc dot bau at gmx dot net

Additional to this a header('HTTP/1.0 404 Not Found') produces a "404
OK".



[2007-01-11 10:02:47] [EMAIL PROTECTED]

Edin, could you plz verify if this problem is still valid?



[2007-01-04 22:14:28] marc dot bau at gmx dot net

open



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/39984

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


#40600 [Fbk->Opn]: [PATCH]:getgrgid_r, getgrnam_r etc functions regression(crash)

2007-02-23 Thread stas at FreeBSD dot org
 ID:   40600
 User updated by:  stas at FreeBSD dot org
 Reported By:  stas at FreeBSD dot org
-Status:   Feedback
+Status:   Open
 Bug Type: POSIX related
 Operating System: FreeBSD
 PHP Version:  5.2.1
 New Comment:

>>This patch covers two problems:
>>1) The POSIX says that sysconf will return -1 on failure,
>> thus the ( < check is definitely incorrect
>
>Oh? Care to elaborate?

Yeah... According to susv3:
"If name is an invalid value, sysconf() shall return -1 and set errno
to indicate the error. If the variable corresponding to name has no
limit, sysconf() shall return -1 without changing the value of errno.
Note that indefinite limits do not imply infinite limits; see
."

>>2) It's safe to use the buffer of any size (according to
>> POSIX), since you give the buffer length to these
>> functions. 
>
>Yeah, according to POSIX those functions must be >implemented.
>But they are not.

>it's better then give up on retriving this info just in
>case the sysconf doesn't has these limit values.

>I don't think it's any better to use hacks to workaround >missing
FreeBSD
> functionality.

Ok, agree. It's open to you.


Previous Comments:


[2007-02-23 12:22:20] [EMAIL PROTECTED]

>This patch covers two problems:
>1) The POSIX says that sysconf will return -1 on failure,
> thus the ( < check is definitely incorrect

Oh? Care to elaborate?

>2) It's safe to use the buffer of any size (according to
> POSIX), since you give the buffer length to these
> functions. 

Yeah, according to POSIX those functions must be implemented.
But they are not.

>it's better then give up on retriving this info just in
>case the sysconf doesn't has these limit values.

I don't think it's any better to use hacks to workaround missing
FreeBSD functionality.




[2007-02-23 10:47:13] stas at FreeBSD dot org

-   if (buflen < 1) {
-   RETURN_FALSE;
-   }
+   if (buflen < 0)
+   buflen = 1024;

>It might be safe to do it on FreeBSD when you know for sure >that this
functionality is missing and it's safe to use 1K >buffer, but other
systems might behave differently.

This patch covers two problems:
1) The POSIX says that sysconf will return -1 on failure, thus the ( <
1) check is definitely incorrect
2) It's safe to use the buffer of any size (according to POSIX), since
you give the buffer length to these functions. They'll return error if
the buffer lenght isn't enough - it's better then give up on retriving
this info just in case the sysconf doesn't has these limit values.



[2007-02-22 23:39:18] [EMAIL PROTECTED]

+   if (grbuflen < 0)
+   grbuflen = 1024;

I definitely agree with this part of the patch.
But other parts look to me as a "workaround" for FreeBSD problems.

-   if (buflen < 1) {
-   RETURN_FALSE;
-   }
+   if (buflen < 0)
+   buflen = 1024;

It might be safe to do it on FreeBSD when you know for sure that this
functionality is missing and it's safe to use 1K buffer, but other
systems might behave differently.



[2007-02-22 23:34:54] stas at FreeBSD dot org

The patch itself:

--- posix.c.origFri Jan 12 04:46:11 2007
+++ posix.c Thu Feb 22 14:56:56 2007
@@ -837,9 +837,8 @@

 #if defined(ZTS) && defined(HAVE_GETGRNAM_R) &&
defined(_SC_GETGR_R_SIZE_MAX)
buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
-   if (buflen < 1) {
-   RETURN_FALSE;
-   }
+   if (buflen < 0)
+   buflen = 1024;
buf = emalloc(buflen);
g = &gbuf;

@@ -887,6 +886,8 @@
 #ifdef HAVE_GETGRGID_R

grbuflen = sysconf(_SC_GETGR_R_SIZE_MAX);
+   if (grbuflen < 0)
+   grbuflen = 1024;
grbuf = emalloc(grbuflen);

ret = getgrgid_r(gid, &_g, grbuf, grbuflen, &retgrptr);
@@ -950,9 +951,9 @@

 #if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) &&
defined(HAVE_GETPWNAM_R)
buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
-   if (buflen < 1) {
-   RETURN_FALSE;
-   }
+   if (buflen < 0)
+   buflen = 1024;
+
buf = emalloc(buflen);
pw = &pwbuf;

@@ -999,9 +1000,8 @@
}
 #if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) &&
defined(HAVE_GETPWUID_R)
pwbuflen = sysconf(_SC_GETPW_R_SIZE_MAX);
-   if (pwbuflen < 1) {
-   RETURN_FALSE;
-   }
+   if (pwbuflen < 0)
+   pwbuflen = 1024;
pwbuf = emalloc(pwbuflen);

ret = getpwuid_r(uid, &_pw, pwbuf, pwbuflen, &retpwptr);
--

--

#40600 [Opn->Fbk]: [PATCH]:getgrgid_r, getgrnam_r etc functions regression(crash)

2007-02-23 Thread tony2001
 ID:   40600
 Updated by:   [EMAIL PROTECTED]
 Reported By:  stas at FreeBSD dot org
-Status:   Open
+Status:   Feedback
 Bug Type: POSIX related
 Operating System: FreeBSD
 PHP Version:  5.2.1
 New Comment:

>Yeah... According to susv3:
Yes, I know that, thanks.
But that does not mean "if (buflen < 1)" is incorrect.
I don't think that zero buflen is a correct value (and even if it is,
it's useless).


Previous Comments:


[2007-02-23 13:47:59] stas at FreeBSD dot org

>>This patch covers two problems:
>>1) The POSIX says that sysconf will return -1 on failure,
>> thus the ( < check is definitely incorrect
>
>Oh? Care to elaborate?

Yeah... According to susv3:
"If name is an invalid value, sysconf() shall return -1 and set errno
to indicate the error. If the variable corresponding to name has no
limit, sysconf() shall return -1 without changing the value of errno.
Note that indefinite limits do not imply infinite limits; see
."

>>2) It's safe to use the buffer of any size (according to
>> POSIX), since you give the buffer length to these
>> functions. 
>
>Yeah, according to POSIX those functions must be >implemented.
>But they are not.

>it's better then give up on retriving this info just in
>case the sysconf doesn't has these limit values.

>I don't think it's any better to use hacks to workaround >missing
FreeBSD
> functionality.

Ok, agree. It's open to you.



[2007-02-23 12:22:20] [EMAIL PROTECTED]

>This patch covers two problems:
>1) The POSIX says that sysconf will return -1 on failure,
> thus the ( < check is definitely incorrect

Oh? Care to elaborate?

>2) It's safe to use the buffer of any size (according to
> POSIX), since you give the buffer length to these
> functions. 

Yeah, according to POSIX those functions must be implemented.
But they are not.

>it's better then give up on retriving this info just in
>case the sysconf doesn't has these limit values.

I don't think it's any better to use hacks to workaround missing
FreeBSD functionality.




[2007-02-23 10:47:13] stas at FreeBSD dot org

-   if (buflen < 1) {
-   RETURN_FALSE;
-   }
+   if (buflen < 0)
+   buflen = 1024;

>It might be safe to do it on FreeBSD when you know for sure >that this
functionality is missing and it's safe to use 1K >buffer, but other
systems might behave differently.

This patch covers two problems:
1) The POSIX says that sysconf will return -1 on failure, thus the ( <
1) check is definitely incorrect
2) It's safe to use the buffer of any size (according to POSIX), since
you give the buffer length to these functions. They'll return error if
the buffer lenght isn't enough - it's better then give up on retriving
this info just in case the sysconf doesn't has these limit values.



[2007-02-22 23:39:18] [EMAIL PROTECTED]

+   if (grbuflen < 0)
+   grbuflen = 1024;

I definitely agree with this part of the patch.
But other parts look to me as a "workaround" for FreeBSD problems.

-   if (buflen < 1) {
-   RETURN_FALSE;
-   }
+   if (buflen < 0)
+   buflen = 1024;

It might be safe to do it on FreeBSD when you know for sure that this
functionality is missing and it's safe to use 1K buffer, but other
systems might behave differently.



[2007-02-22 23:34:54] stas at FreeBSD dot org

The patch itself:

--- posix.c.origFri Jan 12 04:46:11 2007
+++ posix.c Thu Feb 22 14:56:56 2007
@@ -837,9 +837,8 @@

 #if defined(ZTS) && defined(HAVE_GETGRNAM_R) &&
defined(_SC_GETGR_R_SIZE_MAX)
buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
-   if (buflen < 1) {
-   RETURN_FALSE;
-   }
+   if (buflen < 0)
+   buflen = 1024;
buf = emalloc(buflen);
g = &gbuf;

@@ -887,6 +886,8 @@
 #ifdef HAVE_GETGRGID_R

grbuflen = sysconf(_SC_GETGR_R_SIZE_MAX);
+   if (grbuflen < 0)
+   grbuflen = 1024;
grbuf = emalloc(grbuflen);

ret = getgrgid_r(gid, &_g, grbuf, grbuflen, &retgrptr);
@@ -950,9 +951,9 @@

 #if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) &&
defined(HAVE_GETPWNAM_R)
buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
-   if (buflen < 1) {
-   RETURN_FALSE;
-   }
+   if (buflen < 0)
+   buflen = 1024;
+
buf = emalloc(buflen);
pw = &pwbuf;

@@ -999,9 +1000,8 @@
}
 #if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) &&
defined(HAVE_GETPWUID_R)
pwbuflen = sysconf(_SC_GETPW_R_SIZE_MAX);
-   if (pwbuflen < 1) {
-  

#40605 [NEW]: Unable to gracefully handle when max_post_size exceeded with file uploads

2007-02-23 Thread sam dot bryan at montal dot com
From: sam dot bryan at montal dot com
Operating system: All
PHP version:  5.2.1
PHP Bug Type: Feature/Change Request
Bug description:  Unable to gracefully handle when max_post_size exceeded with 
file uploads

Description:

There is, as far as I can discern, no mechanism for detecting exceeded
max_post_size when dealing with file uploads.

Setting max_post_size >= upload_max_filesize is a good safety for single
files, but when uploading multiple files is of no use, as individual files
can be within upload_max_filesize but can cumulatively exceed
max_post_size.

The php://input wrapper and $HTTP_RAW_POST_DATA aren't populated when data
is posted with enctype multipart/form-data, otherwise that'd be a simple
way of checking the POST data size.

My request is for a method of detecting when max_post_size is exceeded, so
it can be handled gracefully within a script.  Having php://input filled
when data is of multipart/form-data would do nicely.


-- 
Edit bug report at http://bugs.php.net/?id=40605&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40605&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40605&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40605&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40605&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=40605&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=40605&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=40605&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=40605&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=40605&r=support
Expected behavior:http://bugs.php.net/fix.php?id=40605&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=40605&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=40605&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40605&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40605&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40605&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=40605&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=40605&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40605&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=40605&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=40605&r=mysqlcfg


#39984 [Sus]: Response header sent as 302 despite being set to 301

2007-02-23 Thread marc dot bau at gmx dot net
 ID:   39984
 User updated by:  marc dot bau at gmx dot net
 Reported By:  marc dot bau at gmx dot net
 Status:   Suspended
 Bug Type: IIS related
 Operating System: WinXP
 PHP Version:  5.2.1
 Assigned To:  edink
 New Comment:

And this comes to me with FastCGI from the URL you provided. Wrong in a
different way - and buggy again. Any way to get this bug really fixed?


HTTP/1.x 301 OK
Server: Microsoft-IIS/5.1
Date: Fri, 23 Feb 2007 14:04:43 GMT
X-Powered-By: ASP.NET, PHP/5.2.1
Connection: close
Location: http://www.example.com
Content-Type: text/html


Previous Comments:


[2007-02-23 13:41:11] marc dot bau at gmx dot net

Have a look to this headers. "Undescribed" is are wrong, too. I tryed
to use "php5isapi.dll" for PHP extension.


GET /test.php HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.1)
Gecko/20061204 Firefox/2.0.0.1
Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: de,en;q=0.8,en-us;q=0.6,de-de;q=0.4,es;q=0.2
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: PHPSESSID=nihrgij25siffg5r9dbr17boq5

HTTP/1.x 301 Undescribed
Server: Microsoft-IIS/5.1
Date: Fri, 23 Feb 2007 13:38:19 GMT
X-Powered-By: ASP.NET, PHP/5.2.1
Connection: close
Location: http://www.example.com
Content-Type: text/html



[2007-02-23 13:28:44] marc dot bau at gmx dot net

i wonder why there shouldn't be a way to handle this. 

As one example ActiveState (www.activestate.com) Perl have a CGI
version and this works well, too. You should spend some time on the
Perl Code, maybe there is a small trick inside.



[2007-02-19 23:23:06] [EMAIL PROTECTED]

Seems that there is no way a CGI script can convince IIS to output
something else than 302 response if you have location header.

Same IIS using Microsofts latest FCGI isapi has no problems with PHP
outputing correct status code.

I recommend that you switch to that instead of using raw cgi, the
perfomance icrease is dramatic as well.

http://www.iis.net/default.aspx?tabid=151




[2007-02-18 12:05:02] marc dot bau at gmx dot net

Additional to this a header('HTTP/1.0 404 Not Found') produces a "404
OK".



[2007-01-11 10:02:47] [EMAIL PROTECTED]

Edin, could you plz verify if this problem is still valid?



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/39984

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


#40600 [Fbk->Asn]: [PATCH]:getgrgid_r, getgrnam_r etc functions regression(crash)

2007-02-23 Thread tony2001
 ID:   40600
 Updated by:   [EMAIL PROTECTED]
 Reported By:  stas at FreeBSD dot org
-Status:   Feedback
+Status:   Assigned
 Bug Type: POSIX related
 Operating System: FreeBSD
 PHP Version:  5.2.1
-Assigned To:  
+Assigned To:  iliaa
 New Comment:

Ilia, please take a look at this, IIRC you added those sysconf()
patches.


Previous Comments:


[2007-02-23 13:55:02] [EMAIL PROTECTED]

>Yeah... According to susv3:
Yes, I know that, thanks.
But that does not mean "if (buflen < 1)" is incorrect.
I don't think that zero buflen is a correct value (and even if it is,
it's useless).



[2007-02-23 13:47:59] stas at FreeBSD dot org

>>This patch covers two problems:
>>1) The POSIX says that sysconf will return -1 on failure,
>> thus the ( < check is definitely incorrect
>
>Oh? Care to elaborate?

Yeah... According to susv3:
"If name is an invalid value, sysconf() shall return -1 and set errno
to indicate the error. If the variable corresponding to name has no
limit, sysconf() shall return -1 without changing the value of errno.
Note that indefinite limits do not imply infinite limits; see
."

>>2) It's safe to use the buffer of any size (according to
>> POSIX), since you give the buffer length to these
>> functions. 
>
>Yeah, according to POSIX those functions must be >implemented.
>But they are not.

>it's better then give up on retriving this info just in
>case the sysconf doesn't has these limit values.

>I don't think it's any better to use hacks to workaround >missing
FreeBSD
> functionality.

Ok, agree. It's open to you.



[2007-02-23 12:22:20] [EMAIL PROTECTED]

>This patch covers two problems:
>1) The POSIX says that sysconf will return -1 on failure,
> thus the ( < check is definitely incorrect

Oh? Care to elaborate?

>2) It's safe to use the buffer of any size (according to
> POSIX), since you give the buffer length to these
> functions. 

Yeah, according to POSIX those functions must be implemented.
But they are not.

>it's better then give up on retriving this info just in
>case the sysconf doesn't has these limit values.

I don't think it's any better to use hacks to workaround missing
FreeBSD functionality.




[2007-02-23 10:47:13] stas at FreeBSD dot org

-   if (buflen < 1) {
-   RETURN_FALSE;
-   }
+   if (buflen < 0)
+   buflen = 1024;

>It might be safe to do it on FreeBSD when you know for sure >that this
functionality is missing and it's safe to use 1K >buffer, but other
systems might behave differently.

This patch covers two problems:
1) The POSIX says that sysconf will return -1 on failure, thus the ( <
1) check is definitely incorrect
2) It's safe to use the buffer of any size (according to POSIX), since
you give the buffer length to these functions. They'll return error if
the buffer lenght isn't enough - it's better then give up on retriving
this info just in case the sysconf doesn't has these limit values.



[2007-02-22 23:39:18] [EMAIL PROTECTED]

+   if (grbuflen < 0)
+   grbuflen = 1024;

I definitely agree with this part of the patch.
But other parts look to me as a "workaround" for FreeBSD problems.

-   if (buflen < 1) {
-   RETURN_FALSE;
-   }
+   if (buflen < 0)
+   buflen = 1024;

It might be safe to do it on FreeBSD when you know for sure that this
functionality is missing and it's safe to use 1K buffer, but other
systems might behave differently.



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/40600

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


#28038 [Com]: Sent incorrect RCPT TO commands to SMTP server

2007-02-23 Thread business at ziu dot de
 ID:   28038
 Comment by:   business at ziu dot de
 Reported By:  jordi at jcanals dot net
 Status:   Open
 Bug Type: Mail related
 Operating System: win32
 PHP Version:  5CVS, 4CVS (2006-01-06) (cvs)
 New Comment:

This bug is now open since THREE YEARS. And still the version of today
(5.2.1) can not talk to SMTP servers as it should do.
This can not be so complicated to fix.


Previous Comments:


[2006-04-14 11:55:21] [EMAIL PROTECTED]

See also bug #37073



[2006-01-06 03:17:07] [EMAIL PROTECTED]

The case reported in bug #35013 should be fixed now in CVS.
(the others are NOT!)




[2005-11-10 15:57:04] Ruben at e-builds dot com

The sames happens when using mail() with the 'From' part of the extra
headers.

php uses this Header From part (and others for RPath etc..) for the
"MAIL FROM" address in the SMTP protocol, at least if you didn't
specify the sendmail_from setting in php.ini.
But for one reason or another, php (I thínk it's php) wraps this part
in "<" and ">" again!

The workaround is not to use the special format -User <[EMAIL PROTECTED]>-,
but just the e-mail address "[EMAIL PROTECTED]".  Of course then php
scripters who like a professional approach and want to use this special
format, ..well..they can't, at least not per php script.


I use a Domino SMTP server on Win32.
P.S. I saw several bugs of the same kind allover.  Some are even
wrongly closed, I presume.



[2005-11-02 00:05:27] php-louis at steelbytes dot com

can we at least just implement stripping of leading and trailing white
space on what is extracted from the headers? (as that'll fix 35013).



[2005-11-01 11:37:04] [EMAIL PROTECTED]

See also bug #35013, one more way how headers are parsed wrong.



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/28038

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


#38982 [Com]: No SSL-socket functions in CLI

2007-02-23 Thread xawiers at gmail dot com
 ID:   38982
 Comment by:   xawiers at gmail dot com
 Reported By:  admin at denic-294 dot de
 Status:   No Feedback
 Bug Type: OpenSSL related
 Operating System: Debian different releases
 PHP Version:  4.4.4
 New Comment:

System => FreeBSD 6.1-RELEASE-p12
Build Date => Feb 23 2007 17:11:29
Configure Command =>  './configure' '--enable-versioning'
'--enable-memory-limit' '--with-layout=GNU'
'--with-config-file-scan-dir=/usr/local/etc/php' '--disa
ble-all' '--program-prefix=' '--enable-force-cgi-redirect'
'--enable-discard-path' '--enable-fastcgi' '--with-regex=php'
'--with-openssl=/usr/local' '--with-o
penssl-dir=/usr/local' '--with-zlib=/usr' '--enable-zend-multibyte'
'--disable-ipv6' '--prefix=/usr/local'
Server API => Command Line Interface

Registered PHP Streams => php, http, ftp, https, ftps, compress.zlib

[PHP Modules]
openssl
standard
zlib

WHERE IS SSL TLS stream ???


Previous Comments:


[2007-02-15 04:00:27] mi7892 at hotmail dot com

I got the same problem too, i compile php-4.4.4 with following
command:

./configure --prefix=/usr/local/php4
--with-config-file-path=/usr/local/php4 --with-mysql=/usr/local/mysql
--with-openssl=/usr/local/ssl --with-apxs2=/usr/local/apache2/bin/apxs
--disable-all

and run the following php in cli.

https://www.interwetten.com');
?>

I got the following result:

[EMAIL PROTECTED] bin]# ./php ~/a.php

Warning: file_get_contents(): php_stream_sock_ssl_activate_with_method:
failed to create an SSL context in /root/a.php on line 3

Warning: file_get_contents(https://www.interwetten.com): failed to open
stream: Unable to activate SSL mode in /root/a.php on line 3


here is the result from php -m

[EMAIL PROTECTED] bin]# ./php -m
[PHP Modules]
mysql
openssl
standard

[Zend Modules]



[2006-10-06 01:00:01] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".



[2006-09-28 15:28:02] [EMAIL PROTECTED]

Please try to configure it with just ./configure --disable-all
--with-openssl.



[2006-09-28 15:10:04] [EMAIL PROTECTED]

Does php -m show the ssl extension as being loaded?



[2006-09-28 14:59:59] admin at denic-294 dot de

The php-source:
---
1: #!/root/php-4.4.4/sapi/cli/php
2: http://bugs.php.net/38982

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


#40606 [NEW]: umask is not being restored when each request is finished. no fixed bug #36630

2007-02-23 Thread support at nethost dot cz
From: support at nethost dot cz
Operating system: unix-gentoo
PHP version:  5.2.1
PHP Bug Type: *Directory/Filesystem functions
Bug description:  umask is not being restored when each request is finished. no 
fixed bug #36630 

Description:

>> Bug #36630   umask is not being restored when each equest is finished.
see for details in bug #36630.
  
this bug not fixed successfully, in file.c is bug in 
if (BG(umask) != -1) {
BG(umask) = oldumask;
}
instead 
if (BG(umask) == -1) {  /* yes == , no != */
BG(umask) = oldumask;
}
it fixes, but for clean code i move initializing 
BG(umask) = -1; from basic_globals_ctor to PHP_RINIT_FUNCTION(basic)  
(finalizing is in PHP_RSHUTDOWN_FUNCTION(basic))

this bug is only for sapi apache2 handler-module (apache1 has workaround
in sapi code). Or may implement same workaround in apache2 handler
module.

i try daily snapshot, and last version, all is bad fixed. after fixing all
is ok for testing code 




Reproduce code:
---



-- 
Edit bug report at http://bugs.php.net/?id=40606&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40606&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40606&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40606&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40606&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=40606&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=40606&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=40606&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=40606&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=40606&r=support
Expected behavior:http://bugs.php.net/fix.php?id=40606&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=40606&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=40606&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40606&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40606&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40606&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=40606&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=40606&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40606&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=40606&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=40606&r=mysqlcfg


#40606 [Opn->Fbk]: umask is not being restored when each request is finished. no fixed bug #36630

2007-02-23 Thread tony2001
 ID:   40606
 Updated by:   [EMAIL PROTECTED]
 Reported By:  support at nethost dot cz
-Status:   Open
+Status:   Feedback
 Bug Type: *Directory/Filesystem functions
 Operating System: unix-gentoo
 PHP Version:  5.2.1
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.




Previous Comments:


[2007-02-23 15:42:32] support at nethost dot cz

Description:

>> Bug #36630   umask is not being restored when each equest is
finished. see for details in bug #36630.
  
this bug not fixed successfully, in file.c is bug in 
if (BG(umask) != -1) {
BG(umask) = oldumask;
}
instead 
if (BG(umask) == -1) {  /* yes == , no != */
BG(umask) = oldumask;
}
it fixes, but for clean code i move initializing 
BG(umask) = -1; from basic_globals_ctor to PHP_RINIT_FUNCTION(basic)  
(finalizing is in PHP_RSHUTDOWN_FUNCTION(basic))

this bug is only for sapi apache2 handler-module (apache1 has
workaround in sapi code). Or may implement same workaround in apache2
handler module.

i try daily snapshot, and last version, all is bad fixed. after fixing
all is ok for testing code 




Reproduce code:
---







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


#40606 [Fbk->Opn]: umask is not being restored when each request is finished. no fixed bug #36630

2007-02-23 Thread support at nethost dot cz
 ID:   40606
 User updated by:  support at nethost dot cz
 Reported By:  support at nethost dot cz
-Status:   Feedback
+Status:   Open
 Bug Type: *Directory/Filesystem functions
 Operating System: unix-gentoo
 PHP Version:  5.2.1
 New Comment:

code is same as for bug 36630, as below, simple, but functional, 

expected result is (with default umask 070)
0070
0070
0070
and not
0070
0070
0070
0111
0070
0111  - there is used same process


Previous Comments:


[2007-02-23 15:54:01] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.





[2007-02-23 15:42:32] support at nethost dot cz

Description:

>> Bug #36630   umask is not being restored when each equest is
finished. see for details in bug #36630.
  
this bug not fixed successfully, in file.c is bug in 
if (BG(umask) != -1) {
BG(umask) = oldumask;
}
instead 
if (BG(umask) == -1) {  /* yes == , no != */
BG(umask) = oldumask;
}
it fixes, but for clean code i move initializing 
BG(umask) = -1; from basic_globals_ctor to PHP_RINIT_FUNCTION(basic)  
(finalizing is in PHP_RSHUTDOWN_FUNCTION(basic))

this bug is only for sapi apache2 handler-module (apache1 has
workaround in sapi code). Or may implement same workaround in apache2
handler module.

i try daily snapshot, and last version, all is bad fixed. after fixing
all is ok for testing code 




Reproduce code:
---







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


#40607 [NEW]: mssql_fetch_array concatinates spaces in middle of data

2007-02-23 Thread Joe at sofusion dot com
From: Joe at sofusion dot com
Operating system: FREE BSD 6.0
PHP version:  5.2.1
PHP Bug Type: MSSQL related
Bug description:  mssql_fetch_array concatinates spaces in middle of data

Description:

When using mssql_fetch_arry and mssql_fetch_row, data returned that
contains 2 spaces has been concatinated to one space.  Example:
Data returned should be "Two"' '' '"Spaces" (without quotes  Two  Spaces)
But is returned as "Two"' '"Spaces" (without quotes -Two Spaces with one
space between)

FreeBSD WEBSERVER1.SOFUSION.local 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Thu
Nov 3 09:36:13 UTC 2005 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/GENERIC
i386  

Build Date  Feb 22 2007 19:36:38  

Configure Command  './configure' '--with-apxs=/usr/local/apache/bin/apxs'
'--enable-versioning' '--with-mssql=/usr/local' '--enable-libxml'  

Library version  FreeTDS  



Reproduce code:
---
--MSSQL TABLE

CREATE TABLE #T1( Name varchar(255),
Number int )
INSERT INTO #T1 VALUES('Two  Spaces',1)
INSERT INTO #T1 VALUES('One Spaces',2)


--PHP CODE

$sql = "select Name FROM Name_TBL  WHERE Number = '1'";
$rs = mssql_query($sql);
$RT = mssql_fetch_array($rs);
$Name= $RT[Name'];
--This should have 2 spaces in it like the DB
--But it only has one
echo $Name




Expected result:

Two  Spaces
--This has 2 spaces between the words.

Actual result:
--
Two Spaces
--This only hase 1 space between the words

-- 
Edit bug report at http://bugs.php.net/?id=40607&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40607&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40607&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40607&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40607&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=40607&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=40607&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=40607&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=40607&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=40607&r=support
Expected behavior:http://bugs.php.net/fix.php?id=40607&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=40607&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=40607&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40607&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40607&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40607&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=40607&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=40607&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40607&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=40607&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=40607&r=mysqlcfg


#40607 [Opn]: mssql_fetch_array concatinates spaces in middle of data

2007-02-23 Thread Joe at sofusion dot com
 ID:   40607
 User updated by:  Joe at sofusion dot com
 Reported By:  Joe at sofusion dot com
 Status:   Open
 Bug Type: MSSQL related
 Operating System: FREE BSD 6.0
 PHP Version:  5.2.1
 New Comment:

Sorry, dont use # in TBL Name.  USE THIS DB CODE AND PHP CODE TO TEST:

CREATE TABLE T1( Name varchar(255),
Number int )
INSERT INTO T1 VALUES('Two  Spaces',1)
INSERT INTO T1 VALUES('One Spaces',2)



$sql = "SELECT Name FROM T1 WHERE Number = '1'";
$rs = mssql_query($sql);
while ($RT = mssql_fetch_array($rs)) 
{$Name= $RT['Name'];
//This should have 2 spaces in it like the DB
//But it only has one
echo ' Name = '.$Name . '';
}


Previous Comments:


[2007-02-23 15:59:40] Joe at sofusion dot com

Description:

When using mssql_fetch_arry and mssql_fetch_row, data returned that
contains 2 spaces has been concatinated to one space.  Example:
Data returned should be "Two"' '' '"Spaces" (without quotes  Two 
Spaces)
But is returned as "Two"' '"Spaces" (without quotes -Two Spaces with
one space between)

FreeBSD WEBSERVER1.SOFUSION.local 6.0-RELEASE FreeBSD 6.0-RELEASE #0:
Thu Nov 3 09:36:13 UTC 2005
[EMAIL PROTECTED]:/usr/obj/usr/src/sys/GENERIC i386  

Build Date  Feb 22 2007 19:36:38  

Configure Command  './configure'
'--with-apxs=/usr/local/apache/bin/apxs' '--enable-versioning'
'--with-mssql=/usr/local' '--enable-libxml'  

Library version  FreeTDS  



Reproduce code:
---
--MSSQL TABLE

CREATE TABLE #T1( Name varchar(255),
Number int )
INSERT INTO #T1 VALUES('Two  Spaces',1)
INSERT INTO #T1 VALUES('One Spaces',2)


--PHP CODE

$sql = "select Name FROM Name_TBL  WHERE Number = '1'";
$rs = mssql_query($sql);
$RT = mssql_fetch_array($rs);
$Name= $RT[Name'];
--This should have 2 spaces in it like the DB
--But it only has one
echo $Name




Expected result:

Two  Spaces
--This has 2 spaces between the words.

Actual result:
--
Two Spaces
--This only hase 1 space between the words





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


#40606 [Opn->Csd]: umask is not being restored when each request is finished. no fixed bug #36630

2007-02-23 Thread tony2001
 ID:   40606
 Updated by:   [EMAIL PROTECTED]
 Reported By:  support at nethost dot cz
-Status:   Open
+Status:   Closed
 Bug Type: *Directory/Filesystem functions
 Operating System: unix-gentoo
 PHP Version:  5.2.1
 New Comment:

This bug has been fixed in CVS.

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.




Previous Comments:


[2007-02-23 15:57:57] support at nethost dot cz

code is same as for bug 36630, as below, simple, but functional, 

expected result is (with default umask 070)
0070
0070
0070
and not
0070
0070
0070
0111
0070
0111  - there is used same process



[2007-02-23 15:54:01] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.





[2007-02-23 15:42:32] support at nethost dot cz

Description:

>> Bug #36630   umask is not being restored when each equest is
finished. see for details in bug #36630.
  
this bug not fixed successfully, in file.c is bug in 
if (BG(umask) != -1) {
BG(umask) = oldumask;
}
instead 
if (BG(umask) == -1) {  /* yes == , no != */
BG(umask) = oldumask;
}
it fixes, but for clean code i move initializing 
BG(umask) = -1; from basic_globals_ctor to PHP_RINIT_FUNCTION(basic)  
(finalizing is in PHP_RSHUTDOWN_FUNCTION(basic))

this bug is only for sapi apache2 handler-module (apache1 has
workaround in sapi code). Or may implement same workaround in apache2
handler module.

i try daily snapshot, and last version, all is bad fixed. after fixing
all is ok for testing code 




Reproduce code:
---







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


#40542 [Opn->Sus]: "ORA-02248: invalid option for ALTER SESSION" on OCIPLogon

2007-02-23 Thread tony2001
 ID:   40542
 Updated by:   [EMAIL PROTECTED]
 Reported By:  marvin at chag dot net
-Status:   Open
+Status:   Suspended
 Bug Type: OCI8 related
 Operating System: Linux
 PHP Version:  5.2.1
 New Comment:

>So maybe another env. variable tries to "alter session"?
I doubt env variables might "alter session" and even if they do, it's
not PHP problem.
Changing the status to suspended - I'm unable to reproduce it and I
believe it's something wrong with your system or the client lib.


Previous Comments:


[2007-02-23 09:09:45] marvin at chag dot net

I tried the workaround jmgonet kindly rovided and removed all NLS_LANG
setting from environment and startup scripts of the Apache server. The
problem persists in exactly the same way as before. Adding the charset
to the OCILogon did not help either. So maybe another env. variable
tries to "alter session"?



[2007-02-23 08:43:23] jmgonet at iware dot ch

I've found the following workaround for that problem:

- Instead of setting the NLS_LANG environment variable, you can specify
the charset while establishing the connection:

$conn=oci_connect("USER","PASSWORD","SERVER","CHARSET");

Where charset should be the one used by PHP client (not the one used by
the Oracle server). In the case of a windows system, it is
"WE8MSWIN1252" (In my PHP server, this code is specified in the
NLS_LANG registry key, but oci_connect doesn't take it as default
value). It is "WE8MSWIN1252" even if the PHP is executed as a script,
from the command line.

The CHARSET for a linux/unix system may be "WE8ISO8851P1", or at least
it seems to be usual in Europe.



[2007-02-23 07:31:42] jmgonet at iware dot ch

I have just the same problem, executing a PHP script as a Windows'
batch. I've set the NLS_LANG environment variable to
'NLS_LANG=FRENCH_SWITZERLAND.WE8PC850'.

I'm using Oracle 10 light client.

I've found in this (http://dbforums.com/t927204.html) and other forums,
a possible explanation:

'NLS_LANG cannot be changed by alter session, NLS_LANGUAGE and
NLS_TERRITORY can.'



[2007-02-22 07:13:19] marvin at chag dot net

Hi Tony2001, 
Thank you very much for the kind offer. Unfortunately our companies
security policies does not allow such an approach. But I will happily
investigate the problem according to your requirements and send you the
debugging information & results you need to isolate the problematic
lines.



[2007-02-20 10:03:38] [EMAIL PROTECTED]

>So I kindly ask, wether you please can tell me what else
>should cause this problem, if not PHP / OCI8?

Sure. I'd look in Oracle or in the client library.
With such an old version it's no wonder there are problems.

Though, we can try do it this way:
Please install 5.1.1 and make sure it does work fine.
Then I'll need an unprivileged ssh account on your machine to install
5.2.1, reproduce the problem and investigate it.
I'll also need Oracle connection details.



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/40542

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


#40608 [NEW]: break within foreach causes strange behaviour

2007-02-23 Thread eric dot broersma at phil dot uu dot nl
From: eric dot broersma at phil dot uu dot nl
Operating system: Sun Solaris
PHP version:  5.2.1
PHP Bug Type: Arrays related
Bug description:  break within foreach causes strange behaviour

Description:

A break within a foreach construct may cause an infinite loop when the
foreach construct is nested within another foreach construct, possibly as
a result of the internal array pointer of the array being foreach'ed not
being reset.

This problem did not occur in PHP 5.0.5, but did occur in PHP 5.2.1.

Reproduce code:
---
$w = array ( 0, 1 );

echo 'a';
foreach ( $w as $x ) {  
echo 'b' . $x;
foreach ( $w as $z ) {
echo 'c' . $z;
break 1;
}   
echo 'e' . $x;
}   
echo 'f';

Expected result:

ab0c0e0b1c0e1f


(Behaviour in PHP 5.0.5)

Actual result:
--
ab0c0e0b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0!
 
e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b...
(infinite loop)

(Behaviour in PHP 5.2.1)

-- 
Edit bug report at http://bugs.php.net/?id=40608&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40608&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40608&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40608&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40608&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=40608&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=40608&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=40608&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=40608&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=40608&r=support
Expected behavior:http://bugs.php.net/fix.php?id=40608&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=40608&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=40608&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40608&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40608&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40608&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=40608&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=40608&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40608&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=40608&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=40608&r=mysqlcfg


#40609 [NEW]: Segfaults when using more than one SoapVar in a request

2007-02-23 Thread robin dot harvey at chaptereight dot com
From: robin dot harvey at chaptereight dot com
Operating system: Linux - Ubuntu
PHP version:  5.2.1
PHP Bug Type: SOAP related
Bug description:  Segfaults when using more than one SoapVar in a request

Description:

I've got a very simple soap service (written in Java/Tomcat/Axis) which
simply accepts and logs the XML of a soap request.  I need to post complex
XML to the server (an XSL stylesheet) and I'm using SoapVar with XSD_ANYXML
and dealing with the XSL as a string in PHP.  When I try to add more than
one SoapVar object encoded in this way, PHP segfaults.  It's happy with 1
param as a SoapVar, and with both as simple strings.

Reproduce code:
---
http://192.168.1.79:8080/axis2/services/BuddyTestService?wsdl');
$data1 = <<

the transform go here!


XML;

$data2 = <<
Random content
sent to the soap server

XML;

$tdata = new SoapVar($data1, XSD_ANYXML);
$t = new SoapVar($data2, XSD_ANYXML);

$data = array('TransformData' => $tdata, 'Transform' => $t);
//$data = array('TransformData' => 'foo', 'Transform' => 'bar');
$s->examine($data);
?>

Expected result:

NULL.  The service is 'In only'

Actual result:
--
[EMAIL PROTECTED]:~/projects/buddy/tomcat/soap2$ php test-client-joe.php

Segmentation fault (core dumped)

-- 
Edit bug report at http://bugs.php.net/?id=40609&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40609&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40609&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40609&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40609&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=40609&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=40609&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=40609&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=40609&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=40609&r=support
Expected behavior:http://bugs.php.net/fix.php?id=40609&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=40609&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=40609&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40609&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40609&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40609&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=40609&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=40609&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40609&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=40609&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=40609&r=mysqlcfg


#40599 [Fbk->Opn]: "make test" results in segmentation fault

2007-02-23 Thread lyle dot pritchett at dri dot edu
 ID:   40599
 User updated by:  lyle dot pritchett at dri dot edu
 Reported By:  lyle dot pritchett at dri dot edu
-Status:   Feedback
+Status:   Open
 Bug Type: Reproducible crash
 Operating System: Solaris 9, 10
 PHP Version:  5CVS-2007-02-22 (snap)
 New Comment:

No joy.  Rebuilt latest snap version (5.2-200702231530) with gcc 4.1.2.
 Still getting seg fault on self-test on both Solaris 9 and 10 SPARC
servers.  Also tried minimal config to eliminate possible effects of
supplemental packages:

./configure --prefix=/opt \
--with-config-file-path=/opt/apache/conf \
--localstatedir=/var/run \
--with-libxml-dir=/opt

Still barfing.  Traceback on latest build same as before (with
exception of absolute address values).


Previous Comments:


[2007-02-23 00:45:13] [EMAIL PROTECTED]

Try with GCC 4.1.2, it's working fine here on Solaris 9.



[2007-02-23 00:36:07] lyle dot pritchett at dri dot edu

gcc 4.1.1, built from scratch a couple of days ago.



[2007-02-23 00:34:20] [EMAIL PROTECTED]

What kind of GCC did you use?



[2007-02-23 00:31:33] lyle dot pritchett at dri dot edu

make test

Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).

Segmentation Fault
make: [test] Error 139 (ignored)
trapdoor:/opt/src/php/php5.2-20070130 #  gdb ./sapi/cli/php
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "sparc-sun-solaris2.10"...
(gdb) set args run-tests.php
(gdb) run
Starting program: /opt/src/php/php5.2-20070130/sapi/cli/php
run-tests.php
warning: Lowest section in /lib/libpthread.so.1 is .dynamic at
0074
warning: Lowest section in /lib/libdl.so.1 is .dynamic at 0094

Program received signal SIGSEGV, Segmentation fault.
_zval_ptr_dtor (zval_ptr=0x3d6748)
at /opt/src/php/php5.2-20070130/Zend/zend_execute_API.c:412
412 (*zval_ptr)->refcount--;
(gdb) bt
#0  _zval_ptr_dtor (zval_ptr=0x3d6748)
at /opt/src/php/php5.2-20070130/Zend/zend_execute_API.c:412
#1  0x002892e0 in zend_do_fcall_common_helper_SPEC
(execute_data=0xffbfbb4c)
at zend_execute.h:155
#2  0x002791f0 in execute (op_array=0xffbff110) at
zend_vm_execute.h:92
#3  0x00259780 in zend_execute_scripts (type=-2115502080,
retval=Variable "retval" is not available.
)
at /opt/src/php/php5.2-20070130/Zend/zend.c:1135
#4  0x00214d14 in php_execute_script (primary_file=0x81e8)
at /opt/src/php/php5.2-20070130/main/main.c:1787
#5  0x002e51b0 in main (argc=-2115502080, argv=0x91d0203a)
at /opt/src/php/php5.2-20070130/sapi/cli/php_cli.c:1127
(gdb) quit



[2007-02-22 23:24:54] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.





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/40599

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


#40609 [Opn->Fbk]: Segfaults when using more than one SoapVar in a request

2007-02-23 Thread rrichards
 ID:   40609
 Updated by:   [EMAIL PROTECTED]
 Reported By:  robin dot harvey at chaptereight dot com
-Status:   Open
+Status:   Feedback
 Bug Type: SOAP related
 Operating System: Linux - Ubuntu
 PHP Version:  5.2.1
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

An accessible WSDL might also be helpful


Previous Comments:


[2007-02-23 17:12:38] robin dot harvey at chaptereight dot com

Description:

I've got a very simple soap service (written in Java/Tomcat/Axis) which
simply accepts and logs the XML of a soap request.  I need to post
complex XML to the server (an XSL stylesheet) and I'm using SoapVar
with XSD_ANYXML and dealing with the XSL as a string in PHP.  When I
try to add more than one SoapVar object encoded in this way, PHP
segfaults.  It's happy with 1 param as a SoapVar, and with both as
simple strings.

Reproduce code:
---
http://192.168.1.79:8080/axis2/services/BuddyTestService?wsdl');
$data1 = <<

the transform go here!


XML;

$data2 = <<
Random content
sent to the soap server

XML;

$tdata = new SoapVar($data1, XSD_ANYXML);
$t = new SoapVar($data2, XSD_ANYXML);

$data = array('TransformData' => $tdata, 'Transform' => $t);
//$data = array('TransformData' => 'foo', 'Transform' => 'bar');
$s->examine($data);
?>

Expected result:

NULL.  The service is 'In only'

Actual result:
--
[EMAIL PROTECTED]:~/projects/buddy/tomcat/soap2$ php
test-client-joe.php 
Segmentation fault (core dumped)





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


#40610 [NEW]: Side effect of passing array element by reference

2007-02-23 Thread Webbed dot Pete at gmail dot com
From: Webbed dot Pete at gmail dot com
Operating system: Windows, Linux
PHP version:  5.2.1
PHP Bug Type: Arrays related
Bug description:  Side effect of passing array element by reference

Description:

Pass an unset array element by reference, without doing anything at all.

The passed array will gain an element.

(Note: We use isset() in our real function, which is what pointed us to
the bug, but it is not necessary for demoing the defect.)

Reproduce code:
---
BEFORE\n";
echo "aEmpty contains ".count($aEmpty)." element(s)\n",print_r( $aEmpty,
TRUE ); echo "aOne contains ".count($aOne)." element(s)\n",print_r( $aOne,
TRUE );

// Pass by reference modifies the arrays. (we use with 'isset()' and saw
this; I've reduced to basic issue.)

$aEmpty = array();$aOne = array( 'corn' );
refTest( $aEmpty['wheat'] ); refTest( $aOne['wheat'] );

echo "\nAFTER PASS BY REFERENCE\n";
echo "aEmpty contains ".count($aEmpty)." element(s)\n",print_r( $aEmpty,
TRUE ); echo "aOne contains ".count($aOne)." element(s)\n",print_r( $aOne,
TRUE );

?>


Expected result:

BEFORE
aEmpty contains 0 element(s)
Array
(
)
aOne contains 1 element(s)
Array
(
[0] => corn
)


[Same if you directly reference, or use isset() outside of a function, etc
etc]
[If you don't pass by reference you get notice error so that is not a
solution]

Actual result:
--
AFTER PASS BY REFERENCE
aEmpty contains 1 element(s)
Array
(
[wheat] => 
)
aOne contains 2 element(s)
Array
(
[0] => corn
[wheat] => 
)

-- 
Edit bug report at http://bugs.php.net/?id=40610&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40610&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40610&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40610&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40610&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=40610&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=40610&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=40610&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=40610&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=40610&r=support
Expected behavior:http://bugs.php.net/fix.php?id=40610&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=40610&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=40610&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40610&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40610&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40610&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=40610&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=40610&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40610&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=40610&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=40610&r=mysqlcfg


#40611 [NEW]: cURL memory error

2007-02-23 Thread zamorov at edinorog dot ru
From: zamorov at edinorog dot ru
Operating system: FreeBSD 4.11
PHP version:  4CVS-2007-02-23 (snap)
PHP Bug Type: cURL related
Bug description:  cURL memory error

Description:

cURL 1.15.5, 1.16.0 and 1.16.1

Got many error in log if request site with empty body.

Sample:
http://bar-navig.yandex.ru/u?sample=test

HTTP/1.1 200 Ok
Connection: close
Cache-control: no-cache, max-age=0
Expires: Thu, 01 Jan 1970 00:00:01 GMT
Content-Type: text/html; charset=windows-1251

and no body.

Reproduce code:
---
http://bar-navig.yandex.ru/u?sample=test');
$return = curl_exec($curl);

echo (curl_errno($this->Curl) == 0) ? 'ok' : 'error';
?>

Expected result:

error.log

many lines with
httpd in free(): warning: page is already free
httpd in free(): warning: chunk is already free
and
Integer overflow in memory_limit check detected

Actual result:
--
Zero page.

-- 
Edit bug report at http://bugs.php.net/?id=40611&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40611&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40611&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40611&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40611&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=40611&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=40611&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=40611&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=40611&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=40611&r=support
Expected behavior:http://bugs.php.net/fix.php?id=40611&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=40611&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=40611&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40611&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40611&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40611&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=40611&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=40611&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40611&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=40611&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=40611&r=mysqlcfg


#40610 [Opn]: Side effect of passing array element by reference

2007-02-23 Thread Webbed dot Pete at gmail dot com
 ID:   40610
 User updated by:  Webbed dot Pete at gmail dot com
 Reported By:  Webbed dot Pete at gmail dot com
 Status:   Open
 Bug Type: Arrays related
 Operating System: Windows, Linux
 PHP Version:  5.2.1
 New Comment:

Even simpler:
 $x=&$aEmpty['wheat'];

Adds element 'wheat' to the array.

This creates a nasty side effect for a couple of valuable and common
functions, which basically extend isset() for default values and so
forth:

function varset(&$val,$default='') {
if (isset($val)) return $val;
return $default;
}
function varsettrue(&$val,$default='') {
if (isset($val) && $val) return $val;
return $default;
}

$myVal = varset($pref['maxsize'],1000); // set myVal to pref or
default

NOTE: all of the following leave $aEmpty alone. I understand why this
might be the case, yet it still is wrong to break references IMHO, not
least because of losing ability to create functions like those above.
  $aEmpty['wheat']; // simple reference
  isset($aEmpty['wheat']); // built-in function
  myFunc($aEmpty['wheat']); // pass-by-value to user func


Previous Comments:


[2007-02-23 17:59:06] Webbed dot Pete at gmail dot com

Description:

Pass an unset array element by reference, without doing anything at
all.

The passed array will gain an element.

(Note: We use isset() in our real function, which is what pointed us to
the bug, but it is not necessary for demoing the defect.)

Reproduce code:
---
BEFORE\n";
echo "aEmpty contains ".count($aEmpty)." element(s)\n",print_r(
$aEmpty, TRUE ); echo "aOne contains ".count($aOne)."
element(s)\n",print_r( $aOne, TRUE );

// Pass by reference modifies the arrays. (we use with 'isset()' and
saw this; I've reduced to basic issue.)

$aEmpty = array();$aOne = array( 'corn' );
refTest( $aEmpty['wheat'] ); refTest( $aOne['wheat'] );

echo "\nAFTER PASS BY REFERENCE\n";
echo "aEmpty contains ".count($aEmpty)." element(s)\n",print_r(
$aEmpty, TRUE ); echo "aOne contains ".count($aOne)."
element(s)\n",print_r( $aOne, TRUE );

?>


Expected result:

BEFORE
aEmpty contains 0 element(s)
Array
(
)
aOne contains 1 element(s)
Array
(
[0] => corn
)


[Same if you directly reference, or use isset() outside of a function,
etc etc]
[If you don't pass by reference you get notice error so that is not a
solution]

Actual result:
--
AFTER PASS BY REFERENCE
aEmpty contains 1 element(s)
Array
(
[wheat] => 
)
aOne contains 2 element(s)
Array
(
[0] => corn
[wheat] => 
)





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


#40607 [Opn->Bgs]: mssql_fetch_array concatinates spaces in middle of data

2007-02-23 Thread fmk
 ID:   40607
 Updated by:   [EMAIL PROTECTED]
 Reported By:  Joe at sofusion dot com
-Status:   Open
+Status:   Bogus
 Bug Type: MSSQL related
 Operating System: FREE BSD 6.0
 PHP Version:  5.2.1
 New Comment:

I'm unable to reproduce this (on Linux and WIndows with FreeTDS). Try
viewing the result outside the browser, use  or get the
length of the column to verify that you are getting the right results.


Previous Comments:


[2007-02-23 16:18:14] Joe at sofusion dot com

Sorry, dont use # in TBL Name.  USE THIS DB CODE AND PHP CODE TO TEST:

CREATE TABLE T1( Name varchar(255),
Number int )
INSERT INTO T1 VALUES('Two  Spaces',1)
INSERT INTO T1 VALUES('One Spaces',2)



$sql = "SELECT Name FROM T1 WHERE Number = '1'";
$rs = mssql_query($sql);
while ($RT = mssql_fetch_array($rs)) 
{$Name= $RT['Name'];
//This should have 2 spaces in it like the DB
//But it only has one
echo ' Name = '.$Name . '';
}



[2007-02-23 15:59:40] Joe at sofusion dot com

Description:

When using mssql_fetch_arry and mssql_fetch_row, data returned that
contains 2 spaces has been concatinated to one space.  Example:
Data returned should be "Two"' '' '"Spaces" (without quotes  Two 
Spaces)
But is returned as "Two"' '"Spaces" (without quotes -Two Spaces with
one space between)

FreeBSD WEBSERVER1.SOFUSION.local 6.0-RELEASE FreeBSD 6.0-RELEASE #0:
Thu Nov 3 09:36:13 UTC 2005
[EMAIL PROTECTED]:/usr/obj/usr/src/sys/GENERIC i386  

Build Date  Feb 22 2007 19:36:38  

Configure Command  './configure'
'--with-apxs=/usr/local/apache/bin/apxs' '--enable-versioning'
'--with-mssql=/usr/local' '--enable-libxml'  

Library version  FreeTDS  



Reproduce code:
---
--MSSQL TABLE

CREATE TABLE #T1( Name varchar(255),
Number int )
INSERT INTO #T1 VALUES('Two  Spaces',1)
INSERT INTO #T1 VALUES('One Spaces',2)


--PHP CODE

$sql = "select Name FROM Name_TBL  WHERE Number = '1'";
$rs = mssql_query($sql);
$RT = mssql_fetch_array($rs);
$Name= $RT[Name'];
--This should have 2 spaces in it like the DB
--But it only has one
echo $Name




Expected result:

Two  Spaces
--This has 2 spaces between the words.

Actual result:
--
Two Spaces
--This only hase 1 space between the words





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


#31225 [Com]: ftp_get : Strange warnings

2007-02-23 Thread darksport at interzet dot ru
 ID:   31225
 Comment by:   darksport at interzet dot ru
 Reported By:  guibod at free dot fr
 Status:   No Feedback
 Bug Type: FTP related
 Operating System: Windows
 PHP Version:  5.0.2
 New Comment:

i found out that this problem occurs when i'm trying to download files
larger than 2gb. and after one such file this function doesnt download
any more, only shows warnings. I'm using php 4.4.4 under Gentoo Linux


Previous Comments:


[2005-03-11 01:00:05] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".



[2005-02-28 21:04:32] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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





[2004-12-21 16:08:29] guibod at free dot fr

I am sorry I am not able to give such sensible information. This bug
occured in a professionnal context, I have no contact with the FTP
admins and then cannot give you anykind of dummy account.

There is an phone number to contact the server admin. I can give you
this. Consider this sent to you directly, yet.

The FTP server is NOT a IIS server. It output a UNIX like directory
listing but there is no server header that allow me to get clear datas
about the FTP server.



[2004-12-21 15:33:01] [EMAIL PROTECTED]

Please supply login to the FTP site which can be used to replicate the
bug.



[2004-12-21 10:52:04] guibod at free dot fr

Description:

I use a ftp connection through a ftp firewall, unknown version. ftp_get
failed a couple of time triggering an warning very similar to Bug #29745
but before a successfull file recover.
Same as Bug #18886 but on PHP 5.0.2

So long I noted two type of messages :

- ftp_get(): Entering Passive Mode (10,160,5,2,70,219)

- ftp_get(): Opening BINARY mode data connection for file transfer.


It seem that ftp_get crash because the previous FTP command response is
replied when ftp_get is used.

Reproduce code:
---
There is no real rule to reproduce this. It happened only on a
Microsoft FTP server (IIS 5) and behind an unidentified ftp proxy.

Expected result:

No warnings ! :)






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


#40599 [Opn->Fbk]: "make test" results in segmentation fault

2007-02-23 Thread tony2001
 ID:   40599
 Updated by:   [EMAIL PROTECTED]
 Reported By:  lyle dot pritchett at dri dot edu
-Status:   Open
+Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: Solaris 9, 10
 PHP Version:  5CVS-2007-02-22 (snap)
 New Comment:

Cannot reproduce.


Previous Comments:


[2007-02-23 17:40:55] lyle dot pritchett at dri dot edu

No joy.  Rebuilt latest snap version (5.2-200702231530) with gcc 4.1.2.
 Still getting seg fault on self-test on both Solaris 9 and 10 SPARC
servers.  Also tried minimal config to eliminate possible effects of
supplemental packages:

./configure --prefix=/opt \
--with-config-file-path=/opt/apache/conf \
--localstatedir=/var/run \
--with-libxml-dir=/opt

Still barfing.  Traceback on latest build same as before (with
exception of absolute address values).



[2007-02-23 00:45:13] [EMAIL PROTECTED]

Try with GCC 4.1.2, it's working fine here on Solaris 9.



[2007-02-23 00:36:07] lyle dot pritchett at dri dot edu

gcc 4.1.1, built from scratch a couple of days ago.



[2007-02-23 00:34:20] [EMAIL PROTECTED]

What kind of GCC did you use?



[2007-02-23 00:31:33] lyle dot pritchett at dri dot edu

make test

Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).

Segmentation Fault
make: [test] Error 139 (ignored)
trapdoor:/opt/src/php/php5.2-20070130 #  gdb ./sapi/cli/php
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "sparc-sun-solaris2.10"...
(gdb) set args run-tests.php
(gdb) run
Starting program: /opt/src/php/php5.2-20070130/sapi/cli/php
run-tests.php
warning: Lowest section in /lib/libpthread.so.1 is .dynamic at
0074
warning: Lowest section in /lib/libdl.so.1 is .dynamic at 0094

Program received signal SIGSEGV, Segmentation fault.
_zval_ptr_dtor (zval_ptr=0x3d6748)
at /opt/src/php/php5.2-20070130/Zend/zend_execute_API.c:412
412 (*zval_ptr)->refcount--;
(gdb) bt
#0  _zval_ptr_dtor (zval_ptr=0x3d6748)
at /opt/src/php/php5.2-20070130/Zend/zend_execute_API.c:412
#1  0x002892e0 in zend_do_fcall_common_helper_SPEC
(execute_data=0xffbfbb4c)
at zend_execute.h:155
#2  0x002791f0 in execute (op_array=0xffbff110) at
zend_vm_execute.h:92
#3  0x00259780 in zend_execute_scripts (type=-2115502080,
retval=Variable "retval" is not available.
)
at /opt/src/php/php5.2-20070130/Zend/zend.c:1135
#4  0x00214d14 in php_execute_script (primary_file=0x81e8)
at /opt/src/php/php5.2-20070130/main/main.c:1787
#5  0x002e51b0 in main (argc=-2115502080, argv=0x91d0203a)
at /opt/src/php/php5.2-20070130/sapi/cli/php_cli.c:1127
(gdb) quit



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/40599

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


#40612 [NEW]: ftp_get and files > 2gb

2007-02-23 Thread darksport at interzet dot ru
From: darksport at interzet dot ru
Operating system: Gentoo Linux
PHP version:  4.4.5
PHP Bug Type: FTP related
Bug description:  ftp_get and files > 2gb

Description:

i have problems with function ftp_get like in bug #31225

i found out that this problem occurs when i'm trying to download files
larger than 2gb. and after one such file this function doesnt download any
more, only shows warnings


-- 
Edit bug report at http://bugs.php.net/?id=40612&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40612&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40612&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40612&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40612&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=40612&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=40612&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=40612&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=40612&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=40612&r=support
Expected behavior:http://bugs.php.net/fix.php?id=40612&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=40612&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=40612&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40612&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40612&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40612&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=40612&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=40612&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40612&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=40612&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=40612&r=mysqlcfg


#40610 [Opn->Bgs]: Side effect of passing array element by reference

2007-02-23 Thread tony2001
 ID:   40610
 Updated by:   [EMAIL PROTECTED]
 Reported By:  Webbed dot Pete at gmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Arrays related
 Operating System: Windows, Linux
 PHP Version:  5.2.1
 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




Previous Comments:


[2007-02-23 19:01:44] Webbed dot Pete at gmail dot com

Even simpler:
 $x=&$aEmpty['wheat'];

Adds element 'wheat' to the array.

This creates a nasty side effect for a couple of valuable and common
functions, which basically extend isset() for default values and so
forth:

function varset(&$val,$default='') {
if (isset($val)) return $val;
return $default;
}
function varsettrue(&$val,$default='') {
if (isset($val) && $val) return $val;
return $default;
}

$myVal = varset($pref['maxsize'],1000); // set myVal to pref or
default

NOTE: all of the following leave $aEmpty alone. I understand why this
might be the case, yet it still is wrong to break references IMHO, not
least because of losing ability to create functions like those above.
  $aEmpty['wheat']; // simple reference
  isset($aEmpty['wheat']); // built-in function
  myFunc($aEmpty['wheat']); // pass-by-value to user func



[2007-02-23 17:59:06] Webbed dot Pete at gmail dot com

Description:

Pass an unset array element by reference, without doing anything at
all.

The passed array will gain an element.

(Note: We use isset() in our real function, which is what pointed us to
the bug, but it is not necessary for demoing the defect.)

Reproduce code:
---
BEFORE\n";
echo "aEmpty contains ".count($aEmpty)." element(s)\n",print_r(
$aEmpty, TRUE ); echo "aOne contains ".count($aOne)."
element(s)\n",print_r( $aOne, TRUE );

// Pass by reference modifies the arrays. (we use with 'isset()' and
saw this; I've reduced to basic issue.)

$aEmpty = array();$aOne = array( 'corn' );
refTest( $aEmpty['wheat'] ); refTest( $aOne['wheat'] );

echo "\nAFTER PASS BY REFERENCE\n";
echo "aEmpty contains ".count($aEmpty)." element(s)\n",print_r(
$aEmpty, TRUE ); echo "aOne contains ".count($aOne)."
element(s)\n",print_r( $aOne, TRUE );

?>


Expected result:

BEFORE
aEmpty contains 0 element(s)
Array
(
)
aOne contains 1 element(s)
Array
(
[0] => corn
)


[Same if you directly reference, or use isset() outside of a function,
etc etc]
[If you don't pass by reference you get notice error so that is not a
solution]

Actual result:
--
AFTER PASS BY REFERENCE
aEmpty contains 1 element(s)
Array
(
[wheat] => 
)
aOne contains 2 element(s)
Array
(
[0] => corn
[wheat] => 
)





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


#40607 [Bgs]: mssql_fetch_array concatinates spaces in middle of data

2007-02-23 Thread Joe at sofusion dot com
 ID:   40607
 User updated by:  Joe at sofusion dot com
 Reported By:  Joe at sofusion dot com
 Status:   Bogus
 Bug Type: MSSQL related
 Operating System: FREE BSD 6.0
 PHP Version:  5.2.1
 New Comment:

When I use the  tags, It does display the correct data.  Is
this telling me that it is HTML that is concatinating the 2 spaces into
one?
Also you can use:
$Name = str_replace (' ', ':', $RT['Name']);
echo ' Name2 = '.$Name . '';
to see the 2 spaces.

When you duplicate the bug, do you have 2 spaces between the words in
your browser?
Thanks!!


Previous Comments:


[2007-02-23 19:29:07] [EMAIL PROTECTED]

I'm unable to reproduce this (on Linux and WIndows with FreeTDS). Try
viewing the result outside the browser, use  or get the
length of the column to verify that you are getting the right results.



[2007-02-23 16:18:14] Joe at sofusion dot com

Sorry, dont use # in TBL Name.  USE THIS DB CODE AND PHP CODE TO TEST:

CREATE TABLE T1( Name varchar(255),
Number int )
INSERT INTO T1 VALUES('Two  Spaces',1)
INSERT INTO T1 VALUES('One Spaces',2)



$sql = "SELECT Name FROM T1 WHERE Number = '1'";
$rs = mssql_query($sql);
while ($RT = mssql_fetch_array($rs)) 
{$Name= $RT['Name'];
//This should have 2 spaces in it like the DB
//But it only has one
echo ' Name = '.$Name . '';
}



[2007-02-23 15:59:40] Joe at sofusion dot com

Description:

When using mssql_fetch_arry and mssql_fetch_row, data returned that
contains 2 spaces has been concatinated to one space.  Example:
Data returned should be "Two"' '' '"Spaces" (without quotes  Two 
Spaces)
But is returned as "Two"' '"Spaces" (without quotes -Two Spaces with
one space between)

FreeBSD WEBSERVER1.SOFUSION.local 6.0-RELEASE FreeBSD 6.0-RELEASE #0:
Thu Nov 3 09:36:13 UTC 2005
[EMAIL PROTECTED]:/usr/obj/usr/src/sys/GENERIC i386  

Build Date  Feb 22 2007 19:36:38  

Configure Command  './configure'
'--with-apxs=/usr/local/apache/bin/apxs' '--enable-versioning'
'--with-mssql=/usr/local' '--enable-libxml'  

Library version  FreeTDS  



Reproduce code:
---
--MSSQL TABLE

CREATE TABLE #T1( Name varchar(255),
Number int )
INSERT INTO #T1 VALUES('Two  Spaces',1)
INSERT INTO #T1 VALUES('One Spaces',2)


--PHP CODE

$sql = "select Name FROM Name_TBL  WHERE Number = '1'";
$rs = mssql_query($sql);
$RT = mssql_fetch_array($rs);
$Name= $RT[Name'];
--This should have 2 spaces in it like the DB
--But it only has one
echo $Name




Expected result:

Two  Spaces
--This has 2 spaces between the words.

Actual result:
--
Two Spaces
--This only hase 1 space between the words





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


#40611 [Opn->Asn]: cURL memory error

2007-02-23 Thread tony2001
 ID:   40611
 Updated by:   [EMAIL PROTECTED]
 Reported By:  zamorov at edinorog dot ru
-Status:   Open
+Status:   Assigned
 Bug Type: cURL related
 Operating System: FreeBSD 4.11
 PHP Version:  4CVS-2007-02-23 (snap)
-Assigned To:  
+Assigned To:  tony2001


Previous Comments:


[2007-02-23 18:05:35] zamorov at edinorog dot ru

Description:

cURL 1.15.5, 1.16.0 and 1.16.1

Got many error in log if request site with empty body.

Sample:
http://bar-navig.yandex.ru/u?sample=test

HTTP/1.1 200 Ok
Connection: close
Cache-control: no-cache, max-age=0
Expires: Thu, 01 Jan 1970 00:00:01 GMT
Content-Type: text/html; charset=windows-1251

and no body.

Reproduce code:
---
http://bar-navig.yandex.ru/u?sample=test');
$return = curl_exec($curl);

echo (curl_errno($this->Curl) == 0) ? 'ok' : 'error';
?>

Expected result:

error.log

many lines with
httpd in free(): warning: page is already free
httpd in free(): warning: chunk is already free
and
Integer overflow in memory_limit check detected

Actual result:
--
Zero page.





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


#40612 [Opn->Fbk]: ftp_get and files > 2gb

2007-02-23 Thread tony2001
 ID:   40612
 Updated by:   [EMAIL PROTECTED]
 Reported By:  darksport at interzet dot ru
-Status:   Open
+Status:   Feedback
 Bug Type: FTP related
 Operating System: Gentoo Linux
 PHP Version:  4.4.5
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.




Previous Comments:


[2007-02-23 20:13:11] darksport at interzet dot ru

Description:

i have problems with function ftp_get like in bug #31225

i found out that this problem occurs when i'm trying to download files
larger than 2gb. and after one such file this function doesnt download
any more, only shows warnings






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


#40607 [Bgs]: mssql_fetch_array concatinates spaces in middle of data

2007-02-23 Thread fmk
 ID:   40607
 Updated by:   [EMAIL PROTECTED]
 Reported By:  Joe at sofusion dot com
 Status:   Bogus
 Bug Type: MSSQL related
 Operating System: FREE BSD 6.0
 PHP Version:  5.2.1
 New Comment:

This is a normal browser feature. The browser will reduce the
whitespace (spaces, tabs new lines etc) to a single space. You could
replace each space with   if you want to force two spaces.


Previous Comments:


[2007-02-23 20:16:24] Joe at sofusion dot com

When I use the  tags, It does display the correct data.  Is
this telling me that it is HTML that is concatinating the 2 spaces into
one?
Also you can use:
$Name = str_replace (' ', ':', $RT['Name']);
echo ' Name2 = '.$Name . '';
to see the 2 spaces.

When you duplicate the bug, do you have 2 spaces between the words in
your browser?
Thanks!!



[2007-02-23 19:29:07] [EMAIL PROTECTED]

I'm unable to reproduce this (on Linux and WIndows with FreeTDS). Try
viewing the result outside the browser, use  or get the
length of the column to verify that you are getting the right results.



[2007-02-23 16:18:14] Joe at sofusion dot com

Sorry, dont use # in TBL Name.  USE THIS DB CODE AND PHP CODE TO TEST:

CREATE TABLE T1( Name varchar(255),
Number int )
INSERT INTO T1 VALUES('Two  Spaces',1)
INSERT INTO T1 VALUES('One Spaces',2)



$sql = "SELECT Name FROM T1 WHERE Number = '1'";
$rs = mssql_query($sql);
while ($RT = mssql_fetch_array($rs)) 
{$Name= $RT['Name'];
//This should have 2 spaces in it like the DB
//But it only has one
echo ' Name = '.$Name . '';
}



[2007-02-23 15:59:40] Joe at sofusion dot com

Description:

When using mssql_fetch_arry and mssql_fetch_row, data returned that
contains 2 spaces has been concatinated to one space.  Example:
Data returned should be "Two"' '' '"Spaces" (without quotes  Two 
Spaces)
But is returned as "Two"' '"Spaces" (without quotes -Two Spaces with
one space between)

FreeBSD WEBSERVER1.SOFUSION.local 6.0-RELEASE FreeBSD 6.0-RELEASE #0:
Thu Nov 3 09:36:13 UTC 2005
[EMAIL PROTECTED]:/usr/obj/usr/src/sys/GENERIC i386  

Build Date  Feb 22 2007 19:36:38  

Configure Command  './configure'
'--with-apxs=/usr/local/apache/bin/apxs' '--enable-versioning'
'--with-mssql=/usr/local' '--enable-libxml'  

Library version  FreeTDS  



Reproduce code:
---
--MSSQL TABLE

CREATE TABLE #T1( Name varchar(255),
Number int )
INSERT INTO #T1 VALUES('Two  Spaces',1)
INSERT INTO #T1 VALUES('One Spaces',2)


--PHP CODE

$sql = "select Name FROM Name_TBL  WHERE Number = '1'";
$rs = mssql_query($sql);
$RT = mssql_fetch_array($rs);
$Name= $RT[Name'];
--This should have 2 spaces in it like the DB
--But it only has one
echo $Name




Expected result:

Two  Spaces
--This has 2 spaces between the words.

Actual result:
--
Two Spaces
--This only hase 1 space between the words





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


#40611 [Asn->Csd]: cURL memory error

2007-02-23 Thread tony2001
 ID:   40611
 Updated by:   [EMAIL PROTECTED]
 Reported By:  zamorov at edinorog dot ru
-Status:   Assigned
+Status:   Closed
 Bug Type: cURL related
 Operating System: FreeBSD 4.11
 PHP Version:  4CVS-2007-02-23 (snap)
 Assigned To:  tony2001
 New Comment:

This bug has been fixed in CVS.

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.




Previous Comments:


[2007-02-23 18:05:35] zamorov at edinorog dot ru

Description:

cURL 1.15.5, 1.16.0 and 1.16.1

Got many error in log if request site with empty body.

Sample:
http://bar-navig.yandex.ru/u?sample=test

HTTP/1.1 200 Ok
Connection: close
Cache-control: no-cache, max-age=0
Expires: Thu, 01 Jan 1970 00:00:01 GMT
Content-Type: text/html; charset=windows-1251

and no body.

Reproduce code:
---
http://bar-navig.yandex.ru/u?sample=test');
$return = curl_exec($curl);

echo (curl_errno($this->Curl) == 0) ? 'ok' : 'error';
?>

Expected result:

error.log

many lines with
httpd in free(): warning: page is already free
httpd in free(): warning: chunk is already free
and
Integer overflow in memory_limit check detected

Actual result:
--
Zero page.





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


#40608 [Opn->Fbk]: break within foreach causes strange behaviour

2007-02-23 Thread tony2001
 ID:   40608
 Updated by:   [EMAIL PROTECTED]
 Reported By:  eric dot broersma at phil dot uu dot nl
-Status:   Open
+Status:   Feedback
 Bug Type: Arrays related
 Operating System: Sun Solaris
 PHP Version:  5.2.1
 New Comment:

Cannot reproduce.
Make sure you don't have any zend_extension's like ionCube, Zend
Optimizer, APC, eAccelerator etc.


Previous Comments:


[2007-02-23 16:49:12] eric dot broersma at phil dot uu dot nl

Description:

A break within a foreach construct may cause an infinite loop when the
foreach construct is nested within another foreach construct, possibly
as a result of the internal array pointer of the array being foreach'ed
not being reset.

This problem did not occur in PHP 5.0.5, but did occur in PHP 5.2.1.

Reproduce code:
---
$w = array ( 0, 1 );

echo 'a';
foreach ( $w as $x ) {  
echo 'b' . $x;
foreach ( $w as $z ) {
echo 'c' . $z;
break 1;
}   
echo 'e' . $x;
}   
echo 'f';

Expected result:

ab0c0e0b1c0e1f


(Behaviour in PHP 5.0.5)

Actual result:
--
ab0c0e0b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0!
 
e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b...
(infinite loop)

(Behaviour in PHP 5.2.1)





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


#40490 [Bgs]: imagejpeg() returns page URL instead of image

2007-02-23 Thread php at rebby dot com
 ID:   40490
 User updated by:  php at rebby dot com
 Reported By:  php at rebby dot com
 Status:   Bogus
 Bug Type: GD related
 Operating System: Slackware Linux
 PHP Version:  5.2.1
 New Comment:

I found the problem. My issue was due to the removal of
--enable-memory-limit (From the changelog: "memory-limit is always
enabled (--enable-memory-limit removed)" combined with my script
requirements and my local configuration.

Prior to PHP 5.2.1 I did use the --enable-memory-limit configuration
variable however I had experimented with it thus my configuration had
the memory_limit set to 8M (I believe that this is/was the default in
the recommended configuration. I got this setting from a recommended
configuration file in a 4.x release). Since I was not using
--enable-memory-limit at compile time, this value was discarded. Now
that 5.2.1 uses --enable-memory-limit by default, this value is in full
effect.

With memory_limit enabled and set to value that is to small for my
requirements, running out of memory causes the script to crash at the
imagecreatefromjpeg() call. Unfortunately, since the script crashes
hard, no logging is performed to aid in troubleshooting.

This issue has pointed out a bug in the documentation however. On
http://www.php.net/manual/en/ini.core.php it is still noted:


In order to use this directive you must have enabled it at compile
time. So, your configure line would have included:
--enable-memory-limit.


As of 5.2.1 this is no longer the case since the --enable-memory-limit
was removed from the configure script and is now the default.

This little documentation oversight caused me to overlook the issue
with the value of memory_limit in my php.ini being to small in my
initial troubleshooting.


Previous Comments:


[2007-02-15 15:38:54] php at rebby dot com

Since the status was changed to "Bogus" and it was determined that this
was not a bug, I removed the code from my site this morning. Because
this is still being looked at, I restored the code in question to
http://rebby.com/images/email/image.txt

I will return my development system to 5.2.1 and continue to debug the
problem.



[2007-02-15 14:55:59] [EMAIL PROTECTED]

I cannot access your script (404).

But some tips:
- verify you don't add whitespaces before or after your  tags
- you don't echo something
- the right header has been sent

But nothing change in image[format] between 5.2.0 and 5.2.1.  Ask on
php-general if you fail to find the problem.




[2007-02-15 13:59:56] php at rebby dot com

Thank you for your assistance. I guess that I will just have to spend a
bit more time troubleshooting to figure out why this script broke
between 5.2.0 and 5.2.1.



[2007-02-15 08:58:41] [EMAIL PROTECTED]

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.





[2007-02-15 02:01:15] php at rebby dot com

Description:

A GD page which relies on imagejpeg(), among other functions, returns
the page URL rather than displaying the image. This script has worked
fine since early 4.x when it was developed. No errors of any kind are
output in my error log.

Reproduce code:
---
http://rebby.com/images/email/image.txt

Expected result:

The code above is included after loading a global configuration file.
The code pulls the location of a jpeg image on my filesystem, makes
some alterations (resizes the image and adds a URL tag), and should
output the image directly to the browser.

Actual result:
--
Instead of returning the image the URL of the image is returned
instead. For example, if you source this page at
http://rebby.com/image.php?i=123&s=4 the string
"http://rebby.com/image.php?i=123&s=4"; is displayed in the browser
instead of the desired image.





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


#40613 [NEW]: Abort during PHP request

2007-02-23 Thread jblaguarigue at worldonline dot fr
From: jblaguarigue at worldonline dot fr
Operating system: Windows XP
PHP version:  5.2.1
PHP Bug Type: *General Issues
Bug description:  Abort during PHP request

Description:

>From version 5.2.0 to 5.2.1 my website doesn't have the same functioning.

After investigations, the problem provides from a lot of array DOM
encapsulations. 
My site contains classes for HTML with a DOM structure and most of classes
are container type. This container is PHP array based. 
The php script in version 5.2.1 crashes during the script, the same script
(with the same data) good works under 5.2.0. 


Reproduce code:
---
abstract class Conteneur {
private $title;
protected $lstObj = array ();
protected $className;
protected $id;
protected $name;
abstract public function toHtml();
public function addObject($object) {
if (null != $object) {
array_push($this->lstObj, $object);
}
}
public function addObjects($objects){
foreach ($objects as $obj){
array_push($this->lstObj, $obj);
}
}
...


class Div extends Conteneur {
public function __construct($object = null, $className = null) {
$this->addObject($object);
$this->className = $className;
}
...

The crash provides during an addObject method call when adding an object
to the Div class. 

Expected result:

The complete DOM encapsulation

Actual result:
--
White page, the PHP crashes

-- 
Edit bug report at http://bugs.php.net/?id=40613&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40613&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40613&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40613&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40613&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=40613&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=40613&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=40613&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=40613&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=40613&r=support
Expected behavior:http://bugs.php.net/fix.php?id=40613&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=40613&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=40613&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40613&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40613&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40613&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=40613&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=40613&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40613&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=40613&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=40613&r=mysqlcfg


#40607 [Bgs->Csd]: mssql_fetch_array concatinates spaces in middle of data

2007-02-23 Thread Joe at sofusion dot com
 ID:   40607
 User updated by:  Joe at sofusion dot com
 Reported By:  Joe at sofusion dot com
-Status:   Bogus
+Status:   Closed
 Bug Type: MSSQL related
 Operating System: FREE BSD 6.0
 PHP Version:  5.2.1
 New Comment:

Thanks!!


Previous Comments:


[2007-02-23 20:40:48] [EMAIL PROTECTED]

This is a normal browser feature. The browser will reduce the
whitespace (spaces, tabs new lines etc) to a single space. You could
replace each space with   if you want to force two spaces.



[2007-02-23 20:16:24] Joe at sofusion dot com

When I use the  tags, It does display the correct data.  Is
this telling me that it is HTML that is concatinating the 2 spaces into
one?
Also you can use:
$Name = str_replace (' ', ':', $RT['Name']);
echo ' Name2 = '.$Name . '';
to see the 2 spaces.

When you duplicate the bug, do you have 2 spaces between the words in
your browser?
Thanks!!



[2007-02-23 19:29:07] [EMAIL PROTECTED]

I'm unable to reproduce this (on Linux and WIndows with FreeTDS). Try
viewing the result outside the browser, use  or get the
length of the column to verify that you are getting the right results.



[2007-02-23 16:18:14] Joe at sofusion dot com

Sorry, dont use # in TBL Name.  USE THIS DB CODE AND PHP CODE TO TEST:

CREATE TABLE T1( Name varchar(255),
Number int )
INSERT INTO T1 VALUES('Two  Spaces',1)
INSERT INTO T1 VALUES('One Spaces',2)



$sql = "SELECT Name FROM T1 WHERE Number = '1'";
$rs = mssql_query($sql);
while ($RT = mssql_fetch_array($rs)) 
{$Name= $RT['Name'];
//This should have 2 spaces in it like the DB
//But it only has one
echo ' Name = '.$Name . '';
}



[2007-02-23 15:59:40] Joe at sofusion dot com

Description:

When using mssql_fetch_arry and mssql_fetch_row, data returned that
contains 2 spaces has been concatinated to one space.  Example:
Data returned should be "Two"' '' '"Spaces" (without quotes  Two 
Spaces)
But is returned as "Two"' '"Spaces" (without quotes -Two Spaces with
one space between)

FreeBSD WEBSERVER1.SOFUSION.local 6.0-RELEASE FreeBSD 6.0-RELEASE #0:
Thu Nov 3 09:36:13 UTC 2005
[EMAIL PROTECTED]:/usr/obj/usr/src/sys/GENERIC i386  

Build Date  Feb 22 2007 19:36:38  

Configure Command  './configure'
'--with-apxs=/usr/local/apache/bin/apxs' '--enable-versioning'
'--with-mssql=/usr/local' '--enable-libxml'  

Library version  FreeTDS  



Reproduce code:
---
--MSSQL TABLE

CREATE TABLE #T1( Name varchar(255),
Number int )
INSERT INTO #T1 VALUES('Two  Spaces',1)
INSERT INTO #T1 VALUES('One Spaces',2)


--PHP CODE

$sql = "select Name FROM Name_TBL  WHERE Number = '1'";
$rs = mssql_query($sql);
$RT = mssql_fetch_array($rs);
$Name= $RT[Name'];
--This should have 2 spaces in it like the DB
--But it only has one
echo $Name




Expected result:

Two  Spaces
--This has 2 spaces between the words.

Actual result:
--
Two Spaces
--This only hase 1 space between the words





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


#40613 [Opn->Fbk]: Abort during PHP request

2007-02-23 Thread tony2001
 ID:   40613
 Updated by:   [EMAIL PROTECTED]
 Reported By:  jblaguarigue at worldonline dot fr
-Status:   Open
+Status:   Feedback
-Bug Type: *General Issues
+Bug Type: Unknown/Other Function
 Operating System: Windows XP
 PHP Version:  5.2.1
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.




Previous Comments:


[2007-02-23 21:01:32] jblaguarigue at worldonline dot fr

Description:

>From version 5.2.0 to 5.2.1 my website doesn't have the same
functioning. 
After investigations, the problem provides from a lot of array DOM
encapsulations. 
My site contains classes for HTML with a DOM structure and most of
classes are container type. This container is PHP array based. 
The php script in version 5.2.1 crashes during the script, the same
script (with the same data) good works under 5.2.0. 


Reproduce code:
---
abstract class Conteneur {
private $title;
protected $lstObj = array ();
protected $className;
protected $id;
protected $name;
abstract public function toHtml();
public function addObject($object) {
if (null != $object) {
array_push($this->lstObj, $object);
}
}
public function addObjects($objects){
foreach ($objects as $obj){
array_push($this->lstObj, $obj);
}
}
...


class Div extends Conteneur {
public function __construct($object = null, $className = null) {
$this->addObject($object);
$this->className = $className;
}
...

The crash provides during an addObject method call when adding an
object to the Div class. 

Expected result:

The complete DOM encapsulation

Actual result:
--
White page, the PHP crashes





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


#40607 [Csd->Bgs]: mssql_fetch_array concatinates spaces in middle of data

2007-02-23 Thread tony2001
 ID:   40607
 Updated by:   [EMAIL PROTECTED]
 Reported By:  Joe at sofusion dot com
-Status:   Closed
+Status:   Bogus
 Bug Type: MSSQL related
 Operating System: FREE BSD 6.0
 PHP Version:  5.2.1


Previous Comments:


[2007-02-23 21:01:54] Joe at sofusion dot com

Thanks!!



[2007-02-23 20:40:48] [EMAIL PROTECTED]

This is a normal browser feature. The browser will reduce the
whitespace (spaces, tabs new lines etc) to a single space. You could
replace each space with   if you want to force two spaces.



[2007-02-23 20:16:24] Joe at sofusion dot com

When I use the  tags, It does display the correct data.  Is
this telling me that it is HTML that is concatinating the 2 spaces into
one?
Also you can use:
$Name = str_replace (' ', ':', $RT['Name']);
echo ' Name2 = '.$Name . '';
to see the 2 spaces.

When you duplicate the bug, do you have 2 spaces between the words in
your browser?
Thanks!!



[2007-02-23 19:29:07] [EMAIL PROTECTED]

I'm unable to reproduce this (on Linux and WIndows with FreeTDS). Try
viewing the result outside the browser, use  or get the
length of the column to verify that you are getting the right results.



[2007-02-23 16:18:14] Joe at sofusion dot com

Sorry, dont use # in TBL Name.  USE THIS DB CODE AND PHP CODE TO TEST:

CREATE TABLE T1( Name varchar(255),
Number int )
INSERT INTO T1 VALUES('Two  Spaces',1)
INSERT INTO T1 VALUES('One Spaces',2)



$sql = "SELECT Name FROM T1 WHERE Number = '1'";
$rs = mssql_query($sql);
while ($RT = mssql_fetch_array($rs)) 
{$Name= $RT['Name'];
//This should have 2 spaces in it like the DB
//But it only has one
echo ' Name = '.$Name . '';
}



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/40607

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


#23022 [Com]: Supported dereferencing array indeces on arbitrary expressions

2007-02-23 Thread m_rayman at bigfoot dot com
 ID:   23022
 Comment by:   m_rayman at bigfoot dot com
 Reported By:  [EMAIL PROTECTED]
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: Any
 PHP Version:  5CVS-2003-04-02 (dev)
 New Comment:

doesn't fix the bug, but a workaround:

function array_val($array, $key) {
return $array[$key];
}

then you can do things like:

var_dump(array_val(array('a', 'b'), 1));


Previous Comments:


[2003-04-02 10:30:35] [EMAIL PROTECTED]

Supported dereferencing array indeces on arbitrary expressions.

Currently you can only dereference array indeces on variables
directly:

$a = array('a', 'b');
var_dump($a[1]);

but this does not work

var_dump(array('a', 'b')[1]);

neither does this:

function returnArray() {
return array('a', 'b');
}
var_dump(returnArray()[1]);

or this:

$value = ($ns == 'foo' ? $thisArray : $thatArray)[0];




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


#40616 [NEW]: uasort implementation is not robust

2007-02-23 Thread phpbugs at jessemccarthy dot net
From: phpbugs at jessemccarthy dot net
Operating system: Linux
PHP version:  5.2.1
PHP Bug Type: Arrays related
Bug description:  uasort implementation is not robust

Description:

I spent hours investigating why my script using uasort() was not producing
the expected results before finally discovering that the problem is due to
a bug / limitation in the uasort() implementation.

I don't know what's actually happening in the source code, but my theory
about the problem is that uasort() (or whatever underlying code) cuts
corners or tries to use a shortcut based on members that compare as
equal.

I *know* that "If two members compare as equal, their order in the sorted
array is undefined."  *However*, once uasort() has found certain members
to be equal, it seems to jump to conclusions based on that and doesn't go
on to compare other members to each other that need to be.

Say for example you have an array with 3 members, call them A, B, and C,
where the callback for uasort() would return
 0 for A compared to B
 0 for B compared to C
-1 for A compared to C

It seems that if uasort() compares A to B, and B to C and sees that they
are "equal", it never compares A to C, which are not equal.

I consider it a bug, and a major flaw, but I don't know for sure that
people familiar with the code don't intend for it to work that way.  Since
uasort() / usort() are billed as the solution for sorting by non-trivial
criteria, I really think that it should work more robustly and perform
more thorough processing in those situations.  If there is some reason it
can't be made to work that way, there should be a very noticeable warning
in the documentation about how limited its functionality is.

I encountered this issue in the course of real world development, trying
to tailor the order of output of form elements in Drupal based on its
weighting system.  The uasort() callback in my reproduce code is the
Drupal core code modified to sort members alphabetically if the assigned
weight values are equal.  Printing the values of the arguments in the
callback reveals that "A" and "C" (field_favorite_movies and
field_favorite_music) are never compared.

Reproduce code:
---
Source:
http://www.jessemccarthy.net/public/uasort_bug/reproduce_source.php

In action (with PHP 4.4.4., but the same behavior occurs on another server
with 5.2, where I originally encountered it):
http://www.jessemccarthy.net/public/uasort_bug/reproduce.php

Expected result:

I expect 'field_favorite_movies' to occur prior to 'field_favorite_music'
in the sorted array.  I expect 'monkey_wrench' to appear anywhere.

Actual result:
--
'field_favorite_music' occurs prior to 'field_favorite_movies'.  If
'monkey_wrench' is excluded from the original array, the order is correct
after sorting.

-- 
Edit bug report at http://bugs.php.net/?id=40616&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40616&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40616&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40616&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40616&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=40616&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=40616&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=40616&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=40616&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=40616&r=support
Expected behavior:http://bugs.php.net/fix.php?id=40616&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=40616&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=40616&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40616&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40616&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40616&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=40616&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=40616&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40616&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=40616&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=40616&r=mysqlcfg


#40616 [Opn->Fbk]: uasort implementation is not robust

2007-02-23 Thread tony2001
 ID:   40616
 Updated by:   [EMAIL PROTECTED]
 Reported By:  phpbugs at jessemccarthy dot net
-Status:   Open
+Status:   Feedback
 Bug Type: Arrays related
 Operating System: Linux
 PHP Version:  5.2.1
 New Comment:

Please provide a SHORT but complete reproduce code, so we won't have to
debug it.


Previous Comments:


[2007-02-23 23:13:39] phpbugs at jessemccarthy dot net

Description:

I spent hours investigating why my script using uasort() was not
producing the expected results before finally discovering that the
problem is due to a bug / limitation in the uasort() implementation.

I don't know what's actually happening in the source code, but my
theory about the problem is that uasort() (or whatever underlying code)
cuts corners or tries to use a shortcut based on members that compare as
equal.

I *know* that "If two members compare as equal, their order in the
sorted array is undefined."  *However*, once uasort() has found certain
members to be equal, it seems to jump to conclusions based on that and
doesn't go on to compare other members to each other that need to be.

Say for example you have an array with 3 members, call them A, B, and
C, where the callback for uasort() would return
 0 for A compared to B
 0 for B compared to C
-1 for A compared to C

It seems that if uasort() compares A to B, and B to C and sees that
they are "equal", it never compares A to C, which are not equal.

I consider it a bug, and a major flaw, but I don't know for sure that
people familiar with the code don't intend for it to work that way. 
Since uasort() / usort() are billed as the solution for sorting by
non-trivial criteria, I really think that it should work more robustly
and perform more thorough processing in those situations.  If there is
some reason it can't be made to work that way, there should be a very
noticeable warning in the documentation about how limited its
functionality is.

I encountered this issue in the course of real world development,
trying to tailor the order of output of form elements in Drupal based
on its weighting system.  The uasort() callback in my reproduce code is
the Drupal core code modified to sort members alphabetically if the
assigned weight values are equal.  Printing the values of the arguments
in the callback reveals that "A" and "C" (field_favorite_movies and
field_favorite_music) are never compared.

Reproduce code:
---
Source:
http://www.jessemccarthy.net/public/uasort_bug/reproduce_source.php

In action (with PHP 4.4.4., but the same behavior occurs on another
server with 5.2, where I originally encountered it):
http://www.jessemccarthy.net/public/uasort_bug/reproduce.php

Expected result:

I expect 'field_favorite_movies' to occur prior to
'field_favorite_music' in the sorted array.  I expect 'monkey_wrench'
to appear anywhere.

Actual result:
--
'field_favorite_music' occurs prior to 'field_favorite_movies'.  If
'monkey_wrench' is excluded from the original array, the order is
correct after sorting.





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


#40616 [Fbk]: uasort implementation is not robust

2007-02-23 Thread tony2001
 ID:   40616
 Updated by:   [EMAIL PROTECTED]
 Reported By:  phpbugs at jessemccarthy dot net
 Status:   Feedback
 Bug Type: Arrays related
 Operating System: Linux
 PHP Version:  5.2.1
 New Comment:

And don't forget actual and expected output.


Previous Comments:


[2007-02-23 23:19:04] [EMAIL PROTECTED]

Please provide a SHORT but complete reproduce code, so we won't have to
debug it.



[2007-02-23 23:13:39] phpbugs at jessemccarthy dot net

Description:

I spent hours investigating why my script using uasort() was not
producing the expected results before finally discovering that the
problem is due to a bug / limitation in the uasort() implementation.

I don't know what's actually happening in the source code, but my
theory about the problem is that uasort() (or whatever underlying code)
cuts corners or tries to use a shortcut based on members that compare as
equal.

I *know* that "If two members compare as equal, their order in the
sorted array is undefined."  *However*, once uasort() has found certain
members to be equal, it seems to jump to conclusions based on that and
doesn't go on to compare other members to each other that need to be.

Say for example you have an array with 3 members, call them A, B, and
C, where the callback for uasort() would return
 0 for A compared to B
 0 for B compared to C
-1 for A compared to C

It seems that if uasort() compares A to B, and B to C and sees that
they are "equal", it never compares A to C, which are not equal.

I consider it a bug, and a major flaw, but I don't know for sure that
people familiar with the code don't intend for it to work that way. 
Since uasort() / usort() are billed as the solution for sorting by
non-trivial criteria, I really think that it should work more robustly
and perform more thorough processing in those situations.  If there is
some reason it can't be made to work that way, there should be a very
noticeable warning in the documentation about how limited its
functionality is.

I encountered this issue in the course of real world development,
trying to tailor the order of output of form elements in Drupal based
on its weighting system.  The uasort() callback in my reproduce code is
the Drupal core code modified to sort members alphabetically if the
assigned weight values are equal.  Printing the values of the arguments
in the callback reveals that "A" and "C" (field_favorite_movies and
field_favorite_music) are never compared.

Reproduce code:
---
Source:
http://www.jessemccarthy.net/public/uasort_bug/reproduce_source.php

In action (with PHP 4.4.4., but the same behavior occurs on another
server with 5.2, where I originally encountered it):
http://www.jessemccarthy.net/public/uasort_bug/reproduce.php

Expected result:

I expect 'field_favorite_movies' to occur prior to
'field_favorite_music' in the sorted array.  I expect 'monkey_wrench'
to appear anywhere.

Actual result:
--
'field_favorite_music' occurs prior to 'field_favorite_movies'.  If
'monkey_wrench' is excluded from the original array, the order is
correct after sorting.





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


#40604 [Bgs->Opn]: Objects disappear from the global scope

2007-02-23 Thread dagdamor at simps dot ru
 ID:   40604
 User updated by:  dagdamor at simps dot ru
 Reported By:  dagdamor at simps dot ru
-Status:   Bogus
+Status:   Open
 Bug Type: Class/Object related
 Operating System: Windows
 PHP Version:  5.2.1
 New Comment:

I didn't understand your reply at all :( could you please provide a bit
more explanatory response?

I see that the object gets destroyed before the script ends its work
(since it's inaccessible in the provided example), but I don't
understand why it's expected behavior... I never destroyed that object
manually, and created it expecting it to work till the very end of
script.


Previous Comments:


[2007-02-23 09:04:55] [EMAIL PROTECTED]

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

the object gets destroyed before you get output - well actually you
don\'t produce output



[2007-02-23 08:49:07] dagdamor at simps dot ru

Description:

Objects seem to disappear from the global scope when you try to access
them from the output buffer callback function. Regular variables (i.e.
not objects) don't disappear and work alright.

After some additional research I've noticed that if your PHP program
has many objects in the global scope, some of them don't disappear,
while others do. Looks very strange...

I hope this is not documentation misinterpretation, because I used
global variables, objects including in OB callbacks in PHP4, and it
worked fine. In other words, I hope this is not "You can't use global
variables there" case.

Reproduce code:
---


Expected result:

OK

Actual result:
--
Error





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


#40610 [Bgs->Opn]: Array changes when missing array element is ref'd (w/ no assignment to array!)

2007-02-23 Thread Webbed dot Pete at gmail dot com
 ID:   40610
 User updated by:  Webbed dot Pete at gmail dot com
-Summary:  Side effect of passing array element by reference
 Reported By:  Webbed dot Pete at gmail dot com
-Status:   Bogus
+Status:   Open
 Bug Type: Arrays related
 Operating System: Windows, Linux
 PHP Version:  5.2.1
 New Comment:

I have double and triple checked the documentation...
http://us3.php.net/manual/en/language.references.whatdo.php
...tells us that
<<
it means that $a and $b point to the same content. Note: $a and $b are
completely equal here, that's not $a is pointing to $b or vice versa,
that's $a and $b pointing to the same place.>>>

This works as far as it goes. What's left unsaid is that if $b is a
missing array key, the unset key will be created and the $b array will
grow. 

Neither 'array' nor 'references' documentation specify this behavior.
They don't say whether or not array elements are created willy-nilly
when an array reference exists.

I find nothing in the reference manual that either specifies nor
suggests this behavior is intentional. I do find several user comments
about this bug. It's just never been reported as a bug before.

The impact is that we cannot trust the keys of an array.

If this is declared as missing documentation, we will have to live with
the bug.

I'd prefer to see it eventually fixed; php will be better for it.


Previous Comments:


[2007-02-23 20:13:24] [EMAIL PROTECTED]

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





[2007-02-23 19:01:44] Webbed dot Pete at gmail dot com

Even simpler:
 $x=&$aEmpty['wheat'];

Adds element 'wheat' to the array.

This creates a nasty side effect for a couple of valuable and common
functions, which basically extend isset() for default values and so
forth:

function varset(&$val,$default='') {
if (isset($val)) return $val;
return $default;
}
function varsettrue(&$val,$default='') {
if (isset($val) && $val) return $val;
return $default;
}

$myVal = varset($pref['maxsize'],1000); // set myVal to pref or
default

NOTE: all of the following leave $aEmpty alone. I understand why this
might be the case, yet it still is wrong to break references IMHO, not
least because of losing ability to create functions like those above.
  $aEmpty['wheat']; // simple reference
  isset($aEmpty['wheat']); // built-in function
  myFunc($aEmpty['wheat']); // pass-by-value to user func



[2007-02-23 17:59:06] Webbed dot Pete at gmail dot com

Description:

Pass an unset array element by reference, without doing anything at
all.

The passed array will gain an element.

(Note: We use isset() in our real function, which is what pointed us to
the bug, but it is not necessary for demoing the defect.)

Reproduce code:
---
BEFORE\n";
echo "aEmpty contains ".count($aEmpty)." element(s)\n",print_r(
$aEmpty, TRUE ); echo "aOne contains ".count($aOne)."
element(s)\n",print_r( $aOne, TRUE );

// Pass by reference modifies the arrays. (we use with 'isset()' and
saw this; I've reduced to basic issue.)

$aEmpty = array();$aOne = array( 'corn' );
refTest( $aEmpty['wheat'] ); refTest( $aOne['wheat'] );

echo "\nAFTER PASS BY REFERENCE\n";
echo "aEmpty contains ".count($aEmpty)." element(s)\n",print_r(
$aEmpty, TRUE ); echo "aOne contains ".count($aOne)."
element(s)\n",print_r( $aOne, TRUE );

?>


Expected result:

BEFORE
aEmpty contains 0 element(s)
Array
(
)
aOne contains 1 element(s)
Array
(
[0] => corn
)


[Same if you directly reference, or use isset() outside of a function,
etc etc]
[If you don't pass by reference you get notice error so that is not a
solution]

Actual result:
--
AFTER PASS BY REFERENCE
aEmpty contains 1 element(s)
Array
(
[wheat] => 
)
aOne contains 2 element(s)
Array
(
[0] => corn
[wheat] => 
)





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


#40616 [Fbk->Opn]: uasort implementation is not robust

2007-02-23 Thread phpbugs at jessemccarthy dot net
 ID:   40616
 User updated by:  phpbugs at jessemccarthy dot net
 Reported By:  phpbugs at jessemccarthy dot net
-Status:   Feedback
+Status:   Open
 Bug Type: Arrays related
 Operating System: Linux
 PHP Version:  5.2.1
 New Comment:

Thanks for your quick response.  The reproduce code is too long?  The
descriptions of actual and expected output are not sufficient?


Previous Comments:


[2007-02-23 23:20:42] [EMAIL PROTECTED]

And don't forget actual and expected output.



[2007-02-23 23:19:04] [EMAIL PROTECTED]

Please provide a SHORT but complete reproduce code, so we won't have to
debug it.



[2007-02-23 23:13:39] phpbugs at jessemccarthy dot net

Description:

I spent hours investigating why my script using uasort() was not
producing the expected results before finally discovering that the
problem is due to a bug / limitation in the uasort() implementation.

I don't know what's actually happening in the source code, but my
theory about the problem is that uasort() (or whatever underlying code)
cuts corners or tries to use a shortcut based on members that compare as
equal.

I *know* that "If two members compare as equal, their order in the
sorted array is undefined."  *However*, once uasort() has found certain
members to be equal, it seems to jump to conclusions based on that and
doesn't go on to compare other members to each other that need to be.

Say for example you have an array with 3 members, call them A, B, and
C, where the callback for uasort() would return
 0 for A compared to B
 0 for B compared to C
-1 for A compared to C

It seems that if uasort() compares A to B, and B to C and sees that
they are "equal", it never compares A to C, which are not equal.

I consider it a bug, and a major flaw, but I don't know for sure that
people familiar with the code don't intend for it to work that way. 
Since uasort() / usort() are billed as the solution for sorting by
non-trivial criteria, I really think that it should work more robustly
and perform more thorough processing in those situations.  If there is
some reason it can't be made to work that way, there should be a very
noticeable warning in the documentation about how limited its
functionality is.

I encountered this issue in the course of real world development,
trying to tailor the order of output of form elements in Drupal based
on its weighting system.  The uasort() callback in my reproduce code is
the Drupal core code modified to sort members alphabetically if the
assigned weight values are equal.  Printing the values of the arguments
in the callback reveals that "A" and "C" (field_favorite_movies and
field_favorite_music) are never compared.

Reproduce code:
---
Source:
http://www.jessemccarthy.net/public/uasort_bug/reproduce_source.php

In action (with PHP 4.4.4., but the same behavior occurs on another
server with 5.2, where I originally encountered it):
http://www.jessemccarthy.net/public/uasort_bug/reproduce.php

Expected result:

I expect 'field_favorite_movies' to occur prior to
'field_favorite_music' in the sorted array.  I expect 'monkey_wrench'
to appear anywhere.

Actual result:
--
'field_favorite_music' occurs prior to 'field_favorite_movies'.  If
'monkey_wrench' is excluded from the original array, the order is
correct after sorting.





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


#40604 [Opn->Bgs]: Objects disappear from the global scope

2007-02-23 Thread tony2001
 ID:   40604
 Updated by:   [EMAIL PROTECTED]
 Reported By:  dagdamor at simps dot ru
-Status:   Open
+Status:   Bogus
 Bug Type: Class/Object related
 Operating System: Windows
 PHP Version:  5.2.1
 New Comment:

All objects are destroyed _before_ output callbacks are called.


Previous Comments:


[2007-02-23 23:26:59] dagdamor at simps dot ru

I didn't understand your reply at all :( could you please provide a bit
more explanatory response?

I see that the object gets destroyed before the script ends its work
(since it's inaccessible in the provided example), but I don't
understand why it's expected behavior... I never destroyed that object
manually, and created it expecting it to work till the very end of
script.



[2007-02-23 09:04:55] [EMAIL PROTECTED]

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

the object gets destroyed before you get output - well actually you
don\'t produce output



[2007-02-23 08:49:07] dagdamor at simps dot ru

Description:

Objects seem to disappear from the global scope when you try to access
them from the output buffer callback function. Regular variables (i.e.
not objects) don't disappear and work alright.

After some additional research I've noticed that if your PHP program
has many objects in the global scope, some of them don't disappear,
while others do. Looks very strange...

I hope this is not documentation misinterpretation, because I used
global variables, objects including in OB callbacks in PHP4, and it
worked fine. In other words, I hope this is not "You can't use global
variables there" case.

Reproduce code:
---


Expected result:

OK

Actual result:
--
Error





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


#40615 [Opn->Bgs]: session_start() kills link resource variable

2007-02-23 Thread johannes
 ID:   40615
 Updated by:   [EMAIL PROTECTED]
 Reported By:  jan dot morten dot sorensen at organizer dot net
-Status:   Open
+Status:   Bogus
 Bug Type: Unknown/Other Function
 Operating System: Win2K
 PHP Version:  5.2.1
 New Comment:

I guess you have register_globals enabled and a session variable
overwriting your local variable. Except for that please report only
bugs related to the latest version of PHP


Previous Comments:


[2007-02-23 23:08:02] jan dot morten dot sorensen at organizer dot net

Description:

I have version 5.1.2. THIS MIGHT HAVE BEEN FIXED IN 5.2.1!!!

First use mysql_connect() on an included file and return the resource
identifier and store this in a variable.
Then call session_start()
Now you have lost your resource identifier!
Calling session_start() first fixes the problem.

Reproduce code:
---
file1.php
function connect_to_db() {
  $link = mysql_connect($host, $user, $pass) or die(err_msg);
  mysql_select_db($db) or die(err_msg);
  return $link;
}
file2.php
include 'file1.php';
$link = connect_to_db();
echo $link;
session_start();
echo $link;

Expected result:

link resource id# ?
link resource id# ?

replace ? with a number

Actual result:
--
link resource id# ?
0





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


#40604 [Bgs]: Objects disappear from the global scope

2007-02-23 Thread dagdamor at simps dot ru
 ID:   40604
 User updated by:  dagdamor at simps dot ru
 Reported By:  dagdamor at simps dot ru
 Status:   Bogus
 Bug Type: Class/Object related
 Operating System: Windows
 PHP Version:  5.2.1
 New Comment:

Okay... I understand.

But since it's not obvious and is a BC break, maybe it makes sense to
write about the issue in the documentation? (For example, in the Output
Control section.) I don't want anyone else to stand on the same rake.


Previous Comments:


[2007-02-23 23:33:43] [EMAIL PROTECTED]

All objects are destroyed _before_ output callbacks are called.



[2007-02-23 23:26:59] dagdamor at simps dot ru

I didn't understand your reply at all :( could you please provide a bit
more explanatory response?

I see that the object gets destroyed before the script ends its work
(since it's inaccessible in the provided example), but I don't
understand why it's expected behavior... I never destroyed that object
manually, and created it expecting it to work till the very end of
script.



[2007-02-23 09:04:55] [EMAIL PROTECTED]

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

the object gets destroyed before you get output - well actually you
don\'t produce output



[2007-02-23 08:49:07] dagdamor at simps dot ru

Description:

Objects seem to disappear from the global scope when you try to access
them from the output buffer callback function. Regular variables (i.e.
not objects) don't disappear and work alright.

After some additional research I've noticed that if your PHP program
has many objects in the global scope, some of them don't disappear,
while others do. Looks very strange...

I hope this is not documentation misinterpretation, because I used
global variables, objects including in OB callbacks in PHP4, and it
worked fine. In other words, I hope this is not "You can't use global
variables there" case.

Reproduce code:
---


Expected result:

OK

Actual result:
--
Error





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


#40616 [Opn->Fbk]: uasort implementation is not robust

2007-02-23 Thread tony2001
 ID:   40616
 Updated by:   [EMAIL PROTECTED]
 Reported By:  phpbugs at jessemccarthy dot net
-Status:   Open
+Status:   Feedback
 Bug Type: Arrays related
 Operating System: Linux
 PHP Version:  5.2.1
 New Comment:

>The reproduce code is too long?  
Yes, please remove everything not related to your problem.

>The descriptions of actual and expected output are not >sufficient?

Descriptions? No, descriptions are not enough, we need the results, not
their descriptions.


Previous Comments:


[2007-02-23 23:30:33] phpbugs at jessemccarthy dot net

Thanks for your quick response.  The reproduce code is too long?  The
descriptions of actual and expected output are not sufficient?



[2007-02-23 23:20:42] [EMAIL PROTECTED]

And don't forget actual and expected output.



[2007-02-23 23:19:04] [EMAIL PROTECTED]

Please provide a SHORT but complete reproduce code, so we won't have to
debug it.



[2007-02-23 23:13:39] phpbugs at jessemccarthy dot net

Description:

I spent hours investigating why my script using uasort() was not
producing the expected results before finally discovering that the
problem is due to a bug / limitation in the uasort() implementation.

I don't know what's actually happening in the source code, but my
theory about the problem is that uasort() (or whatever underlying code)
cuts corners or tries to use a shortcut based on members that compare as
equal.

I *know* that "If two members compare as equal, their order in the
sorted array is undefined."  *However*, once uasort() has found certain
members to be equal, it seems to jump to conclusions based on that and
doesn't go on to compare other members to each other that need to be.

Say for example you have an array with 3 members, call them A, B, and
C, where the callback for uasort() would return
 0 for A compared to B
 0 for B compared to C
-1 for A compared to C

It seems that if uasort() compares A to B, and B to C and sees that
they are "equal", it never compares A to C, which are not equal.

I consider it a bug, and a major flaw, but I don't know for sure that
people familiar with the code don't intend for it to work that way. 
Since uasort() / usort() are billed as the solution for sorting by
non-trivial criteria, I really think that it should work more robustly
and perform more thorough processing in those situations.  If there is
some reason it can't be made to work that way, there should be a very
noticeable warning in the documentation about how limited its
functionality is.

I encountered this issue in the course of real world development,
trying to tailor the order of output of form elements in Drupal based
on its weighting system.  The uasort() callback in my reproduce code is
the Drupal core code modified to sort members alphabetically if the
assigned weight values are equal.  Printing the values of the arguments
in the callback reveals that "A" and "C" (field_favorite_movies and
field_favorite_music) are never compared.

Reproduce code:
---
Source:
http://www.jessemccarthy.net/public/uasort_bug/reproduce_source.php

In action (with PHP 4.4.4., but the same behavior occurs on another
server with 5.2, where I originally encountered it):
http://www.jessemccarthy.net/public/uasort_bug/reproduce.php

Expected result:

I expect 'field_favorite_movies' to occur prior to
'field_favorite_music' in the sorted array.  I expect 'monkey_wrench'
to appear anywhere.

Actual result:
--
'field_favorite_music' occurs prior to 'field_favorite_movies'.  If
'monkey_wrench' is excluded from the original array, the order is
correct after sorting.





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


#40615 [NEW]: session_start() kills link resource variable

2007-02-23 Thread jan dot morten dot sorensen at organizer dot net
From: jan dot morten dot sorensen at organizer dot net
Operating system: Win2K
PHP version:  5.2.1
PHP Bug Type: Unknown/Other Function
Bug description:  session_start() kills link resource variable

Description:

I have version 5.1.2. THIS MIGHT HAVE BEEN FIXED IN 5.2.1!!!

First use mysql_connect() on an included file and return the resource
identifier and store this in a variable.
Then call session_start()
Now you have lost your resource identifier!
Calling session_start() first fixes the problem.

Reproduce code:
---
file1.php
function connect_to_db() {
  $link = mysql_connect($host, $user, $pass) or die(err_msg);
  mysql_select_db($db) or die(err_msg);
  return $link;
}
file2.php
include 'file1.php';
$link = connect_to_db();
echo $link;
session_start();
echo $link;

Expected result:

link resource id# ?
link resource id# ?

replace ? with a number

Actual result:
--
link resource id# ?
0

-- 
Edit bug report at http://bugs.php.net/?id=40615&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40615&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40615&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40615&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40615&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=40615&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=40615&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=40615&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=40615&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=40615&r=support
Expected behavior:http://bugs.php.net/fix.php?id=40615&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=40615&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=40615&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40615&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40615&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40615&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=40615&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=40615&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40615&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=40615&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=40615&r=mysqlcfg


#40600 [Asn->Bgs]: [PATCH]:getgrgid_r, getgrnam_r etc functions regression(crash)

2007-02-23 Thread iliaa
 ID:   40600
 Updated by:   [EMAIL PROTECTED]
 Reported By:  stas at FreeBSD dot org
-Status:   Assigned
+Status:   Bogus
 Bug Type: POSIX related
 Operating System: FreeBSD
 PHP Version:  5.2.1
 Assigned To:  iliaa
 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

The current code is fine, we should not hardcode buffer sizes 
if they cannot be retrieved, this could lead to exploitable 
situations. Also if the return buffer length of 0 it probably 
indicates a problem. 


Previous Comments:


[2007-02-23 14:07:38] [EMAIL PROTECTED]

Ilia, please take a look at this, IIRC you added those sysconf()
patches.



[2007-02-23 13:55:02] [EMAIL PROTECTED]

>Yeah... According to susv3:
Yes, I know that, thanks.
But that does not mean "if (buflen < 1)" is incorrect.
I don't think that zero buflen is a correct value (and even if it is,
it's useless).



[2007-02-23 13:47:59] stas at FreeBSD dot org

>>This patch covers two problems:
>>1) The POSIX says that sysconf will return -1 on failure,
>> thus the ( < check is definitely incorrect
>
>Oh? Care to elaborate?

Yeah... According to susv3:
"If name is an invalid value, sysconf() shall return -1 and set errno
to indicate the error. If the variable corresponding to name has no
limit, sysconf() shall return -1 without changing the value of errno.
Note that indefinite limits do not imply infinite limits; see
."

>>2) It's safe to use the buffer of any size (according to
>> POSIX), since you give the buffer length to these
>> functions. 
>
>Yeah, according to POSIX those functions must be >implemented.
>But they are not.

>it's better then give up on retriving this info just in
>case the sysconf doesn't has these limit values.

>I don't think it's any better to use hacks to workaround >missing
FreeBSD
> functionality.

Ok, agree. It's open to you.



[2007-02-23 12:22:20] [EMAIL PROTECTED]

>This patch covers two problems:
>1) The POSIX says that sysconf will return -1 on failure,
> thus the ( < check is definitely incorrect

Oh? Care to elaborate?

>2) It's safe to use the buffer of any size (according to
> POSIX), since you give the buffer length to these
> functions. 

Yeah, according to POSIX those functions must be implemented.
But they are not.

>it's better then give up on retriving this info just in
>case the sysconf doesn't has these limit values.

I don't think it's any better to use hacks to workaround missing
FreeBSD functionality.




[2007-02-23 10:47:13] stas at FreeBSD dot org

-   if (buflen < 1) {
-   RETURN_FALSE;
-   }
+   if (buflen < 0)
+   buflen = 1024;

>It might be safe to do it on FreeBSD when you know for sure >that this
functionality is missing and it's safe to use 1K >buffer, but other
systems might behave differently.

This patch covers two problems:
1) The POSIX says that sysconf will return -1 on failure, thus the ( <
1) check is definitely incorrect
2) It's safe to use the buffer of any size (according to POSIX), since
you give the buffer length to these functions. They'll return error if
the buffer lenght isn't enough - it's better then give up on retriving
this info just in case the sysconf doesn't has these limit values.



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/40600

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


#40604 [Bgs]: Objects disappear from the global scope

2007-02-23 Thread tony2001
 ID:   40604
 Updated by:   [EMAIL PROTECTED]
 Reported By:  dagdamor at simps dot ru
 Status:   Bogus
 Bug Type: Class/Object related
 Operating System: Windows
 PHP Version:  5.2.1
 New Comment:

>But since it's not obvious and is a BC break

BC break? This behaviour exists at least since 5.1.0.
And this can't be a BC break comparing to PHP4, for classes in PHP4 do
not have any destructors.

>maybe it makes sense to write about the issue in the documentation? 

Probably. 
I'm sure the documentation team would appreciate any help.


Previous Comments:


[2007-02-23 23:46:42] dagdamor at simps dot ru

Okay... I understand.

But since it's not obvious and is a BC break, maybe it makes sense to
write about the issue in the documentation? (For example, in the Output
Control section.) I don't want anyone else to stand on the same rake.



[2007-02-23 23:33:43] [EMAIL PROTECTED]

All objects are destroyed _before_ output callbacks are called.



[2007-02-23 23:26:59] dagdamor at simps dot ru

I didn't understand your reply at all :( could you please provide a bit
more explanatory response?

I see that the object gets destroyed before the script ends its work
(since it's inaccessible in the provided example), but I don't
understand why it's expected behavior... I never destroyed that object
manually, and created it expecting it to work till the very end of
script.



[2007-02-23 09:04:55] [EMAIL PROTECTED]

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

the object gets destroyed before you get output - well actually you
don\'t produce output



[2007-02-23 08:49:07] dagdamor at simps dot ru

Description:

Objects seem to disappear from the global scope when you try to access
them from the output buffer callback function. Regular variables (i.e.
not objects) don't disappear and work alright.

After some additional research I've noticed that if your PHP program
has many objects in the global scope, some of them don't disappear,
while others do. Looks very strange...

I hope this is not documentation misinterpretation, because I used
global variables, objects including in OB callbacks in PHP4, and it
worked fine. In other words, I hope this is not "You can't use global
variables there" case.

Reproduce code:
---


Expected result:

OK

Actual result:
--
Error





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


#40616 [Fbk->Opn]: uasort implementation is not robust

2007-02-23 Thread phpbugs at jessemccarthy dot net
 ID:   40616
 User updated by:  phpbugs at jessemccarthy dot net
 Reported By:  phpbugs at jessemccarthy dot net
-Status:   Feedback
+Status:   Open
 Bug Type: Arrays related
 Operating System: Linux
 PHP Version:  5.2.1
 New Comment:

Well I apologize.  Thanks for your feedback.

Short reproduce code:
http://www.jessemccarthy.net/public/uasort_bug/short_reproduce_source.php

Expected result:
array(3) {
  ["field_favorite_movies"]=>
  array(1) {
["title"]=>
string(15) "Favorite movies"
  }
  ["monkey_wrench"]=>
  string(0) ""
  ["field_favorite_music"]=>
  array(1) {
["title"]=>
string(14) "Favorite music"
  }
}


Actual result:
array(3) {
  ["field_favorite_music"]=>
  array(1) {
["title"]=>
string(14) "Favorite music"
  }
  ["monkey_wrench"]=>
  string(0) ""
  ["field_favorite_movies"]=>
  array(1) {
["title"]=>
string(15) "Favorite movies"
  }
}

I would think that an English description of expected / actual results
would be helpful rather than just raw output, but whatever works for
you.  I also can't help but feel that the original reproduce code made
more sense, but this is the most minimal version I can create that
still demonstrates anything.

Thanks for your attention.


Previous Comments:


[2007-02-23 23:36:10] [EMAIL PROTECTED]

>The reproduce code is too long?  
Yes, please remove everything not related to your problem.

>The descriptions of actual and expected output are not >sufficient?

Descriptions? No, descriptions are not enough, we need the results, not
their descriptions.



[2007-02-23 23:30:33] phpbugs at jessemccarthy dot net

Thanks for your quick response.  The reproduce code is too long?  The
descriptions of actual and expected output are not sufficient?



[2007-02-23 23:20:42] [EMAIL PROTECTED]

And don't forget actual and expected output.



[2007-02-23 23:19:04] [EMAIL PROTECTED]

Please provide a SHORT but complete reproduce code, so we won't have to
debug it.



[2007-02-23 23:13:39] phpbugs at jessemccarthy dot net

Description:

I spent hours investigating why my script using uasort() was not
producing the expected results before finally discovering that the
problem is due to a bug / limitation in the uasort() implementation.

I don't know what's actually happening in the source code, but my
theory about the problem is that uasort() (or whatever underlying code)
cuts corners or tries to use a shortcut based on members that compare as
equal.

I *know* that "If two members compare as equal, their order in the
sorted array is undefined."  *However*, once uasort() has found certain
members to be equal, it seems to jump to conclusions based on that and
doesn't go on to compare other members to each other that need to be.

Say for example you have an array with 3 members, call them A, B, and
C, where the callback for uasort() would return
 0 for A compared to B
 0 for B compared to C
-1 for A compared to C

It seems that if uasort() compares A to B, and B to C and sees that
they are "equal", it never compares A to C, which are not equal.

I consider it a bug, and a major flaw, but I don't know for sure that
people familiar with the code don't intend for it to work that way. 
Since uasort() / usort() are billed as the solution for sorting by
non-trivial criteria, I really think that it should work more robustly
and perform more thorough processing in those situations.  If there is
some reason it can't be made to work that way, there should be a very
noticeable warning in the documentation about how limited its
functionality is.

I encountered this issue in the course of real world development,
trying to tailor the order of output of form elements in Drupal based
on its weighting system.  The uasort() callback in my reproduce code is
the Drupal core code modified to sort members alphabetically if the
assigned weight values are equal.  Printing the values of the arguments
in the callback reveals that "A" and "C" (field_favorite_movies and
field_favorite_music) are never compared.

Reproduce code:
---
Source:
http://www.jessemccarthy.net/public/uasort_bug/reproduce_source.php

In action (with PHP 4.4.4., but the same behavior occurs on another
server with 5.2, where I originally encountered it):
http://www.jessemccarthy.net/public/uasort_bug/reproduce.php

Expected result:

I expect 'field_favorite_movies' to occur prior to
'field_favorite_music' in the sorted array.  I expect 'monkey_wrench'
to appear anywhere.

Actual result:
--
'field_favorite_music' occurs prior to 'field_favorite_movies'.  If
'monk

#40616 [Opn]: uasort implementation is not robust

2007-02-23 Thread phpbugs at jessemccarthy dot net
 ID:   40616
 User updated by:  phpbugs at jessemccarthy dot net
 Reported By:  phpbugs at jessemccarthy dot net
 Status:   Open
 Bug Type: Arrays related
 Operating System: Linux
 PHP Version:  5.2.1
 New Comment:

This software broke the line with the URL to the short reproduce code.

http://www.jessemccarthy.net/public/uasort_bug/s_reproduce_source.php


Previous Comments:


[2007-02-24 01:03:54] phpbugs at jessemccarthy dot net

Well I apologize.  Thanks for your feedback.

Short reproduce code:
http://www.jessemccarthy.net/public/uasort_bug/short_reproduce_source.php

Expected result:
array(3) {
  ["field_favorite_movies"]=>
  array(1) {
["title"]=>
string(15) "Favorite movies"
  }
  ["monkey_wrench"]=>
  string(0) ""
  ["field_favorite_music"]=>
  array(1) {
["title"]=>
string(14) "Favorite music"
  }
}


Actual result:
array(3) {
  ["field_favorite_music"]=>
  array(1) {
["title"]=>
string(14) "Favorite music"
  }
  ["monkey_wrench"]=>
  string(0) ""
  ["field_favorite_movies"]=>
  array(1) {
["title"]=>
string(15) "Favorite movies"
  }
}

I would think that an English description of expected / actual results
would be helpful rather than just raw output, but whatever works for
you.  I also can't help but feel that the original reproduce code made
more sense, but this is the most minimal version I can create that
still demonstrates anything.

Thanks for your attention.



[2007-02-23 23:36:10] [EMAIL PROTECTED]

>The reproduce code is too long?  
Yes, please remove everything not related to your problem.

>The descriptions of actual and expected output are not >sufficient?

Descriptions? No, descriptions are not enough, we need the results, not
their descriptions.



[2007-02-23 23:30:33] phpbugs at jessemccarthy dot net

Thanks for your quick response.  The reproduce code is too long?  The
descriptions of actual and expected output are not sufficient?



[2007-02-23 23:20:42] [EMAIL PROTECTED]

And don't forget actual and expected output.



[2007-02-23 23:19:04] [EMAIL PROTECTED]

Please provide a SHORT but complete reproduce code, so we won't have to
debug it.



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

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


#40617 [NEW]: memory corruption

2007-02-23 Thread slacouette at edma dot com
From: slacouette at edma dot com
Operating system: linux (FC6)
PHP version:  5.2.1
PHP Bug Type: Strings related
Bug description:  memory corruption

Description:

Repeated calls to str_ireplace appear to cause memory corruption if
replacement is made. In my web application, the resulting string will
"echo" fine but html page generated in subsequent class module is never
served.  str_replace works fine.  Code working fine until upgrade to
5.2.1.

Thanks - great stuff you guys do!

Reproduce code:
---
$str_s = str_replace( array('(t)', '(tm)',   '™', chr(153)),  '
(trade marked)',$str_s );

$str_s = str_replace( array('(r)', '(reg)',  '®',   chr(174)),  '
(registered)',  $str_s );

$str_s = str_replace( array('(c)', '(copy)', '©',  chr(169)),  '
(copyrighted)', $str_s );


Expected result:

proper substitution and web page served

Actual result:
--
guessing memory corruption as html never generated.

-- 
Edit bug report at http://bugs.php.net/?id=40617&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40617&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40617&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40617&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40617&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=40617&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=40617&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=40617&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=40617&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=40617&r=support
Expected behavior:http://bugs.php.net/fix.php?id=40617&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=40617&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=40617&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40617&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40617&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40617&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=40617&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=40617&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40617&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=40617&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=40617&r=mysqlcfg


#40617 [Opn->Csd]: memory corruption

2007-02-23 Thread nevermind at address dot org
 ID:   40617
 User updated by:  nevermind at address dot org
-Reported By:  slacouette at edma dot com
+Reported By:  nevermind at address dot org
-Status:   Open
+Status:   Closed
 Bug Type: Strings related
 Operating System: linux (FC6)
 PHP Version:  5.2.1
 New Comment:

Likely this is too obscure to find with what I've provided.


Previous Comments:


[2007-02-24 01:55:22] nevermind at address dot org

Description:

Repeated calls to str_ireplace appear to cause memory corruption if
replacement is made. In my web application, the resulting string will
"echo" fine but html page generated in subsequent class module is never
served.  str_replace works fine.  Code working fine until upgrade to
5.2.1.

Thanks - great stuff you guys do!

Reproduce code:
---
$str_s = str_replace( array('(t)', '(tm)',   '™', chr(153)),  '
(trade marked)',$str_s );

$str_s = str_replace( array('(r)', '(reg)',  '®',   chr(174)),  '
(registered)',  $str_s );

$str_s = str_replace( array('(c)', '(copy)', '©',  chr(169)),  '
(copyrighted)', $str_s );


Expected result:

proper substitution and web page served

Actual result:
--
guessing memory corruption as html never generated.





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


#40417 [Opn->Bgs]: Suddenly binding as many vars as there are *identical* prepared tokens

2007-02-23 Thread iliaa
 ID:   40417
 Updated by:   [EMAIL PROTECTED]
 Reported By:  exaton at free dot fr
-Status:   Open
+Status:   Bogus
 Bug Type: PDO related
 Operating System: Windows XP Pro SP2
 PHP Version:  5.2.1
 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

.


Previous Comments:


[2007-02-16 11:26:30] exaton at free dot fr

Hey again people,

I don't mean to be annoying, but I've just done a bit more research, so
I thought I'd share it with you.

Iliaa, I found the code change where you added the infamous
spec-altering error check that I'm going on about :

PHP_5_2 :
http://cvs.php.net/viewcvs.cgi/php-src/ext/pdo/pdo_sql_parser.c?r1=1.35.2.6.2.3&r2=1.35.2.6.2.4

Also applied to MAIN, with both times the comment : "Added missing
check for mismatching number of tokens & bound params in prepared
statement emulation."

That perfectly matches my error conditions.

The problem is, the bindno variable contains the number of individual
tokens. However, multiple tokens may have the same name ; but each
token name can only be bound once ! So comparing bindno to the number
of bindings is incorrect. It introduces the following specification :
"multiple tokens may not have the same name in a prepared statement".

The workaround is still the same : binding enough bogus tokens to match
the number of individual tokens used in the prepared statement, when
some share the same name.

Oh, did I mention that this prevented anyone with prepared statements
containing multiple tokens sharing the same name from upgrading to PHP
5.2.1 ? :-)



[2007-02-10 17:18:20] exaton at free dot fr

OK, I've taken a look at the source code to try and lend a hand in
clearing up this issue. My first time though, so here's hoping I'm not
too far off the mark.

Diffing ext/pdo/ and ext/pdo_pgsql/ files between PHP 5.2.0 and 5.2.1,
I find that the error message I am encountering is due to a new
paragraph having been *added* to the much remangled
ext/pdo/pdo_sql_parser.c (line 262) :

if (params && bindno != zend_hash_num_elements(params) &&
stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) {
pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "number of bound
variables does not match number of tokens" TSRMLS_CC);
ret = -1;
goto clean_up;
}

Somehow I'm trigerring the error condition, here. I'm guessing that my
bindno is different from the number of elements in the params hash
table.

bindno is incremented on line 214. I could be wrong, but I'm under the
impression that it is *incremented with each _placeholder_*, which in
turn I take to be the "token *instances*" we were talking about
before.

Now, I think we both agree that we only have to bind as many
values/vars as there are *different* tokens in the statement. That is
in any case how things worked up to PHP 5.2.0.

With the new error detection that has been added (the above paragraph
of code), and if I'm right about the way bindno is counted, then we are
expected to bind as many values/vars as there are *placeholders* in the
statement, even if there are 2 or more placeholders for the same token
name.

That would be very coherent with the new error I am getting. It would
also be coherent with my workaround, in which one just had to bind
extra, bogus values/vars (thus artificially filling up the params hash
table, with params = stmt -> bound_params) in order to not get this
error.

So :

1) The new error detection breaks existing scripts that worked with
5.2.0.

2) I think we agree that the specification introduced by this new error
detection is incorrect. One may, as far as I know, use several times the
same placeholder for bound values/vars in a statement. It is only
possible to bind a given token once (because that binding fills a hash
table, which will of course not increase in size if the same token is
bound several times). Therefore, forcing one to bind as many
values/vars as there are *placeholders* is surely incorrect.

3) The workaround is symptomatic of something real fishy going on
(having to write bogus code to "unblock" a piece of functionality,
wt... ?).

That's as much as I can do guys, I have no setup whatsoever for tracing
variables in the code. The object of such a trace would be to confirm
that, with my test case (in which there are 2 identical ":id"
placeholders in the statement), bindno = 2 versus only 1 entry in the
params = stmt -> bound_params hash table.

Good luck, and thank you for your patience, I'm not much good at
writing simple sentences :)



[2007-02-10 16:18:08] exaton at free dot fr

I'm sorry, but I don't 

#40617 [Csd]: problem refinement

2007-02-23 Thread nevermind at address dot org
 ID:   40617
 User updated by:  nevermind at address dot org
-Summary:  memory corruption
 Reported By:  nevermind at address dot org
 Status:   Closed
 Bug Type: Strings related
 Operating System: linux (FC6)
 PHP Version:  5.2.1
 New Comment:

non-alphabetic "search" argument for str_ireplace causes memory
corruption.


Previous Comments:


[2007-02-24 02:05:33] nevermind at address dot org

Likely this is too obscure to find with what I've provided.



[2007-02-24 01:55:22] nevermind at address dot org

Description:

Repeated calls to str_ireplace appear to cause memory corruption if
replacement is made. In my web application, the resulting string will
"echo" fine but html page generated in subsequent class module is never
served.  str_replace works fine.  Code working fine until upgrade to
5.2.1.

Thanks - great stuff you guys do!

Reproduce code:
---
$str_s = str_replace( array('(t)', '(tm)',   '™', chr(153)),  '
(trade marked)',$str_s );

$str_s = str_replace( array('(r)', '(reg)',  '®',   chr(174)),  '
(registered)',  $str_s );

$str_s = str_replace( array('(c)', '(copy)', '©',  chr(169)),  '
(copyrighted)', $str_s );


Expected result:

proper substitution and web page served

Actual result:
--
guessing memory corruption as html never generated.





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