#44665 [NEW]: Memory leak in array_push operation

2008-04-07 Thread sasha at integrate dot ru
From: sasha at integrate dot ru
Operating system: Linux
PHP version:  5.2.5
PHP Bug Type: Arrays related
Bug description:  Memory leak in array_push operation

Description:

Sorry for my english

php with curl, dbase, dom, gd2, mbstring,pgsql, simplexml,soap,sockets 

It running under eAccelerator, but when I turn it off, the result is just
the same.

actually we use only pgsql. we get request (rather big - more than 3000
rows in result) making array of objects and then trying to convert each
object into html string. converted string (each about 2 Kb length) have
been pushed into array
very soon memory usage growing to 64 Mb and script is crushed
This problem is solved by method refact

protected function _refact($arr)
{
$myarr=array();
while(!empty($arr)) $myarr[]=array_shift($arr);

return ($myarr);
}

I call this function after 75, 150, 300 etc iterations, but calling this
function reduce performance. Is that behaviour (I mean memory usage
growing) normal?  

Reproduce code:
---
Normal script (crushed)

http://ver.web.integrate.ru/test1.php

Cheated script (with refact method)
http://ver.web.integrate.ru/test1.php


Each script reports tht Init memory (Memory at the begin), how much
objects it proceeds (Now showing), iteration counter (Cicling iteration),
current memry usage (current memory usage) and length of string we pushed
into array (string_length). 

Cheated script (in red hrs) show also the length of array we throw to
refact method


Expected result:

I guess that the memory usage won't grow while running this script because
the array of objects poped every turn, and the volume of each element of
this array more than the volume of elements of the result array 

Actual result:
--
U can see it on url I submit

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



#44665 [Opn]: Memory leak in array_push operation

2008-04-07 Thread sasha at integrate dot ru
 ID:   44665
 User updated by:  sasha at integrate dot ru
 Reported By:  sasha at integrate dot ru
 Status:   Open
 Bug Type: Arrays related
 Operating System: Linux
 PHP Version:  5.2.5
 New Comment:

sorry - wrong second link
the right link is 
http://ver.web.integrate.ru/test2.php


Previous Comments:


[2008-04-07 22:35:43] sasha at integrate dot ru

Description:

Sorry for my english

php with curl, dbase, dom, gd2, mbstring,pgsql, simplexml,soap,sockets


It running under eAccelerator, but when I turn it off, the result is
just the same.

actually we use only pgsql. we get request (rather big - more than 3000
rows in result) making array of objects and then trying to convert each
object into html string. converted string (each about 2 Kb length) have
been pushed into array
very soon memory usage growing to 64 Mb and script is crushed
This problem is solved by method refact

protected function _refact($arr)
{
$myarr=array();
while(!empty($arr)) $myarr[]=array_shift($arr);

return ($myarr);
}

I call this function after 75, 150, 300 etc iterations, but calling
this function reduce performance. Is that behaviour (I mean memory usage
growing) normal?  

Reproduce code:
---
Normal script (crushed)

http://ver.web.integrate.ru/test1.php

Cheated script (with refact method)
http://ver.web.integrate.ru/test1.php


Each script reports tht Init memory (Memory at the begin), how much
objects it proceeds (Now showing), iteration counter (Cicling
iteration), current memry usage (current memory usage) and length of
string we pushed into array (string_length). 

Cheated script (in red hrs) show also the length of array we throw to
refact method


Expected result:

I guess that the memory usage won't grow while running this script
because the array of objects poped every turn, and the volume of each
element of this array more than the volume of elements of the result
array 

Actual result:
--
U can see it on url I submit





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



#41184 [NEW]: NOT CONNECT to DATABASE

2007-04-25 Thread sasha at it-energy dot ru
From: sasha at it-energy dot ru
Operating system: SUSE 10
PHP version:  5.2.1
PHP Bug Type: OCI8 related
Bug description:  NOT CONNECT to DATABASE

