Doc-Bug #65441 [Opn]: configure help not correct (--enable-fastcgi)

2013-10-03 Thread krakjoe
Edit report at https://bugs.php.net/bug.php?id=65441edit=1

 ID: 65441
 Updated by: krak...@php.net
 Reported by:joe at winett dot com
 Summary:configure help not correct (--enable-fastcgi)
 Status: Open
-Type:   Documentation Problem
+Type:   Bug
-Package:Documentation problem
+Package:*Configuration Issues
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

Can someone with enough (historical) knowledge of configure please update this 
information in the manual.

While it is a documentation problem, it requires the knowledge of a core 
contributor that has been around a while.


Previous Comments:

[2013-08-13 13:47:39] joe at winett dot com

Description:

---
From manual page: http://www.php.net/configure.about
---

--enable-fastcgi description states that as of 5.3.0 you must use --enable-cgi 
instead, but actually it's --disable-cgi to enable fastcgi








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


Doc-Req #65503 [Opn]: Timeout when max_children reached

2013-10-03 Thread krakjoe
Edit report at https://bugs.php.net/bug.php?id=65503edit=1

 ID: 65503
 Updated by: krak...@php.net
 Reported by:admin at 3dr dot org
 Summary:Timeout when max_children reached
 Status: Open
-Type:   Documentation Problem
+Type:   Feature/Change Request
 Package:FPM related
 Operating System:   FreeBSD 9.1
 PHP Version:5.4.18
 Block user comment: N
 Private report: N

 New Comment:

This should have the attention of developers, it appears to be a feature 
request.


Previous Comments:

[2013-08-22 13:48:23] admin at 3dr dot org

Description:

I couldn't found if there is any param to specify a timeout after which FPM 
will 
return some error when there is no children left (reached max_children).
There should be some timeout ofert which FPM will deny request and return error 
to 
the client.
Changing timeout on client side is not an option.







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


Bug #60633 [Com]: build warning

2013-10-03 Thread r...@php.net
Edit report at https://bugs.php.net/bug.php?id=60633edit=1

 ID: 60633
 Comment by: r...@php.net
 Reported by:fedora at famillecollet dot com
 Summary:build warning
 Status: Open
 Type:   Bug
 Package:BC math related
 Operating System:   GNU/Linux (Fedora 16)
 PHP Version:5.4SVN-2012-01-01 (snap)
 Block user comment: N
 Private report: N

 New Comment:

@Mike, I can't find upstream for this library...

So I don't know if we can fix those trivial build warning in the php tree 
(the reason why I kept this bug open, while I can have commit the patch)


Previous Comments:

[2013-10-02 09:39:06] m...@php.net

Nevermind the last comment.


[2013-10-02 09:27:26] m...@php.net

Do we already patch this lib, or is it untouched?


[2012-01-01 08:32:23] fedora at famillecollet dot com

Description:

Build warning

Test script:
---
make

Expected result:

No warning


Actual result:
--
/home/rpmbuild/BUILD/php5.4-201112300630/ext/bcmath/libbcmath/src/recmul.c: In 
function '_bc_rec_mul':
/home/rpmbuild/BUILD/php5.4-201112300630/ext/bcmath/libbcmath/src/recmul.c:186:14:
 warning: variable 'v0len' set but not used [-Wunused-but-set-variable]
/home/rpmbuild/BUILD/php5.4-201112300630/ext/bcmath/libbcmath/src/recmul.c:186:7:
 warning: variable 'u0len' set but not used [-Wunused-but-set-variable]







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


Bug #60633 [Opn]: build warning

2013-10-03 Thread mike
Edit report at https://bugs.php.net/bug.php?id=60633edit=1

 ID: 60633
 Updated by: m...@php.net
 Reported by:fedora at famillecollet dot com
 Summary:build warning
 Status: Open
 Type:   Bug
 Package:BC math related
 Operating System:   GNU/Linux (Fedora 16)
 PHP Version:5.4SVN-2012-01-01 (snap)
 Block user comment: N
 Private report: N

 New Comment:

Haha, I couldn't either... :)
Anyway the lib source is full of PHP macros, so I think it's pretty fine if you 
fix those at hand!


Previous Comments:

[2013-10-03 06:27:04] r...@php.net

@Mike, I can't find upstream for this library...

So I don't know if we can fix those trivial build warning in the php tree 
(the reason why I kept this bug open, while I can have commit the patch)


[2013-10-02 09:39:06] m...@php.net

Nevermind the last comment.


[2013-10-02 09:27:26] m...@php.net

Do we already patch this lib, or is it untouched?


[2012-01-01 08:32:23] fedora at famillecollet dot com

Description:

Build warning

Test script:
---
make

Expected result:

No warning


Actual result:
--
/home/rpmbuild/BUILD/php5.4-201112300630/ext/bcmath/libbcmath/src/recmul.c: In 
function '_bc_rec_mul':
/home/rpmbuild/BUILD/php5.4-201112300630/ext/bcmath/libbcmath/src/recmul.c:186:14:
 warning: variable 'v0len' set but not used [-Wunused-but-set-variable]
/home/rpmbuild/BUILD/php5.4-201112300630/ext/bcmath/libbcmath/src/recmul.c:186:7:
 warning: variable 'u0len' set but not used [-Wunused-but-set-variable]







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


Bug #60633 [Opn-Csd]: build warning

2013-10-03 Thread remi
Edit report at https://bugs.php.net/bug.php?id=60633edit=1

 ID: 60633
 Updated by: r...@php.net
 Reported by:fedora at famillecollet dot com
 Summary:build warning
-Status: Open
+Status: Closed
 Type:   Bug
 Package:BC math related
 Operating System:   GNU/Linux (Fedora 16)
 PHP Version:5.4SVN-2012-01-01 (snap)
 Block user comment: N
 Private report: N

 New Comment:

Automatic comment on behalf of remi
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=60d9175280cbab5967966e38f42fced854d10408
Log: Fix Bug #60633 build warning in bcmath


Previous Comments:

[2013-10-03 06:34:03] m...@php.net

Haha, I couldn't either... :)
Anyway the lib source is full of PHP macros, so I think it's pretty fine if you 
fix those at hand!


[2013-10-03 06:27:04] r...@php.net

@Mike, I can't find upstream for this library...

So I don't know if we can fix those trivial build warning in the php tree 
(the reason why I kept this bug open, while I can have commit the patch)


[2013-10-02 09:39:06] m...@php.net

Nevermind the last comment.


[2013-10-02 09:27:26] m...@php.net

Do we already patch this lib, or is it untouched?


[2012-01-01 08:32:23] fedora at famillecollet dot com

Description:

Build warning

Test script:
---
make

Expected result:

No warning


Actual result:
--
/home/rpmbuild/BUILD/php5.4-201112300630/ext/bcmath/libbcmath/src/recmul.c: In 
function '_bc_rec_mul':
/home/rpmbuild/BUILD/php5.4-201112300630/ext/bcmath/libbcmath/src/recmul.c:186:14:
 warning: variable 'v0len' set but not used [-Wunused-but-set-variable]
/home/rpmbuild/BUILD/php5.4-201112300630/ext/bcmath/libbcmath/src/recmul.c:186:7:
 warning: variable 'u0len' set but not used [-Wunused-but-set-variable]







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


Bug #65809 [Com]: interface, abstract static function

2013-10-03 Thread phpmpan at mpan dot pl
Edit report at https://bugs.php.net/bug.php?id=65809edit=1

 ID: 65809
 Comment by: phpmpan at mpan dot pl
 Reported by:spam at krol dot me
 Summary:interface, abstract static function
 Status: Open
 Type:   Bug
 Package:Class/Object related
 PHP Version:5.3.15
 Block user comment: N
 Private report: N

 New Comment:

I haven't noticed this, as the case doesn't produce an error, but only a 
E_STRICT level message. Ok, hence the report is now valid.

However, be aware that the issue was already discussed and I believe this 
message is the source of the patch that removed abstract static 7 years ago: 
http://marc.info/?l=php-internalsm=114120699223033w=2


Previous Comments:

[2013-10-03 05:21:40] spam at krol dot me

And use this test case. It don't make use of constructor

Test script:
---

abstract class A { abstract static function aa(); } //invalid
//Strict Standards: Static function A::aa() should not be abstract in php shell 
code on line 1

interface I { static function ii(); } //valid
abstract class B implements I {} //valid
//class C extends B{} // invalid
//Fatal error: Class C contains 1 abstract method and must therefore be 
declared abstract or implement the remaining methods (I::i) in php shell code 
on line 1

class D extends B{
static function ii(){echo I have to be implemented; }
}


[2013-10-03 05:10:24] spam at krol dot me

I changed PHP version as it IS revelant

According to this

http://php.net/manual/en/migration52.incompatible.php

Dropped abstract static class functions. Due to an oversight, PHP 5.0.x and 
5.1.x allowed abstract static functions in classes. As of PHP 5.2.x, only 
interfaces can have them.


[2013-10-02 23:43:36] phpmpan at mpan dot pl

Abstract static methods are allowed. Abstract static *constructors* aren't.


[2013-10-02 10:58:34] spam at krol dot me

Description:

abstract static function in class isn't allowed,
but you can define static function in interface

This leads to funny inconsistency where you can create abstract static function 
using interfaces



Test script:
---
//abstract class A { abstract static function a(); } //invalid

interface I { static function i(); } //valid
abstract class B implements I {} //valid
//class C extends B{} // invalid
//Fatal error: Class C contains 1 abstract method and must therefore be 
declared abstract or implement the remaining methods (I::i) in php shell code 
on line 1

class D extends B{
static function i(){echo I have to be implemented; }
}







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


Bug #65446 [Fbk-NoF]: disk_total_space doesn't work with LVM

2013-10-03 Thread remi
Edit report at https://bugs.php.net/bug.php?id=65446edit=1

 ID: 65446
 Updated by: r...@php.net
 Reported by:puciek at gmail dot com
 Summary:disk_total_space doesn't work with LVM
-Status: Feedback
+Status: No Feedback
 Type:   Bug
 Package:Filesystem function related
 Operating System:   Centos, Gentoo, Ubuntu
 PHP Version:5.4.17
 Block user comment: N
 Private report: N

 New Comment:

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to Re-Opened. Thank you.




Previous Comments:

[2013-08-27 11:25:19] r...@php.net

I means which exact value for directory option.

If you use /dev/mapper/batty-root which is only a file (ok, a special one) it 
will report about space in /dev (so 4G)

If you use / it will report about space in /


[2013-08-27 10:29:08] puciek at gmail dot com

Director inside LVM share which we want to measure


[2013-08-27 09:30:06] r...@php.net

I was asking for the option given to the disk_total_space call.


[2013-08-27 08:29:57] puciek at gmail dot com

