#39058 [Com]: Memory Leak

2008-03-02 Thread kristjan at laborint dot com
 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 256 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] [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





[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');
[EMAIL PROTECTED]("$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="";
   

#38111 [Com]: PHP crashes IIS worker process and application pool

2008-03-02 Thread markness at gmail dot com
 ID:   38111
 Comment by:   markness at gmail dot com
 Reported By:  svendavidh at hotmail dot com
 Status:   No Feedback
 Bug Type: IIS related
 Operating System: Windows Server 2003 Std. Ed. R2
 PHP Version:  5.1.4
 New Comment:

I removed the ISAPI DLL from the ISAPI Filters in IIS7 (as I don't need
to do HTTP_AUTH from PHP, which seems to be what is causing the
problem), and I haven't had any crashes yet.

Hope it works for you too (assuming you don't do HTTP Authentication
through PHP)


Previous Comments:


[2008-02-20 21:58:44] wim-bart at vanderwaals dot net

Found a MS KB doc related to this issue.
http://support.microsoft.com/kb/892988

Did not solve problem. Process Explorer tells php5ts.dll.



[2008-02-20 21:55:15] wim-bart at vanderwaals dot net

Same problem here. Configuration:

Windows Server 2003 Standard edition
Windows Server 2003 Web edition
Windows Server 2003 Enterprise Edition
Windows Server 2003 Standard edition R2

Additional software:
IIS version 6

Service packs:
Windows 2003 SP 2
Hotixes until 20th feb 2008

Popup window on console:
IIS Worker Process encountered a problem and needed to close.

Eventlog:
Source: Application Error
Catagory: (100)
Type: Error
Event ID: 1000
User: N/A
Description: Faulting application w3wp.exe, version 6.0.3790.3959,
faulting module w3core.dll, version 6.0.3790.3959, fault address
0x000201b4.

Data:
: 41 70 70 6c 69 63 61 74   Applicat
0008: 69 6f 6e 20 46 61 69 6c   ion Fail
0010: 75 72 65 20 20 77 33 77   ure  w3w
0018: 70 2e 65 78 65 20 36 2e   p.exe 6.
0020: 30 2e 33 37 39 30 2e 33   0.3790.3
0028: 39 35 39 20 69 6e 20 77   959 in w
0030: 33 63 6f 72 65 2e 64 6c   3core.dl
0038: 6c 20 36 2e 30 2e 33 37   l 6.0.37
0040: 39 30 2e 33 39 35 39 20   90.3959 
0048: 61 74 20 6f 66 66 73 65   at offse
0050: 74 20 30 30 30 32 30 31   t 000201
0058: 62 34 b4  

Related event:
Source: W3SVC
Catagory: None
Type: Warning
Event ID: 1009
User: N/A
Description: A process serving application pool '-'
terminated unexpectedly. The process id was '3484'. The process exit
code was '0xc005'.

Before the error occured:
Source: Security
Catagory: Logon/Logoff
Type: Success Access
Event ID: 538
User: [Computername]\IUSR_[computername]
Description: User Logoff:
User Name:  IUSR_[SERVERNAME]
Domain: [SERVERNAME]
Logon ID:   (0x0,0x375E7)
Logon Type: 8

PHP Version:
PHP 5.2.5 (cli) (built: Nov  8 2007 23:18:51)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

Modules loaded:
extension=php_gd2.dll
extension=php_iisfunc.dll
extension=php_sockets.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_smtp.dll
extension=php_yaz.dll
extension=php_zip.dll
extension=php_win32std.dll

Same error with only following modules loaded:
extension=php_gd2.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_smtp.dll

Compiled modules:
bcmath, calendar, com_dotnet, ctype, date, dom, filter, ftp, gd, hash,
iconv, iisfunc, json, libxml, mysql, mysqli, odbc, pcre, Reflection,
session, SimpleXML, smtp, sockets, SPL, standard, tokenizer, wddx,
win32std, xml, xmlreader, xmlwriter, zip, zlib

MySql and Mysqli versions:
php_mysql.dll 5.2.0.0
php_mysqli.dll 5.2.0.0

Applicationpool settings:
Recycle worker process in minutes: 1740
Shutdown workerprocess after idle for: 20 minutes
Request queue limit: 1000 requests
Enable pinging: 30 seconds
Enable rapid fail detection: 5 times/5 minutes

Errors in php.log:
None



[2008-02-14 07:46:10] O dot Tuengeler at interactivedialog dot de

Have the same Problem using PHP 5.2.3, Windows Server 2003 (SP2), and
IIS 6. Clean install. PHP installed as ISAPI extension.



[2008-01-29 23:02:52] kitcargile at hotmail dot com

Found a MS KB doc related to this issue.
http://support.microsoft.com/kb/892988



[2008-01-10 16:54:55] chrisr at rho-technology dot com

Same issues:
OS: Windows Server 2003 Web Edition sp1
PHP: 5.1.4

All apps are in the default pool



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

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



#44208 [Opn->Bgs]: preg_* UTF-8 support breaks w/ external PCRE

2008-03-02 Thread nlopess
 ID:   44208
 Updated by:   [EMAIL PROTECTED]
 Reported By:  martin dot adolfsson at movel dot se
-Status:   Open
+Status:   Bogus
 Bug Type: PCRE related
 Operating System: Debian GNU/Linux 4.0
 PHP Version:  5.2.5
 New Comment:

You've something broken on your end. I've compiled pcre with the same
options as you did and it worked correctly.


Previous Comments:


[2008-02-22 08:26:37] martin dot adolfsson at movel dot se

Might add some details from pcre-7.6:

pcre-7.6 configuration summary:
...
Enable UTF-8 support  : yes
Unicode properties .. : yes
...

[src/pcre_tables.c]--
#ifdef SUPPORT_UTF8

const int _pcre_utf8_table1[] =...
.
[src/pcre_tables.c]--

$ strings lib/libpcre.a | grep pcre_utf8_table1
_pcre_utf8_table1
...

So AFAIK, PCRE has been built successfully w/ UTF-8 support.



[2008-02-22 08:03:39] martin dot adolfsson at movel dot se

Description:

Attempting to use external PCRE library (7.6), configured with

  --enable-static 
  --disable-shared 
  --enable-utf8 
  --enable-unicode-properties
  --disable-cpp 

in PHP 5.2.5, configured with (among other options):

--with-pcre-regex={PATH_TO_PCRE_INSTALLATION}

Results in calls to preg_match() with /u modifier triggering an error
and stating that "this version of PCRE is not compiled with PCRE_UTF8
support".

Reproduce code:
---
preg_match('//u', '' );

Expected result:



Actual result:
--
preg_match() [function.preg-match]:
Compilation failed: this version of PCRE is not compiled with PCRE_UTF8
support at offset 0 in ...





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



#44315 [Bgs]: Late static binding not working for variables

2008-03-02 Thread m dot kurzyna at crystalpoint dot pl
 ID:   44315
 User updated by:  m dot kurzyna at crystalpoint dot pl
 Reported By:  m dot kurzyna at crystalpoint dot pl
 Status:   Bogus
 Bug Type: Scripting Engine problem
 Operating System: PLD Linux
 PHP Version:  5.3CVS-2008-03-03 (snap)
 New Comment:

Hm.. ok. My bad. Thanks for the extra info.


Previous Comments:


[2008-03-03 01:38:51] [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.

in C::__construct, static resolves to C, and C::$counter is not defined
per-se, a fallback occurs and B::$counter is incremented. Nothing to do
with late static bindings.



[2008-03-03 01:31:17] m dot kurzyna at crystalpoint dot pl

The snapshot used was php-5.3-2008-03-02-21:30.



[2008-03-03 01:18:47] m dot kurzyna at crystalpoint dot pl

Description:

Late static binding doesn't seem to apply to static class variables. 
Example is rather self explanatory (construtor using static keyword 
should increment variable in calling class).

Reproduce code:
---


Expected result:

int(1)
int(1)

Actual result:
--
int(1)
int(2)





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



#44315 [Opn->Bgs]: Late static binding not working for variables

2008-03-02 Thread colder
 ID:   44315
 Updated by:   [EMAIL PROTECTED]
 Reported By:  m dot kurzyna at crystalpoint dot pl
-Status:   Open
+Status:   Bogus
 Bug Type: Scripting Engine problem
 Operating System: PLD Linux
 PHP Version:  5.3CVS-2008-03-03 (snap)
 New Comment:

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.

in C::__construct, static resolves to C, and C::$counter is not defined
per-se, a fallback occurs and B::$counter is incremented. Nothing to do
with late static bindings.


Previous Comments:


[2008-03-03 01:31:17] m dot kurzyna at crystalpoint dot pl

The snapshot used was php-5.3-2008-03-02-21:30.



[2008-03-03 01:18:47] m dot kurzyna at crystalpoint dot pl

Description:

Late static binding doesn't seem to apply to static class variables. 
Example is rather self explanatory (construtor using static keyword 
should increment variable in calling class).

Reproduce code:
---


Expected result:

int(1)
int(1)

Actual result:
--
int(1)
int(2)





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



#44315 [Opn]: Late static binding not working for variables

2008-03-02 Thread m dot kurzyna at crystalpoint dot pl
 ID:   44315
 User updated by:  m dot kurzyna at crystalpoint dot pl
 Reported By:  m dot kurzyna at crystalpoint dot pl
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: PLD Linux
 PHP Version:  5.3CVS-2008-03-03 (snap)
 New Comment:

The snapshot used was php-5.3-2008-03-02-21:30.


Previous Comments:


[2008-03-03 01:18:47] m dot kurzyna at crystalpoint dot pl

Description:

Late static binding doesn't seem to apply to static class variables. 
Example is rather self explanatory (construtor using static keyword 
should increment variable in calling class).

Reproduce code:
---


Expected result:

int(1)
int(1)

Actual result:
--
int(1)
int(2)





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



#44315 [NEW]: Late static binding not working for variables

2008-03-02 Thread m dot kurzyna at crystalpoint dot pl
From: m dot kurzyna at crystalpoint dot pl
Operating system: PLD Linux
PHP version:  5.3CVS-2008-03-03 (snap)
PHP Bug Type: Scripting Engine problem
Bug description:  Late static binding not working for variables

Description:

Late static binding doesn't seem to apply to static class variables. 
Example is rather self explanatory (construtor using static keyword 
should increment variable in calling class).

Reproduce code:
---


Expected result:

int(1)
int(1)

Actual result:
--
int(1)
int(2)

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



#44313 [Opn]: inconsistencies in property assignation on scalar variables

2008-03-02 Thread felipe
 ID:   44313
 Updated by:   [EMAIL PROTECTED]
 Reported By:  johann dot queuniet at gmail dot com
 Status:   Open
 Bug Type: Class/Object related
 Operating System: All
 PHP Version:  5.2.5
 New Comment:

Using E_STRICT, "Strict Standards: Creating default object from empty
value" are showed for other cases.


Previous Comments:


[2008-03-02 18:19:19] johann dot queuniet at gmail dot com

Description:

The way PHP handles property assignation on scalar variables evaluating

as false is inconsistent.

Reproduce code:
---
test = true;

$var2 = null;
$var2->test = true;

$var3 = false;
$var3->test = true;

$var3 = '';
$var3->test = true;

$var4 = 0;
$var4->test = true;

$var5 = '0';
$var5->test = true;

$var6 = array();
$var6->test = true;
?>

Expected result:

PHP should handle every case the same way, with a "Warning: Attempt to

assign property of non-object". The first line should also trigger a 
notice since the $var1 variable is undeclared.

Actual result:
--
PHP behaves as with arrays and only triggers a warning for the last 
three. The other lines create an stdClass object with the test property

set.





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



#44313 [NEW]: inconsistencies in property assignation on scalar variables

2008-03-02 Thread johann dot queuniet at gmail dot com
From: johann dot queuniet at gmail dot com
Operating system: All
PHP version:  5.2.5
PHP Bug Type: Class/Object related
Bug description:  inconsistencies in property assignation on scalar variables

Description:

The way PHP handles property assignation on scalar variables evaluating 
as false is inconsistent.

Reproduce code:
---
test = true;

$var2 = null;
$var2->test = true;

$var3 = false;
$var3->test = true;

$var3 = '';
$var3->test = true;

$var4 = 0;
$var4->test = true;

$var5 = '0';
$var5->test = true;

$var6 = array();
$var6->test = true;
?>

Expected result:

PHP should handle every case the same way, with a "Warning: Attempt to 
assign property of non-object". The first line should also trigger a 
notice since the $var1 variable is undeclared.

Actual result:
--
PHP behaves as with arrays and only triggers a warning for the last 
three. The other lines create an stdClass object with the test property 
set.

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



#44306 [Opn->Csd]: bad result of php_uname('m') for MIPS architecture

2008-03-02 Thread iliaa
 ID:   44306
 Updated by:   [EMAIL PROTECTED]
 Reported By:  a dot u dot savchuk at gmail dot com
-Status:   Open
+Status:   Closed
 Bug Type: *General Issues
 Operating System: Windows (MIPS)
 PHP Version:  5.2.5
 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:


[2008-03-01 17:50:56] a dot u dot savchuk at gmail dot com

Description:

bad result of php_uname('m') for MIPS architecture

As i lokk in source ext/standart/info.c
there is strange code:

<<<
PHPAPI char *php_get_uname(char mode)
{
char *php_uname;
char tmp_uname[256];
#ifdef PHP_WIN32
<<<
<<< skipped lines
<<<
} else if (mode == 'm') {
switch (SysInfo.wProcessorArchitecture) {
case PROCESSOR_ARCHITECTURE_INTEL :
snprintf(tmp_uname, sizeof(tmp_uname), "i%d",
SysInfo.dwProcessorType);
php_uname = tmp_uname;
break;
case PROCESSOR_ARCHITECTURE_MIPS :
php_uname = "MIPS R4000";
php_uname = tmp_uname;
break;
<<<


Reproduce code:
---
none






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


#44310 [Opn->Bgs]: PDOStatement::exec() returns int(1) to any successful query.

2008-03-02 Thread iliaa
 ID:   44310
 Updated by:   [EMAIL PROTECTED]
 Reported By:  osc at zoyo dot info
-Status:   Open
+Status:   Bogus
 Bug Type: PDO related
 Operating System: Windowx XP x86 SP2
 PHP Version:  5.2.5
 New Comment:

Since the PDO code is identical for both Windows and Linux, I suspect 
that the problem lies with the PostgreSQL driver on windows.


Previous Comments:


[2008-03-02 10:30:52] osc at zoyo dot info

Description:

PDOStatement::exec() returns int(1) to any successful query.

I have tried it with PDO drivers for postgresql packaged with PHP
version 5.2.5 on Windows XP, and version 5.1.4 on Linux.

The method returns number of affected records on Linux, but returns
int(1) to any successful query on Windows.

PostgreSQL version is 8.2.6 for Win32.

Reproduce code:
---
exec('insert into test values( now() )');
$insert2 = $db->exec("insert into test values( now()+interval '1 day'
)");
$update  = $db->exec("update test set tm=now() + interval '2 day'");
$select = $db->exec('select * from test');
$delete  = $db->exec('delete from test');

}catch(PDOException $e){
echo $e->getMessage();
exit;
}

?>
insert1: 
 insert2: 
 update : 
 select : 
 delete : 

Expected result:

insert1: 1 insert2: 1 update : 2 select : 0 delete : 2

Actual result:
--
insert1: 1 insert2: 1 update : 1 select : 1 delete : 1





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


#44311 [Opn->Bgs]: Bug in arithmetic operation: 173.42-173.42=2.8421709430404E-014

2008-03-02 Thread scottmac
 ID:   44311
 Updated by:   [EMAIL PROTECTED]
 Reported By:  sawas at poczta dot onet dot pl
-Status:   Open
+Status:   Bogus
 Bug Type: Math related
 Operating System: WinXP, Debian
 PHP Version:  4.4.8
 New Comment:

Floating point values have a limited precision. Hence a value might 
not have the same string representation after any processing. That also
includes writing a floating point value in your script and directly 
printing it without any mathematical operations.

If you would like to know more about "floats" and what IEEE
754 is, read this:
http://docs.sun.com/source/806-3568/ncg_goldberg.html
 
Thank you for your interest in PHP.




Previous Comments:


[2008-03-02 13:25:44] sawas at poczta dot onet dot pl

Description:

I found a bug in arithmetic operation.
Simple subtraction of amounts gives inaccurate result.

Reproduce code:
---
$a = 160.00 + 5.90 + 7.52;
$b = 173.42;
print $a-$b;

Expected result:

0

Actual result:
--
2.8421709430404E-014





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


#44311 [NEW]: Bug in arithmetic operation: 173.42-173.42=2.8421709430404E-014

2008-03-02 Thread sawas at poczta dot onet dot pl
From: sawas at poczta dot onet dot pl
Operating system: WinXP, Debian
PHP version:  4.4.8
PHP Bug Type: Math related
Bug description:  Bug in arithmetic operation: 
173.42-173.42=2.8421709430404E-014

Description:

I found a bug in arithmetic operation.
Simple subtraction of amounts gives inaccurate result.

Reproduce code:
---
$a = 160.00 + 5.90 + 7.52;
$b = 173.42;
print $a-$b;

Expected result:

0

Actual result:
--
2.8421709430404E-014

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


#44047 [Com]: IIS Worker Process stopped working

2008-03-02 Thread satan at dclxvi dot nl
 ID:   44047
 Comment by:   satan at dclxvi dot nl
 Reported By:  matthew dot horner at redprairie dot com
 Status:   Open
 Bug Type: IIS related
 Operating System: Windows Vista
 PHP Version:  5.2.5
 New Comment:

lol, your test is the solution... where you set it idle time out to 1
to test it earlier, just set it to '0'. it will error out once more and
the next time it starts it will stay on.. there is no problem with
leaving it on..


Previous Comments:


[2008-02-29 04:37:22] nonya at spam dot this

To elaborate on Matthew, (Every PHP5\Vista\IIS7 machine I have every
worked on does this; 20+ machines)

The same error can be achieved back-to-back simply by running any PHP,
which in turn will add 1 active application to the DefaultAppPool.  This
is visible in the IIS7 Manager.  You can select the DefaultAppPool and
click "Recycle...", wait 3-5 secs (because WerFault.exe kicks in,
Windows Error Reporting Service) and you have a "IIS Worker Process has
failed" message with the event in the windows event log the way Matt
described which says the fault came from c:\windows\system32\ntdll.dll

If the PHP dev guys are trying to recreate this issue, you need to be
using Latest PHP5/IIS7/ISAPI-Configuration/Vista

This has been going on since Vista RC1.  Everyone who is not getting
this error may not be complaining because the error doesn't seem to do
major damage.

The closest thing to a resolution I have seen since the release of
Vista is to just adjust the timing of the automated recycle cycle. 
Since the error is only occurring during recycling, they have been
scheduling 1 recycle per day, hence 1 crash per day.

There are many, many, many, MANY forums and support threads with people
having the same problem, they just aren't posting here.
Here are a few:
forums.techarena.in/showthread.php?t=686723
www.developersdex.com/asp/message.asp?p=592&r=6057007
www.issociate.de/board/post/468636/IIS_+_PHP_--_Worker_Process_alert_&_w3wp.exe_crash?.html
forums.techarena.in/showthread.php?t=821723
groups.google.com/group/comp.lang.php/browse_thread/thread/93aef1ff2f0ba3b0
www.thescripts.com/forum/thread742344.html



[2008-02-05 16:17:54] matthew dot horner at redprairie dot com

I removed all extensions and re-tested with the same results.



[2008-02-05 15:01:16] [EMAIL PROTECTED]

Do you have any extensions loaded via php.ini or this is purely whats
statically built into PHP?

If you do have extensions can you disable them all and see if you can
reproduce the problem.



[2008-02-05 14:17:23] matthew dot horner at redprairie dot com

I have tested with the latest and the crash is still occurring with the
exact same stack trace.  The build date of the current installation is
Feb 5 2008 08:04:21.



[2008-02-05 05:07:30] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi





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

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


#42855 [Com]: dns_get_record() doesn't return all text from TXT record

2008-03-02 Thread a dot u dot savchuk at gmail dot com
 ID:   42855
 Comment by:   a dot u dot savchuk at gmail dot com
 Reported By:  misc at e2007 dot cynergi dot com
 Status:   Assigned
 Bug Type: Network related
 Operating System: RHEL4
 PHP Version:  5.2.4
 Assigned To:  pollita
 New Comment:

i reproduce this and create a patch for problem solving.

it works for me:

$ ./sapi/cli/php -r '$x =
dns_get_record("bravo._domainkey.yahoogroups.co.uk", DNS_TXT);
var_dump($x);'
array(1) {
  [0]=>
  array(5) {
["host"]=>
string(34) "bravo._domainkey.yahoogroups.co.uk"
["type"]=>
string(3) "TXT"
["txt"]=>
string(179) "k=rsa;
p=MHwwDQYJKoZIhvcNAQEBBQADawAwaAJhAKt1OprXeH+okFnh8XxMeVV9iYAbhIOMq3ODHpcBm7JSl3Orusqv53BIn55a0JaP1iqbIWu5j3TVIpqbG7MHZUKJQrqcmVSvG7oT3r7Fwo6aCHMMuL+IZdEpbb9ZU8xomQIDAP//"
["class"]=>
string(2) "IN"
["ttl"]=>
int(21130)
  }
}

Here is code:

$ cat /home/sawoy/dns.c.patch
--- ../source/php-5.2.5/ext/standard/dns.c  2007-06-26
04:04:55.0 -0700
+++ ./ext/standard/dns.c2008-03-02 03:56:21.0 -0800
@@ -474,12 +474,17 @@ static u_char *php_parserr(u_char *cp, q
break;
case DNS_T_TXT:
add_assoc_string(*subarray, "type", "TXT", 1);
-   n = cp[0];
-   tp = emalloc(n + 1);
-   memcpy(tp, cp + 1, n);
-   tp[n] = '\0';
+   tp = emalloc(dlen + 1);
+   int ll = 0;
+   while ( ll < dlen)
+   {
+   n = cp[ll];
+   memcpy(tp + ll , cp + ll + 1, n);
+   ll = ll + n + 1;
+   }
+   tp[dlen] = '\0';
cp += dlen;
-   add_assoc_stringl(*subarray, "txt", tp, n, 0);
+   add_assoc_stringl(*subarray, "txt", tp, dlen,
0);
break;
case DNS_T_SOA:
add_assoc_string(*subarray, "type", "SOA", 1);


Previous Comments:


[2007-10-06 00:28:01] [EMAIL PROTECTED]

Sara, please take a look, seems like this cryptic piece of code (so
messy) uses wrong length to get the piece of data here..



[2007-10-04 13:24:20] misc at e2007 dot cynergi dot com

I'm tired... 3rd paragraph in the "description" should have read: "The
following code examples where compiled when under Windows the command
... returned:", and the "expected result" string length should be
greater than 127, of course.



[2007-10-04 13:12:33] misc at e2007 dot cynergi dot com

Description:

dns_get_record() doesn't return all text from TXT record.

RFC 1035 states that TXT record values can't have "compression", but
can have multiple strings for the same DNS record. Although uncommon,
such long TXT strings actualy exist to make publicly available public
key data for DomainKeys e-mail protocols (used by Yahoo! and Gmail).

The following code examples where compiled when under Windows, the
command "nslookup -type=TXT bravo._domainkey.yahoogroups.co.uk"
returned:

(...)
Non-authoritative answer:
bravo._domainkey.yahoogroups.co.uk  text =

"k=rsa;
p=MHwwDQYJKoZIhvcNAQEBBQADawAwaAJhAKt1OprXeH+okFnh8XxMeVV9iYAbhIOMq3ODHpcBm7JSl3Orusqv53BIn55a0JaP1iqbIWu5j3TVIpqbG7MHZU"
"KJQrqcmVSvG7oT3r7Fwo6aCHMMuL+IZdEpbb9ZU8xomQIDAP//"


Reproduce code:
---
$x = dns_get_record("bravo._domainkey.yahoogroups.co.uk", DNS_TXT);
var_dump($x);


Expected result:

array(1) {
  [0]=>
  array(5) {
["host"]=>
string(34) "bravo._domainkey.yahoogroups.co.uk"
["type"]=>
string(3) "TXT"
["txt"]=>
string(127) "k=rsa;
p=MHwwDQYJKoZIhvcNAQEBBQADawAwaAJhAKt1OprXeH+okFnh8XxMeVV9iYAbhIOMq3ODHpcBm7JSl3Orusqv53BIn55a0JaP1iqbIWu5j3TVIpqbG7MHZUKJQrqcmVSvG7oT3r7Fwo6aCHMMuL+IZdEpbb9ZU8xomQIDAP//"
["class"]=>
string(2) "IN"
["ttl"]=>
int(17428)
  }
}


Actual result:
--
array(1) {
  [0]=>
  array(5) {
["host"]=>
string(34) "bravo._domainkey.yahoogroups.co.uk"
["type"]=>
string(3) "TXT"
["txt"]=>
string(127) "k=rsa;
p=MHwwDQYJKoZIhvcNAQEBBQADawAwaAJhAKt1OprXeH+okFnh8XxMeVV9iYAbhIOMq3ODHpcBm7JSl3Orusqv53BIn55a0JaP1iqbIWu5j3TVIpqbG7MHZU"
["class"]=>
string(2) "IN"
["ttl"]=>
int(17428)
  }
}






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


#44310 [NEW]: PDOStatement::exec() returns int(1) to any successful query.

2008-03-02 Thread osc at zoyo dot info
From: osc at zoyo dot info
Operating system: Windowx XP x86 SP2
PHP version:  5.2.5
PHP Bug Type: PDO related
Bug description:  PDOStatement::exec() returns int(1) to any successful query.

Description:

PDOStatement::exec() returns int(1) to any successful query.

I have tried it with PDO drivers for postgresql packaged with PHP
version 5.2.5 on Windows XP, and version 5.1.4 on Linux.

The method returns number of affected records on Linux, but returns int(1)
to any successful query on Windows.

PostgreSQL version is 8.2.6 for Win32.

Reproduce code:
---
exec('insert into test values( now() )');
$insert2 = $db->exec("insert into test values( now()+interval '1 day'
)");
$update  = $db->exec("update test set tm=now() + interval '2 day'");
$select = $db->exec('select * from test');
$delete  = $db->exec('delete from test');

}catch(PDOException $e){
echo $e->getMessage();
exit;
}

?>
insert1: 
 insert2: 
 update : 
 select : 
 delete : 

Expected result:

insert1: 1 insert2: 1 update : 2 select : 0 delete : 2

Actual result:
--
insert1: 1 insert2: 1 update : 1 select : 1 delete : 1

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


#44309 [NEW]: Apache crash because PHP frees memory twice

2008-03-02 Thread dmitry dot dulepov at gmail dot com
From: dmitry dot dulepov at gmail dot com
Operating system: SuSE Linux 10.3
PHP version:  5.2.5
PHP Bug Type: Reproducible crash
Bug description:  Apache crash because PHP frees memory twice

Description:

>From time to time Apache crashes inside PHP. It is impossible to reproduce
by executing a single script but this happens several times a week. I
cannot get a backtrace because this is no single script that crashes. It
just crashes from time to time.

I use official distributions from SuSE 10.3.

Actual result:
--
Stack trace:

*** glibc detected *** /usr/sbin/httpd2-prefork: munmap_chunk(): invalid
pointer: 0x7fff56096260 ***
*** glibc detected *** /usr/sbin/httpd2-prefork: double free or corruption
(out): 0x7fff56094780 ***
=== Backtrace: =
/lib64/libc.so.6[0x2b6e5675a21d]
/usr/lib64/apache2/mod_php5.so(zend_shutdown+0x7b)[0x2b6e5a1e623b]
/usr/lib64/apache2/mod_php5.so(php_module_shutdown+0x2a)[0x2b6e5a1a228a]
/usr/lib64/apache2/mod_php5.so(php_module_shutdown_wrapper+0x9)[0x2b6e5a1a2329]
/usr/lib64/apache2/mod_php5.so[0x2b6e5a265471]
/usr/lib64/libapr-1.so.0[0x2b6e55c7686d]
/usr/lib64/libapr-1.so.0(apr_pool_destroy+0x2d)[0x2b6e55c76e9d]
/usr/sbin/httpd2-prefork[0x555a14ce]
/usr/sbin/httpd2-prefork[0x555a14fb]
/lib64/libpthread.so.0[0x2b6e562d9fb0]
/usr/lib64/apache2/mod_php5.so(php_strlcpy+0x15)[0x2b6e5a1ae3c5]
/usr/lib64/apache2/mod_php5.so(php_realpath+0x3f4)[0x2b6e5a1a0884]
/usr/lib64/apache2/mod_php5.so(virtual_file_ex+0x1d5)[0x2b6e5a1a0b75]
/usr/lib64/apache2/mod_php5.so(expand_filepath+0x10d)[0x2b6e5a1a870d]
/usr/lib64/apache2/mod_php5.so(_php_stream_fopen+0x4d)[0x2b6e5a1bbaad]
/usr/lib64/apache2/mod_php5.so(_php_stream_fopen_with_path+0x91)[0x2b6e5a1bc451]
/usr/lib64/apache2/mod_php5.so(_php_stream_open_wrapper_ex+0xdd)[0x2b6e5a1b74ed]
/usr/lib64/apache2/mod_php5.so(php_stream_open_for_zend_ex+0x1f)[0x2b6e5a1a300f]
/usr/lib64/apache2/mod_php5.so(zend_stream_fixup+0x2c)[0x2b6e5a1fa1ec]
/usr/lib64/apache2/mod_php5.so(open_file_for_scanning+0x1b)[0x2b6e5a1c597b]
/usr/lib64/apache2/mod_php5.so(compile_file+0x8d)[0x2b6e5a1c5ced]
/lib64/libgcc_s.so.1[0x2b6e5af9d8fc]
[0x55816240]


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