Description:

Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed. There
is something wrong with your system - please check that ORACLE_HOME is set
and points to the right directory in /opt/apache2/htdocs/dbtest01.php on
line 24


Reproduce code:
---
 $ORACLE_HOME = getenv(ORACLE_HOME);
 echo ORACLE_HOME=$ORACLE_HOMEbr\n;
 $NLS_LANG = getenv(NLS_LANG);
 echo NLS_LANG=$NLS_LANGbr\n;
 $LD_LIBRARY_PATH = getenv(LD_LIBRARY_PATH);
 echo LD_LIBRARY_PATH=$LD_LIBRARY_PATHbr\n;
 $ORA_NLS33 = getenv(ORA_NLS33);
 echo ORA_NLS33=$ORA_NLS33br\n;
 $username = ***; $paswd= **;
 $dbstring = **;
 $db_conn = ocilogon($username, $paswd, $dbstring );
 if (!$db_conn){
   echo ...FAILED/p;
 }

Expected result:

Connect to database.

Actual result:
--
ORACLE_HOME=/opt/oracle/oracle/product/10.2.0/client_1
NLS_LANG=american_america.CL8MSWIN1251
LD_LIBRARY_PATH=/opt/oracle/oracle/product/10.2.0/client_1/lib:/opt/apache2/lib:/opt/oracle/oracle/product/10.2.0/client_1/lib
ORA_NLS33=/opt/oracle/oracle/product/10.2.0/client_1/nls/data

Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed. There
is something wrong with your system - please check that ORACLE_HOME is set
and points to the right directory in /opt/apache2/htdocs/dbtest01.php on
line 24
...FAILED

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


#41184 [Opn]: NOT CONNECT to DATABASE

2007-04-25 Thread sasha at it-energy dot ru
 ID:   41184
 User updated by:  sasha at it-energy dot ru
 Reported By:  sasha at it-energy dot ru
 Status:   Open
 Bug Type: OCI8 related
 Operating System: SUSE 10
 PHP Version:  5.2.1
 New Comment:

Installed full ORACLE client 10.2.0
php configure from root as:
./configure --with-apxs2=/opt/apache2/bin/apxs --with-openssl
--enable-shmop --enable-sysvsem --enable-sysvshm --with-zlib
--with-oci8=$ORACLE_HOME --enable-sigchild --with-iconv
Before configure test sqlplus user/[EMAIL PROTECTED] coneect succsessfuly.


Previous Comments:


[2007-04-25 08:20:53] sasha at it-energy dot ru

Description:

Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed.
There is something wrong with your system - please check that
ORACLE_HOME is set and points to the right directory in
/opt/apache2/htdocs/dbtest01.php on line 24


Reproduce code:
---
 $ORACLE_HOME = getenv(ORACLE_HOME);
 echo ORACLE_HOME=$ORACLE_HOMEbr\n;
 $NLS_LANG = getenv(NLS_LANG);
 echo NLS_LANG=$NLS_LANGbr\n;
 $LD_LIBRARY_PATH = getenv(LD_LIBRARY_PATH);
 echo LD_LIBRARY_PATH=$LD_LIBRARY_PATHbr\n;
 $ORA_NLS33 = getenv(ORA_NLS33);
 echo ORA_NLS33=$ORA_NLS33br\n;
 $username = ***; $paswd= **;
 $dbstring = **;
 $db_conn = ocilogon($username, $paswd, $dbstring );
 if (!$db_conn){
   echo ...FAILED/p;
 }

Expected result:

Connect to database.

Actual result:
--
ORACLE_HOME=/opt/oracle/oracle/product/10.2.0/client_1
NLS_LANG=american_america.CL8MSWIN1251
LD_LIBRARY_PATH=/opt/oracle/oracle/product/10.2.0/client_1/lib:/opt/apache2/lib:/opt/oracle/oracle/product/10.2.0/client_1/lib
ORA_NLS33=/opt/oracle/oracle/product/10.2.0/client_1/nls/data

Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed.
There is something wrong with your system - please check that
ORACLE_HOME is set and points to the right directory in
/opt/apache2/htdocs/dbtest01.php on line 24
...FAILED





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