df with parameter -h changes the output data from bytes to more human 
readable 
format 
-h, --human-readable
  print sizes in human readable format (e.g., 1K 234M 2G)


[2013-08-27 08:26:32] r...@php.net

I cannot reproduce, tested with
PHP 5.4.19 / RHEL-6
PHP 5.5.3 / Fedora 19

As this function is a simple wrapper other the statvfs (or statfs), I don't 
think of a PHP bug.

What is the option used in the test call ?




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

https://bugs.php.net/bug.php?id=65446


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


Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset

2013-10-03 Thread support at playnext dot ru
Edit report at https://bugs.php.net/bug.php?id=61354edit=1

 ID: 61354
 Comment by: support at playnext dot ru
 Reported by:hufeng1987 at gmail dot com
 Summary:htmlentities and htmlspecialchars doesn't respect
 the default_charset
 Status: Not a bug
 Type:   Bug
 Package:Strings related
 Operating System:   Linux/Windows/
 PHP Version:5.4.0
 Block user comment: N
 Private report: N

 New Comment:

For those still looking for a solution around this headache - pls consider:
1. http://php.net/manual/en/function.override-function.php
2. http://php.net/manual/ru/function.runkit-function-redefine.php

The idea - you override the built-in htmlspecialchars() function with your 
customized variant which is able to respect non UTF-8 default encoding. This 
small piece of code can be then easily inserted somewhere at the start of yout 
project. No need to rewrite all htmlspecialchars() entries globally.

I've spent several hours with both approaches. Variant 1 looks good especaially 
in combination with http://www.php.net/manual/en/function.rename-function.php 
as it allows to call original htmlspecialchars() with just altered default 
args. The code could be as follows:

rename_function('htmlspecialchars', 'renamed_htmlspecialchars');
function overriden_htmlspecialchars($string, $flags=NULL, $encoding='cp1251', 
$double_encode=true) {
$flags = $flags ? $flags : (ENT_COMPAT|ENT_HTML401);
return renamed_htmlspecialchars($string, $flags, $encoding, 
$double_encode);
}
override_function('htmlspecialchars', '$string, $flags, $encoding, 
$double_encode', 'return overriden_htmlspecialchars($string, $flags, $encoding, 
$double_encode);');
?

Unfortunatelly this didn't work for me properly - my site managed to call 
overriden function but not every time I reloaded the pages. Moreover other PHP 
sites crashed under my Apache server as they suddenly started blaming 
htmlspecialchars() was not defined. I suppose I had to spend more time to make 
it work thread/request/site/whatever-safe.

So I switched to runkit (variant 2). It worked for me, although even after 
trying runkit_function_rename()+runkit_function_add() I didn't managed to 
recall original htmlspecialchars() function. So as a quick solution I decided 
to call htmlentities() instead:

?php
function overriden_htmlspecialchars($string, $flags=NULL, $encoding='UTF-8', 
$double_encode=true) {
$flags = $flags ? $flags : (ENT_COMPAT|ENT_HTML401);
$encoding = $encoding ? $encoding : 'cp1251';
//return renamed_htmlspecialchars($string, $flags, $encoding, 
$double_encode);
return htmlentities($string, $flags, $encoding, $double_encode);
}
runkit_function_redefine('htmlspecialchars', '$string, $flags, $encoding, 
$double_encode', 'return overriden_htmlspecialchars($string, $flags, $encoding, 
$double_encode);'); 
?

You may be able to implement your more powerfull overriden function.
Sorry, if this topic is not bug-related. I support all the reports here - a 
small update to the default behaviour ruined our days...
Thank you.


Previous Comments:

[2013-09-17 08:48:26] b83 at yandex dot ru

Moreover it will be impossible to upgrade to newer OS versions and use PHP 
versions from distro. Which is even more a security issue.

http://askubuntu.com/questions/306487/install-php-5-3-on-ubuntu-13-04


[2013-07-25 19:18:45] a...@php.net

Related To: Bug #63426


[2013-07-20 12:49:28] stemind at gmail dot com

Zend should be convinced. The Zend htmlspecialchars Initiative 
http://ufive.ch/tzhi/


[2013-07-12 13:15:06] kstirn at gmail dot com

Instead of moving on to PHP 5.4 and PHP 5.5 thousands of servers will stay with 
legacy PHP 5.3 due to this single, easy to solve (ini setting) issue that the 
PHP team has decided to ignore.


[2013-07-12 10:57:40] tototation at gmail dot com

Yes, i'm interested too to understand that fact.
I recently upgrade my server, and ALL my code is unusable !
A search in code found +470 000 words htmlentities or htmlspecialchars !
HOW TO CHANGE ALL THIS ? THAT'S IMPOSSIBLE 

Thanks, we must stop all our services and websites.
Just for a stupid thing.




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

https://bugs.php.net/bug.php?id=61354


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


Bug #65815 [Com]: ZipArchive reads filenames with UTF-8 characters wrong

2013-10-03 Thread matti dot jarvinen at nitroid dot fi
Edit report at https://bugs.php.net/bug.php?id=65815edit=1

 ID: 65815
 Comment by: matti dot jarvinen at nitroid dot fi
 Reported by:matti dot jarvinen at nitroid dot fi
 Summary:ZipArchive reads filenames with UTF-8 characters
 wrong
 Status: Open
 Type:   Bug
 Package:Zip Related
 Operating System:   Fedora 3.8.6-203.fc18.x86_64
 PHP Version:5.4.20
 Block user comment: N
 Private report: N

 New Comment:

If zip file contains following files:

test3/12-päivä.pdf
test3/ä中华人民共和国.PDF
test3/Российская Федерация.PDF
test3/中华人民共和国.PDF


ZipArchive will read them as:

test3/12-p�iv�.pdf
test3/ä中华人民共和国.PDF
test3/Российская Федерация.PDF
test3/中华人民共和国.PDF

Broken file names can be changed to correct UTF-8 characters with:

?php

// correct UTF-8 should hold together through this
if($filename === mb_convert_encoding(mb_convert_encoding($filename, UTF-32, 
UTF-8), UTF-8, UTF-32))
{
  $fixedFilename = $filename;
}else
{
  // otherwise we should use 
  $fixedFilename = mb_convert_encoding($filename, 'UTF-8','CP850');
}

?

.ZIP File Format Specification Version: 6.3.3 APPENDIX D - Language Encoding 
(EFS) might hold the answers about reading file name encoding correctly from 
the zip file.
http://www.pkware.com/documents/casestudies/APPNOTE.TXT

Codepage if not UTF-8 should be CP437 if I understood correctly from the specs, 
although that encoding is not supported in PHP. I got good results with CP850 
but I cannot verify this with workaround with every character in CP850 and 
CP437.


Previous Comments:

[2013-10-02 15:51:05] matti dot jarvinen at nitroid dot fi

Description:

I have a valid Zip file created with Windows 8 and with iZarc containing 
filenames like 12-päivä.pdf, 13-päivä.pdf

ZipArchive reads filenames wrong.

At least getNameIndex and extractTo are affected.

Test script:
---
?php 
mb_internal_encoding('UTF-8');
ini_set('default_charset', 'UTF-8');

$Zip = new ZipArchive();

$open = $Zip-open('test.zip');

$length = $Zip-numFiles;

for($i = 0; $i  $length; $i++)
{
  $importName = $Zip-getNameIndex($i);

  print $brokenImportName;

  die();

  // this is a specific workaround. Some characters are stuck in ASCII 
apparently
  //$fixedImportName = str_replace(chr(132),'ä',$brokenImportName);

  //print $fixedImportName;
}

?

Expected result:

12-päivä.pdf

Actual result:
--
12-p�iv�.pdf






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


[PHP-BUG] Bug #65825 [NEW]: PDOStatement::fetch() does not throw exception on broken server connection

2013-10-03 Thread cf0hay at gmail dot com
From: cf0hay at gmail dot com
Operating system: Hardened Gentoo Linux 64
PHP version:  5.5.4
Package:  PDO related
Bug Type: Bug
Bug description:PDOStatement::fetch() does not throw exception on broken server 
connection

Description:

Using PDO with mysqlnd driver.

PDO instance was asked to throw exceptions, but calling fetch() after
the TCP connection broke does not throw an exception, it just emits a
warning instead, Empty row packet body.

The server is located on a different computer on the network, cannot use
unix socket to reach it.

Test script:
---
$conn = new PDO(
'mysql:host=192.168.1.2;dbname=somedb;charset=utf8',
'somedbuser',
'somedbpass',
array(
PDO::ATTR_PERSISTENT = false,
PDO::ATTR_EMULATE_PREPARES = false,
PDO::ATTR_ERRMODE = PDO::ERRMODE_EXCEPTION,
PDO::ATTR_STRINGIFY_FETCHES = false,
PDO::ATTR_AUTOCOMMIT = true,
PDO::MYSQL_ATTR_INIT_COMMAND = SET time_zone =
'+00:00',
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY = false,
PDO::MYSQL_ATTR_DIRECT_QUERY = false,
PDO::MYSQL_ATTR_FOUND_ROWS = false,
)
);

$res = $conn-query(
any query which gives back a lot of rows
);
while($row = $res-fetch(PDO::FETCH_ASSOC)){
//during this loop runs, terminate the connection with
something, like iptables
var_export($row);
}
var_export($row);


Expected result:

PDOStatement::fetch() should throw an exception as the server connection
has gone away (trying to do a new PDO::query() after does throw an
exception with that error message).

Actual result:
--
The script above just emits a warning and finishes the loop returning
false the very same way as if there were no more rows left from the
query.

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



Bug #51936 [Asn-Csd]: Crash with clone xmlreader

2013-10-03 Thread mike
Edit report at https://bugs.php.net/bug.php?id=51936edit=1

 ID: 51936
 Updated by: m...@php.net
 Reported by:Keisial at gmail dot com
 Summary:Crash with clone xmlreader
-Status: Assigned
+Status: Closed
 Type:   Bug
 Package:XML Reader
 PHP Version:5.3.2
 Assigned To:rrichards
 Block user comment: N
 Private report: N

 New Comment:

Automatic comment on behalf of mike
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=dc3d360a0ff8c17cb2ce2030813d30b578249be9
Log: typo: really fix bug #51936Crash with clone xmlreader


Previous Comments:

[2010-05-27 20:20:27] johan...@php.net

#0  0xfd7ffb7e92c4 in xmlTextReaderNext () from /lib/64/libxml2.so.2
#1  0x008661f9 in zim_xmlreader_next (ht=0, return_value=0xd77f88, 
return_value_ptr=0x0, this_ptr=0xd79b48, return_value_used=0)
at 
/export/home/johannes/src/php/src/php/php-src/branches/PHP_5_3/ext/xmlreader/php_xmlreader.c:842
#2  0x0093b02e in zend_do_fcall_common_helper_SPEC (
execute_data=0x1025500)
at 
/export/home/johannes/src/php/src/php/php-src/branches/PHP_5_3/Zend/zend_vm_execute.h:313
#3  0x0093bc9d in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (
execute_data=0x1025500)
at 
/export/home/johannes/src/php/src/php/php-src/branches/PHP_5_3/Zend/zend_vm_execute.h:418
#4  0x0093a31d in execute (op_array=0xd77c68)
at 
/export/home/johannes/src/php/src/php/php-src/branches/PHP_5_3/Zend/zend_vm_execute.h:104
#5  0x0090c86a in zend_execute_scripts (type=8, retval=0x0, 
file_count=3)
at 
/export/home/johannes/src/php/src/php/php-src/branches/PHP_5_3/Zend/zend.c:1194
#6  0x008a0c6c in php_execute_script (primary_file=0xfd7fffdff690)
at 
/export/home/johannes/src/php/src/php/php-src/branches/PHP_5_3/main/main.c:2233
#7  0x009e0fe6 in main (argc=1, argv=0xfd7fffdff768)
at 
/export/home/johannes/src/php/src/php/php-src/branches/PHP_5_3/sapi/cli/php_cli.c:1192


