ID: 39058
Comment by: kristjan at laborint dot com
Reported By: mpcribeiro at yahoo dot com
Status: No Feedback
Bug Type: Sybase-ct (ctlib) related
Operating System: Solaris 10
PHP Version: 5.1.6
New Comment:
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to
allocate 2560000 bytes)
PHP:
PHP Version 5.2.5
System:
Linux z37 2.6.9-67.0.4.ELsmp #1 SMP Sun Feb 3 07:06:14 EST 2008 x86_64
Server API:
CGI/FastCGI
Sybase:
Client API Version $Id: dblib.c,v 1.244.2.1 2006/01/31 08:45:20
freddy77 Exp $
Previous Comments:
------------------------------------------------------------------------
[2007-05-13 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-10-06 09:17:31] mpcribeiro at yahoo dot com
Fatal error: Allowed memory size of 209715200 bytes exhausted (tried to
allocate 1835103092 bytes) in
/data/www/ribeiros/syb/lib/lib_syb_sessions.php on line 66
Still with 5.1.6 and memory limit of 200Mb
I'm currently compiling the latest PHP 5.2* available from devs cvs...
lets see. Cheers
------------------------------------------------------------------------
[2006-10-06 08:59:03] tony2001@php.net
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
------------------------------------------------------------------------
[2006-10-06 08:54:43] mpcribeiro at yahoo dot com
Description:
------------
PHP 5.1.6 compiled and installed without issues.
However when procedures call sybase functions and after few minutes.
PHP complain with not enough memory.
PHP seem unable to read all the script, also unable to address the
variables properly.
At beggining gave "fatal errors" due to lack of memory even with 200Mb
has memory limit (raised from its default value).
After recompiling php 5.1.6 for 2nd time, I'm now getting the following
errors, and lack of memory (200mb limit) message is now rare to appear.
Warning: Unknown list entry type in request shutdown (0) in
lib/lib_syb_sessions.php on line 61
Warning: Unknown list entry type in request shutdown (0) in
/lib/lib_syb_sessions.php on line 42
PHP 5.1.6 was compiled with the following parameters:
PHPHOME=/opt/php
APACHEHOME=/opt/apache
cat /dev/null > conf.log
export PATH=$PATH:/var/MailRoot/bin
./configure --prefix=$PHPHOME \
--bindir=$PHPHOME/bin \
--libdir=$PHPHOME/lib \
--with-config-file-path=$PHPHOME/conf \
--with-apache2=$APACHEHOME/ \
--with-apxs2=$APACHEHOME/bin/apxs \
--with-sfw=/usr/sfw \
--with-jpeg \
--with-jpeg-dir=/usr/local \
--with-png \
--with-png-dir=/usr/local \
--with-ftp \
--with-zlib-dir=/usr/local \
--enable-magic-quotes \
--enable-safe-mode \
--enable-sockets \
--enable-track-vars \
--enable-trans-sid \
--enable-memory-limit \
--enable-calendar \
--with-pgsql=/opt/pgsql \
--with-mysql-dir=/opt/mysql \
--with-sybase-ct=$SYBASE/$SYBASE_OCS \
--enable-static=sybase-ct \
--enable-mbstring
I have reviewed the procedure few times and I can't find any glitch
that could cause such behaviour.
I'm now compiling the latest 5.2* from dev's cvs to see if this issue
is solved. Cheers
Reproduce code:
---------------
function
syb_list_processes($DBase,$DBusr,$DBpwd,$SID,$SN,$SYBSN,$ORDER) {
putenv("SYBASE=/opt/sybase");
putenv("SYBPLATFORM=solaris");
putenv("LC_ALL=default");
putenv("DSQUERY=SYBASE");
$lg=read_session_id($SID,'login');
if(!$ORDER) {
$ORDER='suid';
}
$SYBusr=syb_get_sadetails($DBase,$DBusr,$DBpwd,$SN,$SYBSN,'sausr');
$SYBpwd=syb_get_sadetails($DBase,$DBusr,$DBpwd,$SN,$SYBSN,'sapwd');
$connect=@sybase_connect("$SYBSN","$SYBusr","$SYBpwd");
if($ORDER=="") {
$ORDER='suid';
}
switch ($ORDER) {
case 'cpu': $SORTORDER="DESC";
break;
case 'physical_io': $SORTORDER="DESC";
break;
case 'memusage': $SORTORDER="DESC";
break;
case 'cmd': $SORTORDER="DESC";
break;
default: $SORTORDER="";
break;
}
$string="SELECT * FROM sysprocesses WHERE program_name NOT
LIKE 'PHP %'
ORDER BY $ORDER $SORTORDER";
$sybres=sybase_query($string);
if($sybres) {
$flag=0;
$NROWS=@sybase_num_rows($sybres);
printf("NROWS=%s",$NROWS);
printf("<TABLE width=760>");
printf("<TR><TD><B>No.
Procs</B></TD><TD><FONT
color=blue>%s</FO
NT></TD></TR>",$NROWS);
printf("<TR BGCOLOR='darkgrey'>
<TD><A
HREF='syb_procs_lst.php?sid=%s&server=%s&sybserve
r=%s&order=spid'><B>SPID</B></A></TD>",$SID,$SN,$SYBSN);
printf("<TD><A
HREF='syb_procs_lst.php?sid=%s&server=%s&sybserve
r=%s&order=status'><B>Status</B></A></TD>",$SID,$SN,$SYBSN);
printf("<TD><A
HREF='syb_procs_lst.php?sid=%s&server=%s&sybserve
r=%s&order=suid'><B>User</B></A></TD>",$SID,$SN,$SYBSN);
printf("<TD><A
HREF='syb_procs_lst.php?sid=%s&server=%s&sybserve
r=%s&order=dbid'><B>Database</B></A></TD>",$SID,$SN,$SYBSN);
printf("<TD><A
HREF='syb_procs_lst.php?sid=%s&server=%s&sybserve
r=%s&order=cmd'><B>CMD</B></A></TD>",$SID,$SN,$SYBSN);
printf("<TD><A
HREF='syb_procs_lst.php?sid=%s&server=%s&sybserve
r=%s&order=cpu'><B>CPU</B></A></TD>",$SID,$SN,$SYBSN);
printf("<TD><A
HREF='syb_procs_lst.php?sid=%s&server=%s&sybserve
r=%s&order=physical_io'><B>I/O</B></A></TD>",$SID,$SN,$SYBSN);
printf("<TD><A
HREF='syb_procs_lst.php?sid=%s&server=%s&sybserve
r=%s&order=memusage'><B>RAM</B></A></TD>",$SID,$SN,$SYBSN);
printf("<TD><A
HREF='syb_procs_lst.php?sid=%s&server=%s&sybserve
r=%s&order=clienthostname'><B>Hostname</B></A></TD>",$SID,$SN,$SYBSN);
printf("<TD><A
HREF='syb_procs_lst.php?sid=%s&server=%s&sybserve
r=%s&order=program_name'><B>Program</B></A></TD>",$SID,$SN,$SYBSN);
printf("<TD><A
HREF='syb_procs_lst.php?sid=%s&server=%s&sybserve
r=%s&order=ipaddr'><B>IP</B></A></TD>",$SID,$SN,$SYBSN);
printf("<TD></TD>");
printf("</TR>");
for ($i=0; $i < $NROWS; $i++) {
$SYBSPID=@sybase_result($sybres,$i,0);
$SYBSTATUS=@sybase_result($sybres,$i,3);
$SYBSUID=@sybase_result($sybres,$i,5);
$SYBHOST=@sybase_result($sybres,$i,29);
$SYBPRG=@sybase_result($sybres,$i,6);
$SYBCMD=@sybase_result($sybres,$i,8);
$SYBDB=@sybase_result($sybres,$i,13);
$SYBIP=@sybase_result($sybres,$i,34);
$SYBCPU=@sybase_result($sybres,$i,9);
$SYBIO=@sybase_result($sybres,$i,10);
$SYBMEM=@sybase_result($sybres,$i,11);
switch (trim($SYBSTATUS,' ')) {
case "running":
$COLOR='green';
break;
default:
$COLOR='black';
break;
}
if($flag==0) {
printf("<TR>
<TD><A
HREF='processes3.php?SN=%s&SPID=%
s&lg=%s&pw=%s'><FONT
SIZE=0>%s</FONT></A></TD>",$SN,$SYBSPID,$lg,$pw,$SYBSPID);
printf("<TD><FONT SIZE=0
COLOR=%s>%s</FONT></TD>
",$COLOR,$SYBSTATUS);
printf("<TD><FONT SIZE=0
COLOR=%s>%s</FONT></TD>
",$COLOR,syb_get_login($DBase,$DBusr,$DBpwd,$SN,$SYBSN,$SYBSUID));
printf("<TD><FONT SIZE=0
COLOR=%s>%s</FONT></TD>
",$COLOR,syb_get_database($DBase,$DBusr,$DBpwd,$SN,$SYBSN,$SYBDB));
printf("<TD><FONT SIZE=0
COLOR=%s>%s</FONT></TD>
",$COLOR,$SYBCMD);
printf("<TD><FONT SIZE=0
COLOR=%s>%s</FONT></TD>
",$COLOR,$SYBCPU);
printf("<TD><FONT SIZE=0
COLOR=%s>%s</FONT></TD>
",$COLOR,$SYBIO);
printf("<TD><FONT SIZE=0
COLOR=%s>%s</FONT></TD>
",$COLOR,$SYBMEM);
printf("<TD><FONT SIZE=0
COLOR=%s>%s</FONT></TD>
",$COLOR,$SYBHOST);
printf("<TD><FONT SIZE=0
COLOR=%s>%s</FONT></TD>
",$COLOR,$SYBPRG);
printf("<TD><FONT SIZE=0
COLOR=%s>%s</FONT></TD>
",$COLOR,$SYBIP);
if($lg<>"demo") {
printf(" <TD><A
HREF='killprocess.php?SN
=%s&SPID=%s&lg=%s&pw=%s'><IMG SRC=img/disable.gif width=10 height=10
border=0 ti
tle='Kill Process'></A></TD>",$SN,$SYBSPID,$lg,$pw);
} else {
printf(" <TD><IMG
SRC=img/disable.gif wi
dth=10 height=10 border=0 title='Kill Process'></TD>");
}
printf("</TR>");
$flag++;
} else {
printf("<TR BGCOLOR='lightgrey'>
<TD><A
HREF='processes3.php?SN=%s&SPID=%
s&lg=%s&pw=%s'><FONT
SIZE=0>%s</FONT></A></TD>",$SN,$SYBSPID,$lg,$pw,$SYBSPID);
printf("<TD><FONT SIZE=0
COLOR=%s>%s</FONT></TD>
<TD><FONT SIZE=0
COLOR=%s>%s</FONT></TD>
<TD><FONT SIZE=0
COLOR=%s>%s</FONT></TD>
<TD><FONT SIZE=0
COLOR=%s>%s</FONT></TD>
<TD><FONT SIZE=0
COLOR=%s>%s</FONT></TD>
<TD><FONT SIZE=0
COLOR=%s>%s</FONT></TD>
<TD><FONT SIZE=0
COLOR=%s>%s</FONT></TD>
<TD><FONT SIZE=0
COLOR=%s>%s</FONT></TD>
<TD><FONT SIZE=0
COLOR=%s>%s</FONT></TD>
<TD><FONT SIZE=0
COLOR=%s>%s</FONT></TD>
",
$COLOR,$SYBSTATUS,
$COLOR,syb_get_login($DBase,$DBusr,$DBpw
d,$SN,$SYBSN,$SYBSUID),
$COLOR,syb_get_database($DBase,$DBusr,$D
Bpwd,$SN,$SYBSN,$SYBDB),
$COLOR,$SYBCMD,
$COLOR,$SYBCPU,
$COLOR,$SYBIO,
$COLOR,$SYBMEM,
$COLOR,$SYBHOST,
$COLOR,$SYBPRG,
$COLOR,$SYBIP);
if($lg<>"demo") {
printf(" <TD><A
HREF='killprocess.php?SN
=%s&SPID=%s&lg=%s&pw=%s'><IMG SRC=img/disable.gif width=10 height=10
border=0 ti
tle='Kill Process'></A></TD>",$SN,$SYBSPID,$lg,$pw);
} else {
printf(" <TD><IMG
SRC=img/disable.gif wi
dth=10 height=10 border=0 title='Kill Process'></TD>");
}
printf("</TR>");
$flag=0;
}
}
}
printf("</TABLE>");
@sybase_close($connect);
}
Expected result:
----------------
No fatal errors with lack of memory (im now using 200Mb) where in
previous versions I used the default value.
The variables showing the correct content (not empty content or values
mixed between vars).
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39058&edit=1