#41184 [Bgs]: NOT CONNECT to DATABASE

2007-04-25 Thread sasha at it-energy dot ru
 ID:   41184
 User updated by:  sasha at it-energy dot ru
 Reported By:  sasha at it-energy dot ru
 Status:   Bogus
 Bug Type: OCI8 related
 Operating System: SUSE 10
 PHP Version:  5.2.1
 New Comment:

Yes !
I write Before configure test sqlplus user/[EMAIL PROTECTED] conect
succsessfuly
If ORACLE_HOME not correct call sqlplus not correct start.
Realy, I do
. oraenv 
and set valid SID


Previous Comments:


[2007-04-25 08:29:52] [EMAIL PROTECTED]

There is something wrong with your system - please check that 
ORACLE_HOME isset and points to the right directory 

Do I really need to add something?



[2007-04-25 08:26:57] sasha at it-energy dot ru

Installed full ORACLE client 10.2.0
php configure from root as:
./configure --with-apxs2=/opt/apache2/bin/apxs --with-openssl
--enable-shmop --enable-sysvsem --enable-sysvshm --with-zlib
--with-oci8=$ORACLE_HOME --enable-sigchild --with-iconv
Before configure test sqlplus user/[EMAIL PROTECTED] coneect succsessfuly.



[2007-04-25 08:20:53] sasha at it-energy dot ru

Description:

Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed.
There is something wrong with your system - please check that
ORACLE_HOME is set and points to the right directory in
/opt/apache2/htdocs/dbtest01.php on line 24


Reproduce code:
---
 $ORACLE_HOME = getenv(ORACLE_HOME);
 echo ORACLE_HOME=$ORACLE_HOMEbr\n;
 $NLS_LANG = getenv(NLS_LANG);
 echo NLS_LANG=$NLS_LANGbr\n;
 $LD_LIBRARY_PATH = getenv(LD_LIBRARY_PATH);
 echo LD_LIBRARY_PATH=$LD_LIBRARY_PATHbr\n;
 $ORA_NLS33 = getenv(ORA_NLS33);
 echo ORA_NLS33=$ORA_NLS33br\n;
 $username = ***; $paswd= **;
 $dbstring = **;
 $db_conn = ocilogon($username, $paswd, $dbstring );
 if (!$db_conn){
   echo ...FAILED/p;
 }

Expected result:

Connect to database.

Actual result:
--
ORACLE_HOME=/opt/oracle/oracle/product/10.2.0/client_1
NLS_LANG=american_america.CL8MSWIN1251
LD_LIBRARY_PATH=/opt/oracle/oracle/product/10.2.0/client_1/lib:/opt/apache2/lib:/opt/oracle/oracle/product/10.2.0/client_1/lib
ORA_NLS33=/opt/oracle/oracle/product/10.2.0/client_1/nls/data

Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed.
There is something wrong with your system - please check that
ORACLE_HOME is set and points to the right directory in
/opt/apache2/htdocs/dbtest01.php on line 24
...FAILED





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


#41184 [Bgs]: NOT CONNECT to DATABASE

2007-04-25 Thread sasha at it-energy dot ru
 ID:   41184
 User updated by:  sasha at it-energy dot ru
 Reported By:  sasha at it-energy dot ru
 Status:   Bogus
 Bug Type: OCI8 related
 Operating System: SUSE 10
 PHP Version:  5.2.1
 New Comment:

Available.
I run as root:
. oraenv ! Set all needed enviroment
sqlplus . for test cconnections
/opt/apache2/bin/apachectl start

For test I set chmod -R +r $ORACLE_HOME

Error the same !


Previous Comments:


[2007-04-25 09:11:16] [EMAIL PROTECTED]

I write Before configure test sqlplus user/[EMAIL PROTECTED] conect
succsessfuly

ORACLE_HOME should be available for _Apache_ process during the start
up process.
Oracle directory also has to be readable by Apache user.



[2007-04-25 09:02:08] sasha at it-energy dot ru