[2010-05-27 20:02:39] Keisial at gmail dot com

Description:

Trying to use a cloned xmlreader results in a crash (original one can be used 
fine).

php 5.3.2
libxml2 2.7.7-1


Test script:
---
?php
$xmlreader = new XMLReader();
$xmlreader-xml(ab//a);

$xmlreader-next();
$xmlreader2 = clone $xmlreader;
$xmlreader2-next();


Actual result:
--
Program received signal SIGSEGV, Segmentation fault in 
xmlTextReaderNext__internal_alias ()







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


Bug #65825 [Com]: PDOStatement::fetch() does not throw exception on broken server connection

2013-10-03 Thread cf0hay at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=65825edit=1

 ID: 65825
 Comment by: cf0hay at gmail dot com
 Reported by:cf0hay at gmail dot com
 Summary:PDOStatement::fetch() does not throw exception on
 broken server connection
 Status: Open
 Type:   Bug
 Package:PDO related
 Operating System:   Hardened Gentoo Linux 64
 PHP Version:5.5.4
 Block user comment: N
 Private report: N

 New Comment:

The correct SQLSTATE would be HY000, 2013.


Previous Comments:

[2013-10-03 11:15:25] cf0hay at gmail dot com

Description:

Using PDO with mysqlnd driver.

PDO instance was asked to throw exceptions, but calling fetch() after the TCP 
connection broke does not throw an exception, it just emits a warning instead, 
Empty row packet body.

The server is located on a different computer on the network, cannot use unix 
socket to reach it.

Test script:
---
$conn = new PDO(
'mysql:host=192.168.1.2;dbname=somedb;charset=utf8',
'somedbuser',
'somedbpass',
array(
PDO::ATTR_PERSISTENT = false,
PDO::ATTR_EMULATE_PREPARES = false,
PDO::ATTR_ERRMODE = PDO::ERRMODE_EXCEPTION,
PDO::ATTR_STRINGIFY_FETCHES = false,
PDO::ATTR_AUTOCOMMIT = true,
PDO::MYSQL_ATTR_INIT_COMMAND = SET time_zone = '+00:00',
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY = false,
PDO::MYSQL_ATTR_DIRECT_QUERY = false,
PDO::MYSQL_ATTR_FOUND_ROWS = false,
)
);

$res = $conn-query(
any query which gives back a lot of rows
);
while($row = $res-fetch(PDO::FETCH_ASSOC)){
//during this loop runs, terminate the connection with something, 
like iptables
var_export($row);
}
var_export($row);


Expected result:

PDOStatement::fetch() should throw an exception as the server connection has 
gone away (trying to do a new PDO::query() after does throw an exception with 
that error message).

Actual result:
--
The script above just emits a warning and finishes the loop returning false the 
very same way as if there were no more rows left from the query.






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


Bug #65784 [Com]: Segfault with finally

2013-10-03 Thread r dot wilczek at web-appz dot de
Edit report at https://bugs.php.net/bug.php?id=65784edit=1

 ID: 65784
 Comment by: r dot wilczek at web-appz dot de
 Reported by:r dot wilczek at web-appz dot de
 Summary:Segfault with finally
 Status: Feedback
 Type:   Bug
 Package:*General Issues
 Operating System:   Linux
 PHP Version:5.5.4
 Block user comment: N
 Private report: N

 New Comment:

Here you are ...

/* @var $sql string */
/* @var $expr SomeInterface */
/* @var $ctxt AnotherInterface */

$trx = $this-ctxt-beginTransaction(); // an interface
$memento = $this-ctxt-getMemento();   // can be anything
try {
$this-ctxt-persist(); // don't return or throw exception
return $this-execute($expr, $sql); // return scalar[] or throw 
exception
} finally {
$this-ctxt-setMemento($memento);  // don't return or throw exception
$trx-rollback();   // don't return or throw exception
}

Don't know, if this helps.
What I forgot to mention was, that the segfault occurs, when there is an 
exception thrown from within the try-block.


Previous Comments:

[2013-10-01 22:58:15] ni...@php.net

Could you please post the code as it is actually used (just the part containing 
the finally)? Your backtrace indicates that the segfault happens during an 
argument send, but your code samples do not include any function calls with 
arguments.


[2013-09-29 12:26:34] r dot wilczek at web-appz dot de

(The second core-dump is created without xdebug, to keep things simple)


[2013-09-29 12:25:34] r dot wilczek at web-appz dot de

#0  0x00a41895 in zval_delref_p (pz=0x0) at 
/root/php-5.5.4/php-5.5.4/Zend/zend.h:409
#1  0x00a4330c in zend_pzval_unlock_func (z=0x0, 
should_free=0x7fffa8aa9e90, unref=1) at 
/root/php-5.5.4/php-5.5.4/Zend/zend_execute.c:72
#2  0x00a4341b in _get_zval_ptr_var (var=4294967232, 
execute_data=0x7f1fceaa5098, should_free=0x7fffa8aa9e90) at 
/root/php-5.5.4/php-5.5.4/Zend/zend_execute.c:186
#3  0x00a63e15 in ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER 
(execute_data=0x7f1fceaa5098) at 
/root/php-5.5.4/php-5.5.4/Zend/zend_vm_execute.h:13081
#4  0x00a480cf in execute_ex (execute_data=0x7f1fceaa5098) at 
/root/php-5.5.4/php-5.5.4/Zend/zend_vm_execute.h:363
#5  0x00a48157 in zend_execute (op_array=0x2e129f0) at 
/root/php-5.5.4/php-5.5.4/Zend/zend_vm_execute.h:388
#6  0x009f6785 in zend_call_function (fci=0x7fffa8aaa100, 
fci_cache=0x7fffa8aaa0d0) at 
/root/php-5.5.4/php-5.5.4/Zend/zend_execute_API.c:939
#7  0x0076285c in zim_reflection_method_invokeArgs (ht=2, 
return_value=0x2e3b2d0, return_value_ptr=0x0, this_ptr=0x2e3b450, 
return_value_used=1)
at /root/php-5.5.4/php-5.5.4/ext/reflection/php_reflection.c:3018
#8  0x00a489de in zend_do_fcall_common_helper_SPEC 
(execute_data=0x7f1fceaa49e8) at 
/root/php-5.5.4/php-5.5.4/Zend/zend_vm_execute.h:550
#9  0x00a491b0 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER 
(execute_data=0x7f1fceaa49e8) at 
/root/php-5.5.4/php-5.5.4/Zend/zend_vm_execute.h:685
#10 0x00a480cf in execute_ex (execute_data=0x7f1fceaa49e8) at 
/root/php-5.5.4/php-5.5.4/Zend/zend_vm_execute.h:363
#11 0x00a48157 in zend_execute (op_array=0x7f1fcead9b60) at 
/root/php-5.5.4/php-5.5.4/Zend/zend_vm_execute.h:388
#12 0x00a0a27f in zend_execute_scripts (type=8, retval=0x0, 
file_count=3) at /root/php-5.5.4/php-5.5.4/Zend/zend.c:1318
#13 0x00976e9e in php_execute_script (primary_file=0x7fffa8aad7a0) at 
/root/php-5.5.4/php-5.5.4/main/main.c:2489
#14 0x00ab7ac7 in do_cli (argc=5, argv=0x263beb0) at 
/root/php-5.5.4/php-5.5.4/sapi/cli/php_cli.c:994
#15 0x00ab8bff in main (argc=5, argv=0x263beb0) at 
/root/php-5.5.4/php-5.5.4/sapi/cli/php_cli.c:1378


[2013-09-29 12:18:45] r dot wilczek at web-appz dot de

Description:

The structures
try {
   return foo();
} finally {
   bar();
}

or 

try {
return foo();
} catch (Exception $e) {
throw $e;
} finally {
bar();
}

under some circumstances segfault, whereas the equivalent structure
try {
$result = foo();
bar();
return $result;
} catch (Exception $e) {
bar();
throw $e;
}
works as expected.

Test script:
---
It's hard to reproduce the failure, because it occured within a PHPUnit Mock 
Monster, and I failed to reproduce it with a simple script.

All I can show is the core-dump below, which is produced by a 
try {
   return foo();
} finally {
   bar();
}


Expected result:

No Segmentation fault

Actual result:
--
Segmentation fault

#0  0x00a41895 in zval_delref_p 

Bug #60511 [Opn-Fbk]: XMLReader chokes on mid-size 'single line' documents

2013-10-03 Thread mike
Edit report at https://bugs.php.net/bug.php?id=60511edit=1

 ID: 60511
 Updated by: m...@php.net
 Reported by:r dot altenburg at eti dot uva dot nl
 Summary:XMLReader chokes on mid-size 'single line' documents
-Status: Open
+Status: Feedback
 Type:   Bug
 Package:XML Reader
 Operating System:   Mac OS X 10.6.8
 PHP Version:5.3.8
 Block user comment: N
 Private report: N

 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 fine here, the script spends lots of time in preg_replace.


Previous Comments:

[2011-12-13 15:36:55] r dot altenburg at eti dot uva dot nl

Expected result should be a completely parsed XML file of course...


[2011-12-13 15:35:45] r dot altenburg at eti dot uva dot nl

Description:

I must say in honesty that I have only verified in 5.3.6 and 5.2.17, I have no 
option to verify in the very latest versions.

I have created a script that parses large XML files. Essentially these files 
are 
single line documents without returns between the tags. When running the script 
(see URL), I get a timeout after processing just a few nodes.

Incidentally I had a copy of the same XML file at hand that had been formatted 
for 
readability in BBEdit. To my surprise this version was parsed to the very end! 


Test script:
---
Test script
http://test.etibioinformatics.nl/xmlreader/index.php.zip

Two version of the same XML file
http://test.etibioinformatics.nl/xmlreader/xml.zip

Expected result:

Timeout







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


Bug #61957 [Opn-Nab]: XMLReader::open(): Unable to open source data i

2013-10-03 Thread mike
Edit report at https://bugs.php.net/bug.php?id=61957edit=1

 ID: 61957
 Updated by: m...@php.net
 Reported by:dean dot sanderson at 3dgroupuk dot com
 Summary:XMLReader::open(): Unable to open source data i
-Status: Open
+Status: Not a bug
 Type:   Bug
 Package:XML Reader
 Operating System:   Windows
 PHP Version:5.3.12
 Block user comment: N
 Private report: N

 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.




Previous Comments:

[2012-05-06 14:05:10] dean dot sanderson at 3dgroupuk dot com

Sorry i did try this before. But to double check i did it again using 
urlencode. Still the same error.

Url give was:
http://images.gwales.com/cgi-bin/xmlif?userid=1password=canolfansql=SELECT%20*%20FROM%20(SELECT%20isbn,%20price_vat,pub_code,available,title,author,publication_date,link_to_marketing,medium,prod_lang_code,c1.CATEGORY_DESCRIPTION%20text_category,c2.CATEGORY_DESCRIPTION%20text_sub_category,DESC1,DESC2,PROD_SIZE,PAGES,%20row_number()%20OVER%20(ORDER%20BY%20ISBN)%20rn%20FROM%20PRODUCTS,%20CATEGORIES%20c1,%20CATEGORIES%20c2%20WHERE%20INVALID='N'%20AND%20ORDER_ALLOWED_OME='Y'%20AND%20c1.CATEGORY=PRODUCTS.CATEGORY%20AND%20c2.CATEGORY=PRODUCTS.SUB_CATEGORY)%20WHERE%20rn%20BETWEEN%201%20and%205%20ORDER%20BY%20rn


[2012-05-06 10:44:37] paj...@php.net

Encode the URI correctly and it should work fine.


[2012-05-06 01:15:04] dean dot sanderson at 3dgroupuk dot com

Description:

It seems this function doesn't like long url's

$z = new XMLReader;
$z-open(http://images.gwales.com/cgi-bin/xmlif?userid=1password=canolfansql=SELECT
 * FROM (SELECT isbn, 
price_vat,pub_code,available,title,author,publication_date,link_to_marketing,medium,prod_lang_code,c1.CATEGORY_DESCRIPTION
 text_category,c2.CATEGORY_DESCRIPTION 
text_sub_category,DESC1,DESC2,PROD_SIZE,PAGES, row_number() OVER (ORDER BY 
ISBN) rn FROM PRODUCTS, CATEGORIES c1, CATEGORIES c2 WHERE INVALID='N' AND 
ORDER_ALLOWED_OME='Y' AND c1.CATEGORY=PRODUCTS.CATEGORY AND 
c2.CATEGORY=PRODUCTS.SUB_CATEGORY) WHERE rn BETWEEN 1 and 10 ORDER BY rn);

returns
XMLReader::open(): Unable to open source data 

this error has started to apear since upgrading from php 5.2 to 5.3

Test script:
---
Tried
 $z = new XMLReader;
$z-open(http://www.w3schools.com/xml/cd_catalog.xml;);

works fine.







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


Bug #61587 [Opn-Nab]: XMLReader - invalid schema error using ampersands

2013-10-03 Thread mike
Edit report at https://bugs.php.net/bug.php?id=61587edit=1

 ID: 61587
 Updated by: m...@php.net
 Reported by:ryan dot brothers at gmail dot com
 Summary:XMLReader - invalid schema error using ampersands
-Status: Open
+Status: Not a bug
 Type:   Bug
 Package:XML Reader
 Operating System:   Linux
 PHP Version:5.3.10
 Block user comment: N
 Private report: N

 New Comment:

I'm not an (lib)xml expert, but using LIBXML_NOENT as parsing options for the 
XMLReader aligns the behaviour:

$xmlreader-xml($xml, null, LIBXML_NOENT);


Previous Comments:

[2012-03-31 22:59:01] ryan dot brothers at gmail dot com

Description:

In the following test script, the example xml is valid against the supplied 
schema.  DOMDocument displays no schema errors as expected, but XMLReader 
displays a schema violation.  I was expecting XMLReader to not report any 
schema violations.


Test script:
---
?php
error_reporting(E_ALL);

$xml = 'user name=a amp; b/';

$schema = '?xml version=1.0 encoding=UTF-8?
xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema;
xs:element name=user
xs:complexType
xs:attribute name=name use=required
xs:simpleType
xs:restriction base=xs:string
xs:enumeration value=a amp; 
b/
/xs:restriction
/xs:simpleType
/xs:attribute
/xs:complexType
/xs:element
/xs:schema';

// create temp file with schema
$schema_file = tempnam(sys_get_temp_dir(), '');

file_put_contents($schema_file, $schema);

// test with DOMDocument
$dom = new DOMDocument;
$dom-loadXML($xml);

$dom-schemaValidate($schema_file);

// test with XMLReader
$xmlreader = new XMLReader;
$xmlreader-xml($xml);

$xmlreader-setSchema($schema_file);

while ($xmlreader-read() == true);

$xmlreader-close();

// delete temp file
unlink($schema_file);


Expected result:

No output

Actual result:
--
Warning: XMLReader::read(): Element 'user', attribute 'name': [facet 
'enumeration'] The value 'a #38; b' is not an element of the set {'a  b'}. in 
test.php on line 38

Warning: XMLReader::read(): Element 'user', attribute 'name': 'a #38; b' is 
not a valid value of the local atomic type. in test.php on line 38






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


Bug #55285 [Opn-Csd]: XMLReader::getAttribute/No/Ns methods inconsistency

2013-10-03 Thread mike
Edit report at https://bugs.php.net/bug.php?id=55285edit=1

 ID: 55285
 Updated by: m...@php.net
 Reported by:evoloshchuk at gmail dot com
 Summary:XMLReader::getAttribute/No/Ns methods inconsistency
-Status: Open
+Status: Closed
 Type:   Bug
 Package:XML Reader
 Operating System:   Mac OS X 10.6.3
 PHP Version:5.3.6
 Block user comment: N
 Private report: N

 New Comment:

Automatic comment on behalf of mike
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=c7b1d76eb9d09b0331272143e44e5024468b0fea
Log: fix bug #55285 XMLReader::getAttribute/No/Ns methods inconsistency


Previous Comments:

[2011-07-26 12:18:24] evoloshchuk at gmail dot com

Description:

There are three methods available to retrieve an attribute - getAttribute, 
getAttributeNo, getAttributeNs.
It seems to be natural to expect the similar kind of behavior from them in case 
when no attribute by given parameters is found.
Which is not the case - first one returns NULL, the rest - string(0) .

Test script:
---
?php
  $reader = new XmlReader();
  $reader-xml('?xml version=1.0 encoding=UTF-8?a y= z=1/a');
  $reader-read();
  var_dump($reader-getAttribute('x'));
  var_dump($reader-getAttributeNs('x', 'http://example.com'));
  var_dump($reader-getAttributeNo(2));
?

Expected result:

NULL
NULL
NULL

Actual result:
--
NULL
string(0) 
string(0) 






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


[PHP-BUG] Bug #65827 [NEW]: error passing mysqli_fetch_assoc results back

2013-10-03 Thread ilantipov at gmail dot com
From: ilantipov at gmail dot com
Operating system: Ubuntu 12.04.1 LTS
PHP version:  5.4.20
Package:  MySQLi related
Bug Type: Bug
Bug description:error passing mysqli_fetch_assoc results back

Description:

mysqli_fetch_assoc($query_id) gives results, but 
$row2 = $db-sql_fetchrow($result));
print_r($row2);
does not

Test script:
---
I am using phpbb3 while running a query 
when I use this code 
$query = SELECT t.forum_id, count(topic_id) AS count_sticky FROM
phpbb_topics as t, phpbb_prices_forums as f WHERE t.forum_id=f.forum_id
AND f.forum_id IN (509, 545, 25, 45, 543, 20, 35, 487, 223, 288, 224,
256) AND topic_type=1 and topic_sticky_flag  0 GROUP BY t.forum_id
HAVING count_sticky 5;
if ($result = mysqli_query($link, $query)) {
  
while ($row = mysqli_fetch_row($result)) {
printf (%s (%s)\n, $row[0], $row[1]);
}
}

I get 
256 (4)
543 (1)

Which is ok. But when I'm using this code 
$result  = $db-sql_query($sql);
while($row2 = $db-sql_fetchrow($result));
{
print($row2);
}

I get nothing. And gettype($row2) gives NULL

$db-sql_fetchrow in minimal configuration to reproduce a bug is:

function sql_fetchrow($query_id = false)
{

return mysqli_fetch_assoc($query_id);
}

If I rewrite my code to 
$result  = $db-sql_query($sql);

print_r($db-sql_fetchrow($result));
print_r($db-sql_fetchrow($result));

I get
Array
(
[forum_id] = 256
[count_sticky] = 4
)
Array
(
[forum_id] = 543
[count_sticky] = 1
)

The other variant of code:
$result  = $db-sql_query($sql);

$row2 = $db-sql_fetchrow($result);
print_r($row2);
$row2 = $db-sql_fetchrow($result);
print_r($row2);

Gives good results as well. It works as acpected.

So the bug occures only in this case - when passing back results to
'while' loop as a result of other function. All other queries work
perfect on a production server. And I have the same issues on 2 servers
with PHP 5.4.17 and PHP 5.4.20 running.

Any other info can be sent if needed.


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



Bug #65827 [Opn]: error passing mysqli_fetch_assoc results back

2013-10-03 Thread ilantipov at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=65827edit=1

 ID: 65827
 User updated by:ilantipov at gmail dot com
 Reported by:ilantipov at gmail dot com
 Summary:error passing mysqli_fetch_assoc results back
 Status: Open
 Type:   Bug
 Package:MySQLi related
 Operating System:   Ubuntu 12.04.1 LTS
 PHP Version:5.4.20
 Block user comment: N
 Private report: N

 New Comment:

php configure options  ./configure   --enable-fpm   --enable-libxml   
--with-mcrypt   --enable-mbstring   --with-gd   --with-mysql-sock   
--with-mysqli=mysqlnd   --with-pdo-mysql=mysqlnd   --with-mysql=mysqlnd   
--enable-sockets   --with-iconv   --with-gettext   --with-zlib   
--with-freetype-dir=/usr   --with-jpeg-dir=/usr   --prefix=/usr/local/php-fpm   
--with-config-file-path=/usr/local/php-fpm/etc   
--with-config-file-scan-dir=/usr/local/php-fpm/etc/conf.d   
--with-fpm-user=www-data   --with-fpm-group=www-data   --disable-simplexml   
--disable-xmlreader   --disable-xmlwriter   --disable-tokenizer   
--without-sqlite3   --without-pdo-sqlite   --with-curl