Yes !
I write Before configure test sqlplus user/[EMAIL PROTECTED] conect
succsessfuly
If ORACLE_HOME not correct call sqlplus not correct start.
Realy, I do
. oraenv 
and set valid SID



[2007-04-25 08:29:52] [EMAIL PROTECTED]

There is something wrong with your system - please check that 
ORACLE_HOME isset and points to the right directory 

Do I really need to add something?



[2007-04-25 08:26:57] sasha at it-energy dot ru

Installed full ORACLE client 10.2.0
php configure from root as:
./configure --with-apxs2=/opt/apache2/bin/apxs --with-openssl
--enable-shmop --enable-sysvsem --enable-sysvshm --with-zlib
--with-oci8=$ORACLE_HOME --enable-sigchild --with-iconv
Before configure test sqlplus user/[EMAIL PROTECTED] coneect succsessfuly.



[2007-04-25 08:20:53] sasha at it-energy dot ru

Description:

Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed.
There is something wrong with your system - please check that
ORACLE_HOME is set and points to the right directory in
/opt/apache2/htdocs/dbtest01.php on line 24


Reproduce code:
---
 $ORACLE_HOME = getenv(ORACLE_HOME);
 echo ORACLE_HOME=$ORACLE_HOMEbr\n;
 $NLS_LANG = getenv(NLS_LANG);
 echo NLS_LANG=$NLS_LANGbr\n;
 $LD_LIBRARY_PATH = getenv(LD_LIBRARY_PATH);
 echo LD_LIBRARY_PATH=$LD_LIBRARY_PATHbr\n;
 $ORA_NLS33 = getenv(ORA_NLS33);
 echo ORA_NLS33=$ORA_NLS33br\n;
 $username = ***; $paswd= **;
 $dbstring = **;
 $db_conn = ocilogon($username, $paswd, $dbstring );
 if (!$db_conn){
   echo ...FAILED/p;
 }

Expected result:

Connect to database.

Actual result:
--
ORACLE_HOME=/opt/oracle/oracle/product/10.2.0/client_1
NLS_LANG=american_america.CL8MSWIN1251
LD_LIBRARY_PATH=/opt/oracle/oracle/product/10.2.0/client_1/lib:/opt/apache2/lib:/opt/oracle/oracle/product/10.2.0/client_1/lib
ORA_NLS33=/opt/oracle/oracle/product/10.2.0/client_1/nls/data

Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed.
There is something wrong with your system - please check that
ORACLE_HOME is set and points to the right directory in
/opt/apache2/htdocs/dbtest01.php on line 24
...FAILED





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


#41184 [Bgs]: NOT CONNECT to DATABASE

2007-04-25 Thread sasha at it-energy dot ru
 ID:   41184
 User updated by:  sasha at it-energy dot ru
 Reported By:  sasha at it-energy dot ru
 Status:   Bogus
 Bug Type: OCI8 related
 Operating System: SUSE 10
 PHP Version:  5.2.1
 New Comment:

May be problem in this, what directory structure not the same in 9.2
client and 10.2 client
In 9.2 client nlb file found in $ORACLE_HOME/ocommon/nls/ADMIN/DATA.
In 10.2 client nlb file found in $ORACLE_HOME/nls/data.

It may produce error ?

The directory in both case is standard. Not manualy moved and renamed.


Previous Comments:


[2007-04-25 09:39:46] sasha at it-energy dot ru

Available.
I run as root:
. oraenv ! Set all needed enviroment
sqlplus . for test cconnections
/opt/apache2/bin/apachectl start

For test I set chmod -R +r $ORACLE_HOME

Error the same !



[2007-04-25 09:11:16] [EMAIL PROTECTED]

I write Before configure test sqlplus user/[EMAIL PROTECTED] conect
succsessfuly

ORACLE_HOME should be available for _Apache_ process during the start
up process.
Oracle directory also has to be readable by Apache user.



[2007-04-25 09:02:08] sasha at it-energy dot ru