Previous Comments:

[2013-10-03 15:10:02] ilantipov at gmail dot com

Description:

mysqli_fetch_assoc($query_id) gives results, but 
$row2 = $db-sql_fetchrow($result));
print_r($row2);
does not

Test script:
---
I am using phpbb3 while running a query 
when I use this code 
$query = SELECT t.forum_id, count(topic_id) AS count_sticky FROM phpbb_topics 
as t, phpbb_prices_forums as f WHERE t.forum_id=f.forum_id AND f.forum_id IN 
(509, 545, 25, 45, 543, 20, 35, 487, 223, 288, 224, 256) AND topic_type=1 and 
topic_sticky_flag  0 GROUP BY t.forum_id HAVING count_sticky 5;
if ($result = mysqli_query($link, $query)) {
  
while ($row = mysqli_fetch_row($result)) {
printf (%s (%s)\n, $row[0], $row[1]);
}
}

I get 
256 (4)
543 (1)

Which is ok. But when I'm using this code 
$result  = $db-sql_query($sql);
while($row2 = $db-sql_fetchrow($result));
{
print($row2);
}

I get nothing. And gettype($row2) gives NULL

$db-sql_fetchrow in minimal configuration to reproduce a bug is:

function sql_fetchrow($query_id = false)
{

return mysqli_fetch_assoc($query_id);
}

If I rewrite my code to 
$result  = $db-sql_query($sql);

print_r($db-sql_fetchrow($result));
print_r($db-sql_fetchrow($result));

I get
Array
(
[forum_id] = 256
[count_sticky] = 4
)
Array
(
[forum_id] = 543
[count_sticky] = 1
)

The other variant of code:
$result  = $db-sql_query($sql);

$row2 = $db-sql_fetchrow($result);
print_r($row2);
$row2 = $db-sql_fetchrow($result);
print_r($row2);

Gives good results as well. It works as acpected.

So the bug occures only in this case - when passing back results to 'while' 
loop as a result of other function. All other queries work perfect on a 
production server. And I have the same issues on 2 servers with PHP 5.4.17 and 
PHP 5.4.20 running.

Any other info can be sent if needed.







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


Bug #65822 [Com]: crash on shutdown because of zend extension cleanup order

2013-10-03 Thread askalski at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=65822edit=1

 ID: 65822
 Comment by: askalski at gmail dot com
 Reported by:askalski at gmail dot com
 Summary:crash on shutdown because of zend extension cleanup
 order
 Status: Open
 Type:   Bug
 Package:Reproducible crash
 Operating System:   Linux
 PHP Version:5.4.20
 Block user comment: N
 Private report: N

 New Comment:

Spent some time digging into this.  It's not as simple as calling 
zend_shutdown_extensions before zend_destroy_modules; there are a few issues at 
play which complicate matters.

The two Zend Extensions I investigated (OpCache and XDebug) implement both the 
zend_extension and zend_module API.  Both of these extensions load the 
zend_module portion by calling zend_startup_module in the zend_extension 
startup function.  Also, it is possible to load modules at runtime using the 
dl() userland function.

Consequently, the shutdown order is not a simple matter of extensions first, 
then modules.  Because startup order of extensions and modules can be 
interleaved, this precise order must be recorded during initialization.  The 
implementation might be something as simple as a stack of enumerated values: { 
MODULE, MODULE, MODULE, MODULE, EXTENSION, MODULE, EXTENSION, MODULE }


Previous Comments:

[2013-10-02 22:09:12] askalski at gmail dot com

Description:

php_module_startup() initializes modules first, extensions second.

However, zend_shutdown() destroys them in the same order (modules first, 
extensions second), rather than in stack order as one would expect.

Furthermore, it seems (based on reading the zend_startup_extensions() 
zend_shutdown_extensions() functions) that if multiple zend extensions are 
loaded, they are destroyed in the wrong order as well.

Multiple modules work fine; they are destroyed in stack order.

To reproduce the issue, load an extension and module which both override the 
same Zend structure.  For example, loading both OpCache 7.0.2 and APC 3.1.13 
will cause a segfault on shutdown because of improper cleanup order of 
orig_interned_strings_start, old_interned_strings_start, and 
compiler_globals.interned_strings_start.

I'm aware that the example sounds like a bizarre combination of modules and 
extensions here; I'm reporting the bug because it points at an issue in PHP 
itself.  The specific use case for loading both APC and OpCache is to use 
OpCache for opcodes and APC with apc.cache_by_default=0 for the 
apc_store/apc_fetch userland functions.


Test script:
---
zend_extension=/usr/lib64/php/modules/opcache.so
extension=apc.so

Load both OpCache and APC in mod_php in Apache prefork mode.  Send SIGTERM to 
one of the workers (or simply send enough requests to make Apache reap the 
worker), and watch for the Segmentation fault in Apache's error_log.


Expected result:

No crash.

Actual result:
--
Segmentation fault.






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


Bug #65827 [Opn-Nab]: error passing mysqli_fetch_assoc results back

2013-10-03 Thread mike
Edit report at https://bugs.php.net/bug.php?id=65827edit=1

 ID: 65827
 Updated by: m...@php.net
 Reported by:ilantipov at gmail dot com
 Summary:error passing mysqli_fetch_assoc results back
-Status: Open
+Status: Not a bug
 Type:   Bug
 Package:MySQLi related
 Operating System:   Ubuntu 12.04.1 LTS
 PHP Version:5.4.20
 Block user comment: N
 Private report: N

 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.




Previous Comments:

[2013-10-03 15:43:58] ilantipov at gmail dot com

php configure options  ./configure   --enable-fpm   --enable-libxml   
--with-mcrypt   --enable-mbstring   --with-gd   --with-mysql-sock   
--with-mysqli=mysqlnd   --with-pdo-mysql=mysqlnd   --with-mysql=mysqlnd   
--enable-sockets   --with-iconv   --with-gettext   --with-zlib   
--with-freetype-dir=/usr   --with-jpeg-dir=/usr   --prefix=/usr/local/php-fpm   
--with-config-file-path=/usr/local/php-fpm/etc   
--with-config-file-scan-dir=/usr/local/php-fpm/etc/conf.d   
--with-fpm-user=www-data   --with-fpm-group=www-data   --disable-simplexml   
--disable-xmlreader   --disable-xmlwriter   --disable-tokenizer   
--without-sqlite3   --without-pdo-sqlite   --with-curl


[2013-10-03 15:10:02] ilantipov at gmail dot com

Description:

mysqli_fetch_assoc($query_id) gives results, but 
$row2 = $db-sql_fetchrow($result));
print_r($row2);
does not

Test script:
---
I am using phpbb3 while running a query 
when I use this code 
$query = SELECT t.forum_id, count(topic_id) AS count_sticky FROM phpbb_topics 
as t, phpbb_prices_forums as f WHERE t.forum_id=f.forum_id AND f.forum_id IN 
(509, 545, 25, 45, 543, 20, 35, 487, 223, 288, 224, 256) AND topic_type=1 and 
topic_sticky_flag  0 GROUP BY t.forum_id HAVING count_sticky 5;
if ($result = mysqli_query($link, $query)) {
  
while ($row = mysqli_fetch_row($result)) {
printf (%s (%s)\n, $row[0], $row[1]);
}
}

I get 
256 (4)
543 (1)

Which is ok. But when I'm using this code 
$result  = $db-sql_query($sql);
while($row2 = $db-sql_fetchrow($result));
{
print($row2);
}

I get nothing. And gettype($row2) gives NULL

$db-sql_fetchrow in minimal configuration to reproduce a bug is:

function sql_fetchrow($query_id = false)
{

return mysqli_fetch_assoc($query_id);
}

If I rewrite my code to 
$result  = $db-sql_query($sql);

print_r($db-sql_fetchrow($result));
print_r($db-sql_fetchrow($result));

I get
Array
(
[forum_id] = 256
[count_sticky] = 4
)
Array
(
[forum_id] = 543
[count_sticky] = 1
)

The other variant of code:
$result  = $db-sql_query($sql);

$row2 = $db-sql_fetchrow($result);
print_r($row2);
$row2 = $db-sql_fetchrow($result);
print_r($row2);

Gives good results as well. It works as acpected.

So the bug occures only in this case - when passing back results to 'while' 
loop as a result of other function. All other queries work perfect on a 
production server. And I have the same issues on 2 servers with PHP 5.4.17 and 
PHP 5.4.20 running.

Any other info can be sent if needed.







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


[PHP-BUG] Bug #65828 [NEW]: parent::X() triggers child's __call('X'), instead of parent's __call('X')

2013-10-03 Thread stefaan at netlog dot com
From: stefaan at netlog dot com
Operating system: OSX, Ubuntu
PHP version:  5.4.20
Package:  Class/Object related
Bug Type: Bug
Bug description:parent::X() triggers child's __call('X'), instead of parent's 
__call('X')

Description:

In the code example below the parent::getX() call in BB::getX() resolves
to CCC:__call('X') instead of to A:__call('X'), which I would expect.
It seems weird that parent in BB:getX() resolves to CCC, which is not
the parent of BB (it's vice versa) nor CCC.


I get this behavior on PHP 5.3.26, but also PHP 5.4.20

Test script:
---
class A {
public function whoami() { return 'A'; }
public function __call($method, array $args) {
return 'A::__call::' . $method;
}
}
class BB extends A
{
public function whoami() { return 'BB'; }
public function getX() {
return 'BB::getX (FYI: parent is ' . parent::whoami(). ') - ' .
parent::getX() ;
}
}
class CCC extends BB {
public function whoami() { return 'CCC'; }
public function __call($method, array $args) {
return 'CCC::__call::' . $method . ' - ' .
parent::__call($method, $args);
}
}
$c = new CCC();
echo $c-getX() . \n;


Expected result:

BB::getX (FYI: parent is A) - A::__call::getX

Actual result:
--
BB::getX (FYI: parent is A) - CCC::__call::getX - A::__call::getX

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



Bug #47987 [Asn-Csd]: Autoload stops working if E_DEPRECATED occurs

2013-10-03 Thread nikic
Edit report at https://bugs.php.net/bug.php?id=47987edit=1

 ID: 47987
 Updated by: ni...@php.net
 Reported by:acecream1 at hotmail dot com
 Summary:Autoload stops working if E_DEPRECATED occurs
-Status: Assigned
+Status: Closed
 Type:   Bug
 Package:SPL related
 Operating System:   *
 PHP Version:6CVS
 Assigned To:dmitry
 Block user comment: N
 Private report: N

 New Comment:

Fixed in PHP 5.4.21, see https://bugs.php.net/bug.php?id=65322.


Previous Comments:

[2012-06-28 14:40:09] thomas at weinert dot info

This happens if you include/eval() source. It works for other errors like 
E_STRICT or E_NOTICE.

Reproduce code:

?php
function autoload($class) {
  echo Autoloader for $class\n;
  eval('class '.$class.' {} ');
}

function error_handler($severity, $text, $file, $line, $context) {
  $class = 'TRIGGER_AUTOLOAD_'.$severity;
  $object = new $class();
  echo $text.\n;
}

spl_autoload_register('autoload');
set_error_handler('error_handler');

eval('$object = new stdClass();');
?

Expected result:


Autoloader for TRIGGER_AUTOLOAD_8192 
Deprecated: Assigning the return value of new by reference is deprecated

Actual result:


Fatal error: Class 'TRIGGER_AUTOLOAD_8192' not found in 
/path/bug47987.php(17) : eval()'d code on line 1


[2009-05-05 11:06:27] col...@php.net

Your error is triggered at compile-time, which disables autoload (and 
spl_autoload at the same time).

Won't be fixed for PHP5.3 as it may cause lots of other problems.


[2009-04-19 22:30:47] col...@php.net

I believe this is due to the fact that this specific error is 
triggered at compile time, not that it's a E_DEPRECATED. I'll check it 
out.


[2009-04-16 13:22:07] acecream1 at hotmail dot com

Description:

I use my custom error_handler and
when it is called i throw my custom exception which is being autoloaded using 
spl_autoload_register when first error occours.

This works normaly if Notice or Warning occours (did not test all the error 
types) but in case of E_DEPRECATED error the autoload is not called and i this 
reflects in a fatal error becouse my exception class does not exist.

Reproduce code:
---
1. spl_autoload_register(array($class, $method));
2. set_error_handler(array($this, 'handleError'));
3. Params\Store\Get::getInstance($_GET);

//Call-time pass-by-reference has been deprecated 
D:\www\lib\framework\Framework\Params.php on line 25

Expected result:

When E_DEPRECATED error would occour i would expect that all registered 
autoloaders would still function inside the error handler.

Actual result:
--
Fatal error: Class 'Framework\Error\Handler\Exception' not found in 
D:\www\lib\framework\Framework\Params.php on line 25






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


Bug #65827 [Com]: error passing mysqli_fetch_assoc results back

2013-10-03 Thread ilantipov at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=65827edit=1

 ID: 65827
 Comment by: ilantipov at gmail dot com
 Reported by:ilantipov at gmail dot com
 Summary:error passing mysqli_fetch_assoc results back
 Status: Not a bug
 Type:   Bug
 Package:MySQLi related
 Operating System:   Ubuntu 12.04.1 LTS
 PHP Version:5.4.20
 Block user comment: N
 Private report: N

 New Comment:

Ok. I try to reconstruct it other way

$query = SELECT t.forum_id, count(topic_id) AS count_sticky FROM phpbb_topics 
as t, phpbb_prices_forums as f WHERE t.forum_id=f.forum_id AND f.forum_id IN 
(509, 545, 25, 45, 543, 20, 35, 487, 223, 288, 224, 256) AND topic_type=1 and 
topic_sticky_flag  0 GROUP BY t.forum_id HAVING count_sticky 5;
$result = mysqli_query($link, $query) ;
print_r(mysqli_fetch_assoc($result));
print_r(mysqli_fetch_assoc($result));

gives:
Array
(
[forum_id] = 256
[count_sticky] = 4
)
Array
(
[forum_id] = 543
[count_sticky] = 1
)

this code works as well
$query = SELECT t.forum_id, count(topic_id) AS count_sticky FROM phpbb_topics 
as t, phpbb_prices_forums as f WHERE t.forum_id=f.forum_id AND f.forum_id IN 
(509, 545, 25, 45, 543, 20, 35, 487, 223, 288, 224, 256) AND topic_type=1 and 
topic_sticky_flag  0 GROUP BY t.forum_id HAVING count_sticky 5;
$result = mysqli_query($link, $query) ;
$row2 = mysqli_fetch_assoc($result);
print_r($row2);
$row2 = mysqli_fetch_assoc($result);
print_r($row2);

output:
Array
(
[forum_id] = 256
[count_sticky] = 4
)
Array
(
[forum_id] = 543
[count_sticky] = 1
)

BUT 

$query = SELECT t.forum_id, count(topic_id) AS count_sticky FROM phpbb_topics 
as t, phpbb_prices_forums as f WHERE t.forum_id=f.forum_id AND f.forum_id IN 
(509, 545, 25, 45, 543, 20, 35, 487, 223, 288, 224, 256) AND topic_type=1 and 
topic_sticky_flag  0 GROUP BY t.forum_id HAVING count_sticky 5;
$result = mysqli_query($link, $query) ;
echo now ready to get row\n;
while($row2 = mysqli_fetch_assoc($result));
{
echo got row\n;
print($row2);
echo gettype($row2);
}
output is:

now ready to get row
got row
NULL

So here I used only php with no 3rd party sofware or functions. And this IS a 
PHP bug.

Hope this additional hode will make it clear. Thank you for your attention.


Previous Comments:

[2013-10-03 16:01:20] m...@php.net

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.




[2013-10-03 15:43:58] ilantipov at gmail dot com

php configure options  ./configure   --enable-fpm   --enable-libxml   
--with-mcrypt   --enable-mbstring   --with-gd   --with-mysql-sock   
--with-mysqli=mysqlnd   --with-pdo-mysql=mysqlnd   --with-mysql=mysqlnd   
--enable-sockets   --with-iconv   --with-gettext   --with-zlib   
--with-freetype-dir=/usr   --with-jpeg-dir=/usr   --prefix=/usr/local/php-fpm   
--with-config-file-path=/usr/local/php-fpm/etc   
--with-config-file-scan-dir=/usr/local/php-fpm/etc/conf.d   
--with-fpm-user=www-data   --with-fpm-group=www-data   --disable-simplexml   
--disable-xmlreader   --disable-xmlwriter   --disable-tokenizer   
--without-sqlite3   --without-pdo-sqlite   --with-curl


[2013-10-03 15:10:02] ilantipov at gmail dot com

Description:

mysqli_fetch_assoc($query_id) gives results, but 
$row2 = $db-sql_fetchrow($result));
print_r($row2);
does not

Test script:
---
I am using phpbb3 while running a query 
when I use this code 
$query = SELECT t.forum_id, count(topic_id) AS count_sticky FROM phpbb_topics 
as t, phpbb_prices_forums as f WHERE t.forum_id=f.forum_id AND f.forum_id IN 
(509, 545, 25, 45, 543, 20, 35, 487, 223, 288, 224, 256) AND topic_type=1 and 
topic_sticky_flag  0 GROUP BY t.forum_id HAVING count_sticky 5;
if ($result = mysqli_query($link, $query)) {
  
while ($row = mysqli_fetch_row($result)) {
printf (%s (%s)\n, $row[0], $row[1]);
}
}

I get 
256 (4)
543 (1)

Which is ok. But when I'm using this code 
$result  = $db-sql_query($sql);
while($row2 = $db-sql_fetchrow($result));
{
print($row2);
}

I get nothing. And gettype($row2) gives NULL

$db-sql_fetchrow in minimal configuration to reproduce a bug is:

function sql_fetchrow($query_id = false)
{

return mysqli_fetch_assoc($query_id);
}

If I rewrite my code to 
$result  = $db-sql_query($sql);

print_r($db-sql_fetchrow($result));

Bug #65827 [Nab]: error passing mysqli_fetch_assoc results back

2013-10-03 Thread mike
Edit report at https://bugs.php.net/bug.php?id=65827edit=1

 ID: 65827
 Updated by: m...@php.net
 Reported by:ilantipov at gmail dot com
 Summary:error passing mysqli_fetch_assoc results back
 Status: Not a bug
 Type:   Bug
 Package:MySQLi related
 Operating System:   Ubuntu 12.04.1 LTS
 PHP Version:5.4.20
 Block user comment: N
 Private report: N

 New Comment:

You've a dangling semi-colon in your while statement.


Previous Comments:

[2013-10-03 16:41:18] ilantipov at gmail dot com

Ok. I try to reconstruct it other way

$query = SELECT t.forum_id, count(topic_id) AS count_sticky FROM phpbb_topics 
as t, phpbb_prices_forums as f WHERE t.forum_id=f.forum_id AND f.forum_id IN 
(509, 545, 25, 45, 543, 20, 35, 487, 223, 288, 224, 256) AND topic_type=1 and 
topic_sticky_flag  0 GROUP BY t.forum_id HAVING count_sticky 5;
$result = mysqli_query($link, $query) ;
print_r(mysqli_fetch_assoc($result));
print_r(mysqli_fetch_assoc($result));

gives:
Array
(
[forum_id] = 256
[count_sticky] = 4
)
Array
(
[forum_id] = 543
[count_sticky] = 1
)

this code works as well
$query = SELECT t.forum_id, count(topic_id) AS count_sticky FROM phpbb_topics 
as t, phpbb_prices_forums as f WHERE t.forum_id=f.forum_id AND f.forum_id IN 
(509, 545, 25, 45, 543, 20, 35, 487, 223, 288, 224, 256) AND topic_type=1 and 
topic_sticky_flag  0 GROUP BY t.forum_id HAVING count_sticky 5;
$result = mysqli_query($link, $query) ;
$row2 = mysqli_fetch_assoc($result);
print_r($row2);
$row2 = mysqli_fetch_assoc($result);
print_r($row2);

output:
Array
(
[forum_id] = 256
[count_sticky] = 4
)
Array
(
[forum_id] = 543
[count_sticky] = 1
)

BUT 

$query = SELECT t.forum_id, count(topic_id) AS count_sticky FROM phpbb_topics 
as t, phpbb_prices_forums as f WHERE t.forum_id=f.forum_id AND f.forum_id IN 
(509, 545, 25, 45, 543, 20, 35, 487, 223, 288, 224, 256) AND topic_type=1 and 
topic_sticky_flag  0 GROUP BY t.forum_id HAVING count_sticky 5;
$result = mysqli_query($link, $query) ;
echo now ready to get row\n;
while($row2 = mysqli_fetch_assoc($result));
{
echo got row\n;
print($row2);
echo gettype($row2);
}
output is:

now ready to get row
got row
NULL

So here I used only php with no 3rd party sofware or functions. And this IS a 
PHP bug.

Hope this additional hode will make it clear. Thank you for your attention.


[2013-10-03 16:01:20] m...@php.net

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.




[2013-10-03 15:43:58] ilantipov at gmail dot com