Yes !
I write Before configure test sqlplus user/[EMAIL PROTECTED] conect
succsessfuly
If ORACLE_HOME not correct call sqlplus not correct start.
Realy, I do
. oraenv 
and set valid SID



[2007-04-25 08:29:52] [EMAIL PROTECTED]

There is something wrong with your system - please check that 
ORACLE_HOME isset and points to the right directory 

Do I really need to add something?



[2007-04-25 08:26:57] sasha at it-energy dot ru

Installed full ORACLE client 10.2.0
php configure from root as:
./configure --with-apxs2=/opt/apache2/bin/apxs --with-openssl
--enable-shmop --enable-sysvsem --enable-sysvshm --with-zlib
--with-oci8=$ORACLE_HOME --enable-sigchild --with-iconv
Before configure test sqlplus user/[EMAIL PROTECTED] coneect succsessfuly.



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

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


#41184 [Bgs]: NOT CONNECT to DATABASE

2007-04-25 Thread sasha at it-energy dot ru
 ID:   41184
 User updated by:  sasha at it-energy dot ru
 Reported By:  sasha at it-energy dot ru
 Status:   Bogus
 Bug Type: OCI8 related
 Operating System: SUSE 10
 PHP Version:  5.2.1
 New Comment:

It not PHP problem. It problem OCI8 extension.
This extension not work in this combination. It realy combination.
Configure and make runs successfuly.
What can I make or look for the decision of this problem?


Previous Comments:


[2007-04-25 09:59:48] [EMAIL PROTECTED]

Please ask your questions on a support forum.
This is not PHP problem.



[2007-04-25 09:47:35] sasha at it-energy dot ru

May be problem in this, what directory structure not the same in 9.2
client and 10.2 client
In 9.2 client nlb file found in $ORACLE_HOME/ocommon/nls/ADMIN/DATA.
In 10.2 client nlb file found in $ORACLE_HOME/nls/data.

It may produce error ?

The directory in both case is standard. Not manualy moved and renamed.



[2007-04-25 09:39:46] sasha at it-energy dot ru

Available.
I run as root:
. oraenv ! Set all needed enviroment
sqlplus . for test cconnections
/opt/apache2/bin/apachectl start

For test I set chmod -R +r $ORACLE_HOME

Error the same !



[2007-04-25 09:11:16] [EMAIL PROTECTED]

I write Before configure test sqlplus user/[EMAIL PROTECTED] conect
succsessfuly

ORACLE_HOME should be available for _Apache_ process during the start
up process.
Oracle directory also has to be readable by Apache user.



[2007-04-25 09:02:08] sasha at it-energy dot ru

Yes !
I write Before configure test sqlplus user/[EMAIL PROTECTED] conect
succsessfuly
If ORACLE_HOME not correct call sqlplus not correct start.
Realy, I do
. oraenv 
and set valid SID



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

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


Bug #16898: type convertation problem in pow()

2002-04-29 Thread sasha

From: [EMAIL PROTECTED]
Operating system: Linux
PHP version:  4.2.0
PHP Bug Type: *Math Functions
Bug description:  type convertation problem in pow()

$result=mysql_query(SELECT id, cdate FROM newspaper WHERE
path='.substr($a, strrpos($a, /)+1, strlen($a)).') or die
(mysql_error());
$rec=mysql_fetch_array($result);


$e=pow(2, $rec[id]); //Warning!


it's looks like what pow() function can't convert $rec[id] variable from
string to integer automatically.
Using 

$rec[id]=stettype($rec[id], int);

helps
-- 
Edit bug report at http://bugs.php.net/?id=16898edit=1
-- 
Fixed in CVS:http://bugs.php.net/fix.php?id=16898r=fixedcvs
Fixed in release:http://bugs.php.net/fix.php?id=16898r=alreadyfixed
Need backtrace:  http://bugs.php.net/fix.php?id=16898r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=16898r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16898r=support
Expected behavior:   http://bugs.php.net/fix.php?id=16898r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=16898r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=16898r=submittedtwice