php configure options  ./configure   --enable-fpm   --enable-libxml   
--with-mcrypt   --enable-mbstring   --with-gd   --with-mysql-sock   
--with-mysqli=mysqlnd   --with-pdo-mysql=mysqlnd   --with-mysql=mysqlnd   
--enable-sockets   --with-iconv   --with-gettext   --with-zlib   
--with-freetype-dir=/usr   --with-jpeg-dir=/usr   --prefix=/usr/local/php-fpm   
--with-config-file-path=/usr/local/php-fpm/etc   
--with-config-file-scan-dir=/usr/local/php-fpm/etc/conf.d   
--with-fpm-user=www-data   --with-fpm-group=www-data   --disable-simplexml   
--disable-xmlreader   --disable-xmlwriter   --disable-tokenizer   
--without-sqlite3   --without-pdo-sqlite   --with-curl


[2013-10-03 15:10:02] ilantipov at gmail dot com

Description:

mysqli_fetch_assoc($query_id) gives results, but 
$row2 = $db-sql_fetchrow($result));
print_r($row2);
does not

Test script:
---
I am using phpbb3 while running a query 
when I use this code 
$query = SELECT t.forum_id, count(topic_id) AS count_sticky FROM phpbb_topics 
as t, phpbb_prices_forums as f WHERE t.forum_id=f.forum_id AND f.forum_id IN 
(509, 545, 25, 45, 543, 20, 35, 487, 223, 288, 224, 256) AND topic_type=1 and 
topic_sticky_flag  0 GROUP BY t.forum_id HAVING count_sticky 5;
if ($result = mysqli_query($link, $query)) {
  
while ($row = mysqli_fetch_row($result)) {
printf (%s (%s)\n, $row[0], $row[1]);
}
}

I get 
256 (4)
543 (1)

Which is ok. But when I'm using this code 
$result  = $db-sql_query($sql);
while($row2 = $db-sql_fetchrow($result));
{
print($row2);
}

I get nothing. And gettype($row2) gives NULL

$db-sql_fetchrow in minimal configuration to reproduce a bug is:

function sql_fetchrow($query_id = false)
{

   

Bug #65827 [Nab]: error passing mysqli_fetch_assoc results back

2013-10-03 Thread ilantipov at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=65827edit=1

 ID: 65827
 User updated by:ilantipov at gmail dot com
 Reported by:ilantipov at gmail dot com
 Summary:error passing mysqli_fetch_assoc results back
 Status: Not a bug
 Type:   Bug
 Package:MySQLi related
 Operating System:   Ubuntu 12.04.1 LTS
 PHP Version:5.4.20
 Block user comment: N
 Private report: N

 New Comment:

Thank you so much for your patience. That's really a silly mistake, that none 
of 3 programmers noticed and didn't change in their own tests. Thanks a lot.


Previous Comments:

[2013-10-03 17:19:59] m...@php.net

You've a dangling semi-colon in your while statement.


[2013-10-03 16:41:18] ilantipov at gmail dot com

Ok. I try to reconstruct it other way

$query = SELECT t.forum_id, count(topic_id) AS count_sticky FROM phpbb_topics 
as t, phpbb_prices_forums as f WHERE t.forum_id=f.forum_id AND f.forum_id IN 
(509, 545, 25, 45, 543, 20, 35, 487, 223, 288, 224, 256) AND topic_type=1 and 
topic_sticky_flag  0 GROUP BY t.forum_id HAVING count_sticky 5;
$result = mysqli_query($link, $query) ;
print_r(mysqli_fetch_assoc($result));
print_r(mysqli_fetch_assoc($result));

gives:
Array
(
[forum_id] = 256
[count_sticky] = 4
)
Array
(
[forum_id] = 543
[count_sticky] = 1
)

this code works as well
$query = SELECT t.forum_id, count(topic_id) AS count_sticky FROM phpbb_topics 
as t, phpbb_prices_forums as f WHERE t.forum_id=f.forum_id AND f.forum_id IN 
(509, 545, 25, 45, 543, 20, 35, 487, 223, 288, 224, 256) AND topic_type=1 and 
topic_sticky_flag  0 GROUP BY t.forum_id HAVING count_sticky 5;
$result = mysqli_query($link, $query) ;
$row2 = mysqli_fetch_assoc($result);
print_r($row2);
$row2 = mysqli_fetch_assoc($result);
print_r($row2);

output:
Array
(
[forum_id] = 256
[count_sticky] = 4
)
Array
(
[forum_id] = 543
[count_sticky] = 1
)

BUT 

$query = SELECT t.forum_id, count(topic_id) AS count_sticky FROM phpbb_topics 
as t, phpbb_prices_forums as f WHERE t.forum_id=f.forum_id AND f.forum_id IN 
(509, 545, 25, 45, 543, 20, 35, 487, 223, 288, 224, 256) AND topic_type=1 and 
topic_sticky_flag  0 GROUP BY t.forum_id HAVING count_sticky 5;
$result = mysqli_query($link, $query) ;
echo now ready to get row\n;
while($row2 = mysqli_fetch_assoc($result));
{
echo got row\n;
print($row2);
echo gettype($row2);
}
output is:

now ready to get row
got row
NULL

So here I used only php with no 3rd party sofware or functions. And this IS a 
PHP bug.

Hope this additional hode will make it clear. Thank you for your attention.


[2013-10-03 16:01:20] m...@php.net

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.




[2013-10-03 15:43:58] ilantipov at gmail dot com

php configure options  ./configure   --enable-fpm   --enable-libxml   
--with-mcrypt   --enable-mbstring   --with-gd   --with-mysql-sock   
--with-mysqli=mysqlnd   --with-pdo-mysql=mysqlnd   --with-mysql=mysqlnd   
--enable-sockets   --with-iconv   --with-gettext   --with-zlib   
--with-freetype-dir=/usr   --with-jpeg-dir=/usr   --prefix=/usr/local/php-fpm   
--with-config-file-path=/usr/local/php-fpm/etc   
--with-config-file-scan-dir=/usr/local/php-fpm/etc/conf.d   
--with-fpm-user=www-data   --with-fpm-group=www-data   --disable-simplexml   
--disable-xmlreader   --disable-xmlwriter   --disable-tokenizer   
--without-sqlite3   --without-pdo-sqlite   --with-curl


[2013-10-03 15:10:02] ilantipov at gmail dot com

Description:

mysqli_fetch_assoc($query_id) gives results, but 
$row2 = $db-sql_fetchrow($result));
print_r($row2);
does not

Test script:
---
I am using phpbb3 while running a query 
when I use this code 
$query = SELECT t.forum_id, count(topic_id) AS count_sticky FROM phpbb_topics 
as t, phpbb_prices_forums as f WHERE t.forum_id=f.forum_id AND f.forum_id IN 
(509, 545, 25, 45, 543, 20, 35, 487, 223, 288, 224, 256) AND topic_type=1 and 
topic_sticky_flag  0 GROUP BY t.forum_id HAVING count_sticky 5;
if ($result = mysqli_query($link, $query)) {
  
while ($row = mysqli_fetch_row($result)) {
printf (%s (%s)\n, $row[0], $row[1]);
}
}

I get 
256 (4)
543 (1)

Which is ok. But 

Bug #65828 [Opn-Nab]: parent::X() triggers child's __call('X'), instead of parent's __call('X')

2013-10-03 Thread rasmus
Edit report at https://bugs.php.net/bug.php?id=65828edit=1

 ID: 65828
 Updated by: ras...@php.net
 Reported by:stefaan at netlog dot com
 Summary:parent::X() triggers child's __call('X'), instead of
 parent's __call('X')
-Status: Open
+Status: Not a bug
 Type:   Bug
 Package:Class/Object related
 Operating System:   OSX, Ubuntu
 PHP Version:5.4.20
 Block user comment: N
 Private report: N

 New Comment:

That's how classes are composed. There is no bug here. CCC:__call() is the 
active __call() method  for this instance no matter where in the hierarchy you 
are. You can explicitly call other versions of methods via lsb, of course. See 
http://php.net/lsb


Previous Comments:

[2013-10-03 16:02:38] stefaan at netlog dot com

Description:

In the code example below the parent::getX() call in BB::getX() resolves to 
CCC:__call('X') instead of to A:__call('X'), which I would expect.
It seems weird that parent in BB:getX() resolves to CCC, which is not the 
parent of BB (it's vice versa) nor CCC.


I get this behavior on PHP 5.3.26, but also PHP 5.4.20

Test script:
---
class A {
public function whoami() { return 'A'; }
public function __call($method, array $args) {
return 'A::__call::' . $method;
}
}
class BB extends A
{
public function whoami() { return 'BB'; }
public function getX() {
return 'BB::getX (FYI: parent is ' . parent::whoami(). ') - ' . 
parent::getX() ;
}
}
class CCC extends BB {
public function whoami() { return 'CCC'; }
public function __call($method, array $args) {
return 'CCC::__call::' . $method . ' - ' . parent::__call($method, 
$args);
}
}
$c = new CCC();
echo $c-getX() . \n;


Expected result:

BB::getX (FYI: parent is A) - A::__call::getX

Actual result:
--
BB::getX (FYI: parent is A) - CCC::__call::getX - A::__call::getX






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


Bug #61608 [Com]: sem_get problem

2013-10-03 Thread trex_daemon at yahoo dot com
Edit report at https://bugs.php.net/bug.php?id=61608edit=1

 ID: 61608
 Comment by: trex_daemon at yahoo dot com
 Reported by:stephane dot anthoine at gmail dot com
 Summary:sem_get problem
 Status: Open
 Type:   Bug
 Package:Semaphore related
 Operating System:   linux 2.6.32
 PHP Version:5.4.0
 Block user comment: N
 Private report: N

 New Comment:

Actually I have the same problem.
A C process creates the semaphore (with full access: 0666) and then the PHP 
cannot access the semaphore with the same ID. Is there any news on this ?


Previous Comments:

[2012-04-11 16:26:26] zhanglijiu at gmail dot com

what OS do you use? there is the sem_get system function:


PHP_FUNCTION(sem_get)
{
long key, max_acquire = 1, perm = 0666, auto_release = 1;
int semid;
struct sembuf sop[3];
int count;
sysvsem_sem *sem_ptr;

if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
l|lll, 
key, max_acquire, perm, auto_release)) {
RETURN_FALSE;
}

/* Get/create the semaphore.  Note that we rely on the semaphores
 * being zeroed when they are created.  Despite the fact that
 * the(?)  Linux semget() man page says they are not initialized,
 * the kernel versions 2.0.x and 2.1.z do in fact zero them.
 */

semid = semget(key, 3, perm|IPC_CREAT);
if (semid == -1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, failed for key 
0x%lx: %s, key, strerror(errno));
RETURN_FALSE;
}

/* Find out how many processes are using this semaphore.  Note
 * that on Linux (at least) there is a race condition here because
 * semaphore undo on process exit is not atomic, so we could
 * acquire SYSVSEM_SETVAL before a crashed process has decremented
 * SYSVSEM_USAGE in which case count will be greater than it
 * should be and we won't set max_acquire.  Fortunately this
 * doesn't actually matter in practice.
 */

/* Wait for sem 1 to be zero . . . */

sop[0].sem_num = SYSVSEM_SETVAL;
sop[0].sem_op  = 0;
sop[0].sem_flg = 0;

/* . . . and increment it so it becomes non-zero . . . */

sop[1].sem_num = SYSVSEM_SETVAL;
sop[1].sem_op  = 1;
sop[1].sem_flg = SEM_UNDO;

/* . . . and increment the usage count. */

sop[2].sem_num = SYSVSEM_USAGE;
sop[2].sem_op  = 1;
sop[2].sem_flg = SEM_UNDO;
while (semop(semid, sop, 3) == -1) {
if (errno != EINTR) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, failed 
acquiring SYSVSEM_SETVAL for key 0x%lx: %s, key, strerror(errno));
break;
}
}

/* Get the usage count. */
count = semctl(semid, SYSVSEM_USAGE, GETVAL, NULL);
if (count == -1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, failed for key 
0x%lx: %s, key, strerror(errno));
}

/* If we are the only user, then take this opportunity to set the max. 
*/

if (count == 1) {
#if HAVE_SEMUN
/* This is correct for Linux which has union semun. */
union semun semarg;
semarg.val = max_acquire;
if (semctl(semid, SYSVSEM_SEM, SETVAL, semarg) == -1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, failed for 
key 0x%lx: %s, key, strerror(errno));
}
#elif defined(SETVAL_WANTS_PTR)
/* This is correct for Solaris 2.6 which does not have union 
semun. */
if (semctl(semid, SYSVSEM_SEM, SETVAL, max_acquire) == -1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, failed for 
key 0x%lx: %s, key, strerror(errno));
}
#else
/* This works for i.e. AIX */
if (semctl(semid, SYSVSEM_SEM, SETVAL, max_acquire) == -1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, failed for 
key 0x%lx: %s, key, strerror(errno));
}
#endif
}

/* Set semaphore 1 back to zero. */

sop[0].sem_num = SYSVSEM_SETVAL;
sop[0].sem_op  = -1;
sop[0].sem_flg = SEM_UNDO;
while (semop(semid, sop, 1) == -1) {
if (errno != EINTR) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, failed 
releasing SYSVSEM_SETVAL for key 0x%lx: %s, key, strerror(errno));
break;
}
}

sem_ptr = (sysvsem_sem *) emalloc(sizeof(sysvsem_sem));
sem_ptr-key   = key;
sem_ptr-semid = semid;
sem_ptr-count = 0;
sem_ptr-auto_release = auto_release;

sem_ptr-id = ZEND_REGISTER_RESOURCE(return_value, 

Bug #65671 [Asn]: Remove experimental status from six pg_* functions

2013-10-03 Thread yohgaki
Edit report at https://bugs.php.net/bug.php?id=65671edit=1

 ID: 65671
 Updated by: yohg...@php.net
 Reported by:krewecherl at gmail dot com
 Summary:Remove experimental status from six pg_* functions
 Status: Assigned
 Type:   Bug
 Package:PostgreSQL related
 PHP Version:Irrelevant
 Assigned To:yohgaki
 Block user comment: N
 Private report: N

 New Comment:

I have an idea about pg_insert/etc.
I would like to make it more general by using escapes instead of validation for 
each types.

It makes it possible to support various types including user defined types.

I'll write a new RFC for this, hopefully soon.


Previous Comments:

[2013-10-02 07:41:26] m...@php.net

Yasuo, what's your thought on this?


[2013-09-13 21:30:38] krewecherl at gmail dot com

Description:

The following six functions have been added in PHP 4.3:

- pg_convert()
- pg_delete()
- pg_insert()
- pg_meta_data()
- pg_select()
- pg_update()

They been marked as EXPERIMENTAL for close to eleven years now, effectively 
preventing anybody from using them outside of test environments. Ten years is 
too long for an experiment. The functions should either be removed from PHP, or 
moved to a PECL extension, or documented as safe to use.

All of them perform useful tasks, so my personal preference would be the latter 
option.







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


Bug #65199 [Asn]: pg_copy_from() modifies input array variable

2013-10-03 Thread yohgaki
Edit report at https://bugs.php.net/bug.php?id=65199edit=1

 ID: 65199
 Updated by: yohg...@php.net
 Reported by:thuejk at gmail dot com
 Summary:pg_copy_from() modifies input array variable
 Status: Assigned
 Type:   Bug
 Package:PostgreSQL related
 Operating System:   Linux (all?)
 PHP Version:5.5.0
 Assigned To:yohgaki
 Block user comment: N
 Private report: N

 New Comment:

Ok, I will


Previous Comments:

[2013-10-02 07:40:29] m...@php.net

Yasuo, can you have a look, please? Probably just a separation issue.


[2013-07-03 23:04:57] thuejk at gmail dot com

Description:

The variable holding the array of values I pass to pg_copy_from() is modified 
by 
pg_copy_from() (ints are changed to strings). Even though there is no pass-by-
reference involved.

This bug also exists in PHP 5.2 at least.

Test script:
---
?php
function test(Array $values) {
  $params = sprintf(host='%s' dbname='%s' user='%s' password='%s',
localhost,
thue,
thue,
password);
  $connection = pg_pconnect($params, PGSQL_CONNECT_FORCE_NEW);

  pg_query(begin);
  pg_query(CREATE TABLE test(i INTEGER));
  pg_copy_from($connection, test, $values, \t, NULL);
  pg_query(rollback);
}

$values = Array(1,2,3);
var_dump($values);
test($values);
var_dump($values);
?


Expected result:

The two var_dump()s should return identical outputs.

Actual result:
--
t@t ~/php/php-5.5.0 ./sapi/cli/php ~/test.php
array(3) {
  [0]=
  int(1)
  [1]=
  int(2)
  [2]=
  int(3)
}
array(3) {
  [0]=
  string(1) 1
  [1]=
  string(1) 2
  [2]=
  string(1) 3
}







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


Bug #65775 [Com]: Random memory leak between runs with identical data inputs

2013-10-03 Thread clyde dot adams at mailismagic dot com
Edit report at https://bugs.php.net/bug.php?id=65775edit=1

 ID: 65775
 Comment by: clyde dot adams at mailismagic dot com
 Reported by:clyde dot adams at mailismagic dot com
 Summary:Random memory leak between runs with identical data
 inputs
 Status: Feedback
 Type:   Bug
 Package:*General Issues
 Operating System:   OSX Server 10.5.8
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

Update:  Built 5.5.4, ran 'make test', waited forever, and then it spit out 22 
errors.  So, can't deploy 5.5.4.  Filed the report with PHP QA as requested by 
'make test'.

=
FAILED TEST SUMMARY
-
Test DOMDocument::loadXML() detects not-well formed XML 
[ext/dom/tests/DOMDocument_loadXML_error4.phpt]
Test DOMDocument::load() detects not-well formed XML 
[ext/dom/tests/DOMDocument_load_error4.phpt]
DomDocument::schemaValidateSource() - string that is not a schema 
[ext/dom/tests/DOMDocument_schemaValidateSource_error1.phpt]
DomDocument::schemaValidateSource() - non-conforming schema 
[ext/dom/tests/DOMDocument_schemaValidateSource_error2.phpt]
DomDocument::schemaValidate() - file that is not a schema 
[ext/dom/tests/DOMDocument_schemaValidate_error1.phpt]
DomDocument::schemaValidate() - non-conforming schema file 
[ext/dom/tests/DOMDocument_schemaValidate_error2.phpt]
DomDocument::schemaValidate() - non-existent schema file 
[ext/dom/tests/DOMDocument_schemaValidate_error5.phpt]
Bug #42082 (NodeList length zero should be empty) [ext/dom/tests/bug42082.phpt]
Bug #47848 (importNode doesn't preserve attribute namespaces) 
[ext/dom/tests/bug47848.phpt]
Test 5: HTML Test [ext/dom/tests/dom005.phpt]
Test function getservbyname() 
[ext/standard/tests/general_functions/getservbyname_basic.phpt]
Test ceil() - basic function test for ceil() 
[ext/standard/tests/math/ceil_basic.phpt]
Test ip2long() function : usage variation 2, 32 bit 
[ext/standard/tests/network/ip2long_variation2.phpt]
xmlwriter_write_attribute_ns basic function tests 
[ext/xmlwriter/tests/xmlwriter_write_attribute_ns_basic_001.phpt]
xmlwriter_write_attribute_ns with missing param 
[ext/xmlwriter/tests/xmlwriter_write_attribute_ns_error_001.phpt]
xmlwriter_write_dtd basic function tests 
[ext/xmlwriter/tests/xmlwriter_write_dtd_basic_001.phpt]
Bug #52944 (segfault with zlib filter and corrupted data) 
[ext/zlib/tests/bug_52944-darwin.phpt]
Bug #65066 (Cli server not responsive when responding with 422 http status 
code): 100 status code [sapi/cli/tests/bug65066_100.phpt]
Bug #65066 (Cli server not responsive when responding with 422 http status 
code): 422 status code [sapi/cli/tests/bug65066_422.phpt]
Bug #65066 (Cli server not responsive when responding with 422 http status 
code): 511 status code [sapi/cli/tests/bug65066_511.phpt]
basic function [sapi/cli/tests/php_cli_server_001.phpt]
No router, no script [sapi/cli/tests/php_cli_server_013.phpt]
=


Previous Comments:

[2013-09-27 20:35:32] clyde dot adams at mailismagic dot com

According to phpinfo():  zend.enable_gc On

No opcode cache.

Apache/2.2.21 (Unix) PHP/5.3.27 mod_ssl/2.2.21 OpenSSL/1.0.0h

Apache is running PHP as a module.

Unfortunately, I can't upgrade the box to 5.4 (yet).  Also, the test script I 
made doesn't replicate the problem for me either - it merely represents a 
working, pared back example of the data as it is headed into the foreach logic.


[2013-09-27 20:02:41] ras...@php.net

Well, since we no longer support PHP 5.3.x you could at least try to replicate 
in PHP 5.4/5.5 and let us know if you are still able to.

I did a quick test using your provided script and couldn't see any issue.

Also, since I suspect you are only able to see this when running under a web 
server and not from CLI, you should indicate how you are running PHP, whether 
enable_gc is on or off and whether and which opcode you are using. All of which 
could affect this.


[2013-09-27 18:35:28] clyde dot adams at mailismagic dot com

Description:

While we are running PHP 5.3.27 here, I see nothing in the changelog for newer 
versions of PHP that indicates this bug is even possibly fixed.  The code on 
pastebin is a simplification of the scenario.  In my real-world environment, a 
query on a database is run, results are built up in an array in PHP, and then 
boiled down into a second array.  Everything is fine until the inner foreach() 
loop.  At that point, all bets are off as to whether or not PHP will run itself 
out of memory.  The exact same