#48503 [NEW]: invalid conversion from 'void*' to 'zval*' in zend_execute.h

2009-06-09 Thread webmaster at ajeux dot com
From: webmaster at ajeux dot com
Operating system: Linux 2.6.28
PHP version:  5.3CVS-2009-06-09 (CVS)
PHP Bug Type: Compile Failure
Bug description:  invalid conversion from 'void*' to 'zval*' in zend_execute.h

Description:

Latest snapshot (php5.3-200906090830) failed to compile. The same bug is
encountered in php5.3-200906081430.

gcc version 4.3.0 20080428.

It seems bug is related to ext/intl.

Reproduce code:
---
./configure '--with-libdir=lib64' '--enable-zip' '--with-xsl'
'--enable-wddx' '--with-tidy' '--enable-soap' '--with-bz2' '--with-imap'
'--with-imap-ssl' '--with-kerberos' '--with-mysql=mysqlnd'
'--with-mysqli=mysqlnd' '--with-openssl' '--with-pdo-mysql=mysqlnd'
'--with-pdo-sqlite' '--with-pspell' '--with-pgsql' '--with-pdo-pgsql'
'--with-zlib' '--enable-bcmath' '--enable-calendar' '--with-curl'
'--with-curlwrappers' '--enable-dba' '--enable-exif' '--enable-ftp'
'--with-gd' '--with-gmp' '--enable-pcntl' '--enable-shmop'
'--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm'
'--with-xmlrpc' '--with-ldap' '--enable-mbstring' '--with-png-dir'
'--with-jpeg-dir' '--with-xpm-dir' '--with-freetype-dir' '--with-gdbm'
'--with-mcrypt' '--with-gettext' '--with-readline' '--enable-intl'
'--enable-gcov' && make && make test



Expected result:

Make succeed :)

Actual result:
--
In file included from
/usr/src/phptest/php5.3-200906090830/Zend/zend_API.h:30,
 from /usr/src/phptest/php5.3-200906090830/main/php.h:38,
 from ext/intl/php_intl.h:23,
 from
/usr/src/phptest/php5.3-200906090830/ext/intl/msgformat/msgformat_helpers.cpp:26:
/usr/src/phptest/php5.3-200906090830/Zend/zend_execute.h: In function
'void zend_arg_types_stack_2_pop(zend_ptr_stack*, zval**,
zend_function**)':
/usr/src/phptest/php5.3-200906090830/Zend/zend_execute.h:301: error:
invalid conversion from 'void*' to 'zval*'
/usr/src/phptest/php5.3-200906090830/Zend/zend_execute.h:302: error:
invalid conversion from 'void*' to 'zend_function*'
/usr/src/phptest/php5.3-200906090830/Zend/zend_execute.h: In function
'void zend_arg_types_stack_3_pop(zend_ptr_stack*, zend_class_entry**,
zval**, zend_function**)':
/usr/src/phptest/php5.3-200906090830/Zend/zend_execute.h:311: error:
invalid conversion from 'void*' to 'zend_class_entry*'
/usr/src/phptest/php5.3-200906090830/Zend/zend_execute.h:312: error:
invalid conversion from 'void*' to 'zval*'
/usr/src/phptest/php5.3-200906090830/Zend/zend_execute.h:313: error:
invalid conversion from 'void*' to 'zend_function*'
make: *** [ext/intl/msgformat/msgformat_helpers.lo] Error 1


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



#48508 [NEW]: Segfault with "include 'file.phar.bz2'

2009-06-09 Thread webmaster at ajeux dot com
From: webmaster at ajeux dot com
Operating system: Linux 2.6.28
PHP version:  5.3CVS-2009-06-09 (snap)
PHP Bug Type: PHAR related
Bug description:  Segfault with "include 'file.phar.bz2'

Description:

Trying to include a specific .phar leads to a segfault under Linux.

The .phar is a bz2 archive, and very small (just one file inside).
Source of the file can be found here : 
http://uploadfile.org/download.php?id=EqxNUSSdIgcpKKCgrkgG

Bug seems to happen with any .phar.bz2 file.

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



#48508 [Fbk->Opn]: Segfault with "include 'file.phar.bz2'

2009-06-18 Thread webmaster at ajeux dot com
 ID:   48508
 User updated by:  webmaster at ajeux dot com
 Reported By:  webmaster at ajeux dot com
-Status:   Feedback
+Status:   Open
 Bug Type: PHAR related
 Operating System: Linux 2.6.28
 PHP Version:  5.3CVS-2009-06-09 (snap)
 Assigned To:  cellog
 New Comment:

File can be found here : http://www.ajeux.fr/cli.bz2
It contains a single file cli.php

Download this file and launch this:


Now that I'm more familiar with Phar, I'm not sure this is phar
related. I'm just including something that is absolutely not a php
readable file, don't I ?

Same SEGFAULT (ie same line/file) when including a bz2 archive that
contains a file containing the string 'iiiaaaoouu'; (yes, this is not a
php syntax, I can see that ;)   ).

What do you think ?


Previous Comments:


[2009-06-18 18:08:57] cel...@php.net

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

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

Please avoid embedding huge scripts into the report.

I can't reproduce this, and the download link has expired.

Can you also please say from which directory you are running the
script?



[2009-06-18 17:55:36] cel...@php.net

thanks for the heads up, I'll take a look

--------

[2009-06-09 14:22:49] webmaster at ajeux dot com

Description:

Trying to include a specific .phar leads to a segfault under Linux.

The .phar is a bz2 archive, and very small (just one file inside).
Source of the file can be found here : 
http://uploadfile.org/download.php?id=EqxNUSSdIgcpKKCgrkgG

Bug seems to happen with any .phar.bz2 file.

Reproduce code:
---
http://bugs.php.net/?id=48508&edit=1



#45907 [Com]: undefined reference to `PHP_SHA512Init'

2008-09-01 Thread webmaster at ajeux dot com
 ID:   45907
 Comment by:   webmaster at ajeux dot com
 Reported By:  olivier at ajeux dot com
 Status:   Feedback
 Bug Type: PHAR related
 Operating System: Linux i686 2.6.17
 PHP Version:  5.3CVS-2008-08-25 (snap)
 New Comment:

Hello,

Same bug with php5.3-200809011230 (different line number though).

ext/phar/.libs/util.o: In function `phar_create_signature':
/source/php/php5.3-200809011230/ext/phar/util.c:2047: undefined
reference to `PHP_SHA512Init'
/source/php/php5.3-200809011230/ext/phar/util.c:2050: undefined
reference to `PHP_SHA512Update'

[...]


Previous Comments:


[2008-08-29 13:27:38] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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

For Windows (installer):

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





[2008-08-25 10:13:30] olivier at ajeux dot com

Description:

When compiling php5.3-200808250830:

ext/phar/.libs/util.o: In function `phar_create_signature':
/source/php/php5.3-200808250830/ext/phar/util.c:2046: undefined
reference to `PHP_SHA512Init'
/source/php/php5.3-200808250830/ext/phar/util.c:2049: undefined
reference to `PHP_SHA512Update'
/source/php/php5.3-200808250830/ext/phar/util.c:2052: undefined
reference to `PHP_SHA512Final'
/source/php/php5.3-200808250830/ext/phar/util.c:2061: undefined
reference to `PHP_SHA256Init'
/source/php/php5.3-200808250830/ext/phar/util.c:2064: undefined
reference to `PHP_SHA256Update'
/source/php/php5.3-200808250830/ext/phar/util.c:2067: undefined
reference to `PHP_SHA256Final'
ext/phar/.libs/util.o: In function `phar_verify_signature':
/source/php/php5.3-200808250830/ext/phar/util.c:1915: undefined
reference to `PHP_SHA256Init'
/source/php/php5.3-200808250830/ext/phar/util.c:1925: undefined
reference to `PHP_SHA256Update'
/source/php/php5.3-200808250830/ext/phar/util.c:1882: undefined
reference to `PHP_SHA512Init'
/source/php/php5.3-200808250830/ext/phar/util.c:1892: undefined
reference to `PHP_SHA512Update'
/source/php/php5.3-200808250830/ext/phar/util.c:1899: undefined
reference to `PHP_SHA512Final'
/source/php/php5.3-200808250830/ext/phar/util.c:1932: undefined
reference to `PHP_SHA256Final'
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php-cgi] Error 1

Same result with php5.3-200808211030 and all releases since (don't know
if it happened before).


Configure line :
./configure  --prefix=/usr --sysconfdir=/etc/php53
--libdir=/usr/lib/php53 --mandir=/usr/share/man --program-suffix=53
--with-layout=GNU --enable-sigchild --disable-rpath --enable-libxml
--enable-bcmath=shared --enable-calendar=shared --enable-ctype=shared
--enable-dom=shared --enable-exif=shared --enable-filter
--enable-ftp=shared --enable-gd-native-ttf --enable-gd-jis-conv
--enable-hash=shared --enable-json=shared --enable-mbstring=shared
--enable-pcntl=shared --enable-posix=shared --enable-shmop=shared
--enable-simplexml --enable-soap=shared --enable-sockets=shared
--enable-sqlite-utf8 --enable-sysvmsg=shared --enable-sysvsem=shared
--enable-sysvshm=shared --enable-tokenizer=shared --enable-wddx=shared
--enable-xml --enable-xmlreader=shared --enable-xmlwriter=shared
--enable-zip=shared --enable-zend-multibyte --disable-static
--with-libdir=lib --with-openssl=shared --with-pcre-regex=/usr
--with-zlib=shared --with-bz2=shared --with-curl=shared
--with-curlwrappers --with-pcre-dir --with-gd=shared --with-jpeg-dir
--with-png-dir --with-freetype-dir --with-t1lib --with-gettext=shared
--with-iconv=shared --with-imap=shared --with-imap-ssl
--with-ldap=shared --with-ldap-sasl --with-mcrypt=shared
--with-mhash=shared --with-ming=shared --with-mssql=shared
--with-mysql=shared --with-mysqli=shared --enable-pdo=shared
--with-pdo-dblib=shared --with-pdo-mysql=shared --with-pdo-sqlite=shared
--with-pspell=shared --with-readline=shared --with-sqlite=shared
--with-xmlrpc=shared --with-xsl=shared --with-pic








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



#46196 [Com]: restore_error_handler() broken

2008-11-13 Thread webmaster at ajeux dot com
 ID:   46196
 Comment by:   webmaster at ajeux dot com
 Reported By:  php at benjaminschulz dot com
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: *
 PHP Version:  5.3CVS-2008-11-11
 New Comment:

I have tested tagged version in CVS:
php_5_3_0alpha1: OK (no bug)
php_5_3_0alpha2: ERROR (bug happened).

So, it seems this bug was introduced between alpha1 and alpha2.

If you give me a way to export cvs at a precise date, I can adjust when
and where this bug was commited.


Previous Comments:


[2008-11-11 10:42:11] [EMAIL PROTECTED]

Works fine with PHP_5_2, does not with PHP_5_3. 



[2008-10-31 16:05:13] olivier at ajeux dot com

Same bug encountered with php5.3-200810301330, also with a php crash.

Reproduce code:
---
http://bugs.php.net/?id=46196&edit=1



#46196 [Com]: restore_error_handler() broken

2008-11-17 Thread webmaster at ajeux dot com
 ID:   46196
 Comment by:   webmaster at ajeux dot com
 Reported By:  php at benjaminschulz dot com
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: *
 PHP Version:  5.3CVS-2008-11-11
 New Comment:

It seems my diff patch failed to apply on some configurations.
Here is full functions altered in Zend/zend_API.C (end of file, three
functions modified):

ZEND_API void zend_save_error_handling(zend_error_handling *current
TSRMLS_DC) /* {{{ */
{
current->handling = EG(error_handling);
current->exception = EG(exception_class);
}
/* }}} */

ZEND_API void zend_replace_error_handling(zend_error_handling_t
error_handling, zend_class_entry *exception_class, zend_error_handling
*current TSRMLS_DC) /* {{{ */
{
if (current) {
zend_save_error_handling(current TSRMLS_CC);
}
EG(error_handling) = error_handling;
EG(exception_class) = error_handling == EH_THROW ?
exception_class : NULL;
}
/* }}} */

ZEND_API void zend_restore_error_handling(zend_error_handling *saved
TSRMLS_DC) /* {{{ */
{
EG(error_handling) = saved->handling;
EG(exception_class) = saved->handling == EH_THROW ?
saved->exception : NULL;
}
/* }}} */


Previous Comments:


[2008-11-17 10:59:53] webmaster at ajeux dot com

I made a patch to fix this bug and tested it *successfully* on
php5.3-200811170930 (latest snap as I'm writing).

I am not an expert in diff/patch, so syntax may be wrong.

--- Zend/zend_API.c 2008-11-17 11:02:39.0 +0100
+++ Zend/zend_API.c 2008-08-08 19:47:28.0 +0200
@@ -3467,10 +3467,6 @@
 {
current->handling = EG(error_handling);
current->exception = EG(exception_class);
-   current->user_handler = EG(user_error_handler);
-   if (current->user_handler) {
-   Z_ADDREF_P(current->user_handler);
-   }
 }
 /* }}} */

@@ -3478,10 +3474,6 @@
 {
if (current) {
zend_save_error_handling(current TSRMLS_CC);
-   if (error_handling != EH_NORMAL &&
EG(user_error_handler)) {
-   zval_ptr_dtor(&EG(user_error_handler));
-   EG(user_error_handler) = NULL;
-   }
}
EG(error_handling) = error_handling;
EG(exception_class) = error_handling == EH_THROW ?
exception_class : NULL;
@@ -3499,15 +3491,6 @@
 {
EG(error_handling) = saved->handling;
EG(exception_class) = saved->handling == EH_THROW ?
saved->exception : NULL;
-   if (saved->user_handler && saved->user_handler !=
EG(user_error_handler)) {
-   if (EG(user_error_handler)) {
-   zval_ptr_dtor(&EG(user_error_handler));
-   }
-   EG(user_error_handler) = saved->user_handler;
-   } else if (saved->user_handler) {
-   zval_ptr_dtor(&saved->user_handler);
-   }
-   saved->user_handler = NULL;
 }
 /* }}} */



[2008-11-14 16:59:23] olivier at ajeux dot com

I tested several export from CVS and I found when was commited the bug:

2008-08-11 17:00 GMT: OK (no bug)
2008-08-11 17:30 GMT: ERROR (bug happened).

Script used for information:
$ cvs -d :pserver:[EMAIL PROTECTED]:/repository checkout -r PHP_5_3
-D"2008-08-11 17:30 GMT" php-src
$ cd php-src
$ ./buildconf --force && ./configure && make

I hope it can help. This is a major bug for me.

--------

[2008-11-13 17:22:46] webmaster at ajeux dot com

I have tested tagged version in CVS:
php_5_3_0alpha1: OK (no bug)
php_5_3_0alpha2: ERROR (bug happened).

So, it seems this bug was introduced between alpha1 and alpha2.

If you give me a way to export cvs at a precise date, I can adjust when
and where this bug was commited.



[2008-11-11 10:42:11] [EMAIL PROTECTED]

Works fine with PHP_5_2, does not with PHP_5_3. 



[2008-10-31 16:05:13] olivier at ajeux dot com

Same bug encountered with php5.3-200810301330, also with a php crash.

Reproduce code:
---
http://bugs.php.net/46196

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



#46196 [Com]: restore_error_handler() broken

2008-11-17 Thread webmaster at ajeux dot com
 ID:   46196
 Comment by:   webmaster at ajeux dot com
 Reported By:  php at benjaminschulz dot com
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: *
 PHP Version:  5.3CVS-2008-11-11
 New Comment:

I made a patch to fix this bug and tested it *successfully* on
php5.3-200811170930 (latest snap as I'm writing).

I am not an expert in diff/patch, so syntax may be wrong.

--- Zend/zend_API.c 2008-11-17 11:02:39.0 +0100
+++ Zend/zend_API.c 2008-08-08 19:47:28.0 +0200
@@ -3467,10 +3467,6 @@
 {
current->handling = EG(error_handling);
current->exception = EG(exception_class);
-   current->user_handler = EG(user_error_handler);
-   if (current->user_handler) {
-   Z_ADDREF_P(current->user_handler);
-   }
 }
 /* }}} */

@@ -3478,10 +3474,6 @@
 {
if (current) {
zend_save_error_handling(current TSRMLS_CC);
-   if (error_handling != EH_NORMAL &&
EG(user_error_handler)) {
-   zval_ptr_dtor(&EG(user_error_handler));
-   EG(user_error_handler) = NULL;
-   }
}
EG(error_handling) = error_handling;
EG(exception_class) = error_handling == EH_THROW ?
exception_class : NULL;
@@ -3499,15 +3491,6 @@
 {
EG(error_handling) = saved->handling;
EG(exception_class) = saved->handling == EH_THROW ?
saved->exception : NULL;
-   if (saved->user_handler && saved->user_handler !=
EG(user_error_handler)) {
-   if (EG(user_error_handler)) {
-   zval_ptr_dtor(&EG(user_error_handler));
-   }
-   EG(user_error_handler) = saved->user_handler;
-   } else if (saved->user_handler) {
-   zval_ptr_dtor(&saved->user_handler);
-   }
-   saved->user_handler = NULL;
 }
 /* }}} */


Previous Comments:


[2008-11-14 16:59:23] olivier at ajeux dot com

I tested several export from CVS and I found when was commited the bug:

2008-08-11 17:00 GMT: OK (no bug)
2008-08-11 17:30 GMT: ERROR (bug happened).

Script used for information:
$ cvs -d :pserver:[EMAIL PROTECTED]:/repository checkout -r PHP_5_3
-D"2008-08-11 17:30 GMT" php-src
$ cd php-src
$ ./buildconf --force && ./configure && make

I hope it can help. This is a major bug for me.

----------------

[2008-11-13 17:22:46] webmaster at ajeux dot com

I have tested tagged version in CVS:
php_5_3_0alpha1: OK (no bug)
php_5_3_0alpha2: ERROR (bug happened).

So, it seems this bug was introduced between alpha1 and alpha2.

If you give me a way to export cvs at a precise date, I can adjust when
and where this bug was commited.



[2008-11-11 10:42:11] [EMAIL PROTECTED]

Works fine with PHP_5_2, does not with PHP_5_3. 



[2008-10-31 16:05:13] olivier at ajeux dot com

Same bug encountered with php5.3-200810301330, also with a php crash.

Reproduce code:
---
http://bugs.php.net/?id=46196&edit=1



#46196 [Com]: restore_error_handler() broken

2008-11-25 Thread webmaster at ajeux dot com
 ID:   46196
 Comment by:   webmaster at ajeux dot com
 Reported By:  php at benjaminschulz dot com
 Status:   Feedback
 Bug Type: Scripting Engine problem
 Operating System: *
 PHP Version:  5.3CVS-2008-11-11
 New Comment:

The bug seems to be fixed (tested successfully with php5.3-200811251530
on Linux).


Previous Comments:


[2008-11-25 09:42:36] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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

  http://windows.php.net/snapshots/

I can not reproduce this anymore using latest CVS.



[2008-11-17 11:17:20] webmaster at ajeux dot com

It seems my diff patch failed to apply on some configurations.
Here is full functions altered in Zend/zend_API.C (end of file, three
functions modified):

ZEND_API void zend_save_error_handling(zend_error_handling *current
TSRMLS_DC) /* {{{ */
{
current->handling = EG(error_handling);
current->exception = EG(exception_class);
}
/* }}} */

ZEND_API void zend_replace_error_handling(zend_error_handling_t
error_handling, zend_class_entry *exception_class, zend_error_handling
*current TSRMLS_DC) /* {{{ */
{
if (current) {
zend_save_error_handling(current TSRMLS_CC);
}
EG(error_handling) = error_handling;
EG(exception_class) = error_handling == EH_THROW ?
exception_class : NULL;
}
/* }}} */

ZEND_API void zend_restore_error_handling(zend_error_handling *saved
TSRMLS_DC) /* {{{ */
{
EG(error_handling) = saved->handling;
EG(exception_class) = saved->handling == EH_THROW ?
saved->exception : NULL;
}
/* }}} */



[2008-11-17 10:59:53] webmaster at ajeux dot com

I made a patch to fix this bug and tested it *successfully* on
php5.3-200811170930 (latest snap as I'm writing).

I am not an expert in diff/patch, so syntax may be wrong.

--- Zend/zend_API.c 2008-11-17 11:02:39.0 +0100
+++ Zend/zend_API.c 2008-08-08 19:47:28.0 +0200
@@ -3467,10 +3467,6 @@
 {
current->handling = EG(error_handling);
current->exception = EG(exception_class);
-   current->user_handler = EG(user_error_handler);
-   if (current->user_handler) {
-   Z_ADDREF_P(current->user_handler);
-   }
 }
 /* }}} */

@@ -3478,10 +3474,6 @@
 {
if (current) {
zend_save_error_handling(current TSRMLS_CC);
-   if (error_handling != EH_NORMAL &&
EG(user_error_handler)) {
-   zval_ptr_dtor(&EG(user_error_handler));
-   EG(user_error_handler) = NULL;
-   }
}
EG(error_handling) = error_handling;
EG(exception_class) = error_handling == EH_THROW ?
exception_class : NULL;
@@ -3499,15 +3491,6 @@
 {
EG(error_handling) = saved->handling;
EG(exception_class) = saved->handling == EH_THROW ?
saved->exception : NULL;
-   if (saved->user_handler && saved->user_handler !=
EG(user_error_handler)) {
-   if (EG(user_error_handler)) {
-   zval_ptr_dtor(&EG(user_error_handler));
-   }
-   EG(user_error_handler) = saved->user_handler;
-   } else if (saved->user_handler) {
-   zval_ptr_dtor(&saved->user_handler);
-   }
-   saved->user_handler = NULL;
 }
 /* }}} */



[2008-11-14 16:59:23] olivier at ajeux dot com

I tested several export from CVS and I found when was commited the bug:

2008-08-11 17:00 GMT: OK (no bug)
2008-08-11 17:30 GMT: ERROR (bug happened).

Script used for information:
$ cvs -d :pserver:[EMAIL PROTECTED]:/repository checkout -r PHP_5_3
-D"2008-08-11 17:30 GMT" php-src
$ cd php-src
$ ./buildconf --force && ./configure && make

I hope it can help. This is a major bug for me.

--------

[2008-11-13 17:22:46] webmaster at ajeux dot com

I have tested tagged version in CVS:
php_5_3_0alpha1: OK (no bug)
php_5_3_0alpha2: ERROR (bug happened).

So, it seems this bug was introduced between alpha1 and alpha2.

If you give me a way to export cvs at a precise date, I can adjust when
and where this bug was commited.



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

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



#46808 [Com]: Mysqli crashes on LONGTEXT columns

2008-12-11 Thread webmaster at ajeux dot com
 ID:   46808
 Comment by:   webmaster at ajeux dot com
 Reported By:  wcshields at gmail dot com
 Status:   Open
 Bug Type: MySQLi related
 Operating System: Ubuntu 8.04 LTS x86 32 bit
 PHP Version:  5.2.8
 New Comment:

Bug confirmed here on PHP 5.3 with Mysql 5.0.51
SELECT query : 

"SELECT id, UNCOMPRESS(myfield) FROM mytable ORDER BY id LIMIT 8"
myfield is BLOB.

How can we help to get it fixed ?

"Program received signal SIGSEGV, Segmentation fault."

Backtrace:
#0  0xb7aedb00 in mysqli_stmt_fetch_libmysql (ht=0,
return_value=0xb71cbe4c, return_value_ptr=0x0, this_ptr=0xb7265748,
return_value_used=1)
at /usr/src/php5.3-200812091530/ext/mysqli/mysqli_api.c:842
#1  0xb7aedf0d in zif_mysqli_stmt_fetch (ht=0, return_value=0xb71cbe4c,
return_value_ptr=0x0, this_ptr=0xb7265748, return_value_used=1)
at /usr/src/php5.3-200812091530/ext/mysqli/mysqli_api.c:984
#2  0x0827a4b9 in zend_do_fcall_common_helper_SPEC
(execute_data=0xb776af88) at
/usr/src/php5.3-200812091530/Zend/zend_vm_execute.h:313
#3  0x08279a32 in execute (op_array=0xb738bd94) at
/usr/src/php5.3-200812091530/Zend/zend_vm_execute.h:104
#4  0x08253c17 in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /usr/src/php5.3-200812091530/Zend/zend.c:1197
#5  0x081faf59 in php_execute_script (primary_file=0xbfb12090) at
/usr/src/php5.3-200812091530/main/main.c:2080
#6  0x082ec5a9 in main (argc=1, argv=0xbfb121e4) at
/usr/src/php5.3-200812091530/sapi/cgi/cgi_main.c:2000


Previous Comments:


[2008-12-09 07:31:00] wcshields at gmail dot com

Description:

Mysqli restores garbage from longtext columns in mysql 5.0.51a
connected over TCP (also happens with Unix domain sockets) and, after a
random number of rows, seg faults.  The number of rows is unpredictable
but consistent.  If you find something that crashes after 11 rows, it
will crash after 11 rows every time.  Change the order by clause and it
might crash every time after 3 rows.

As per bugs #44867 and several others I've found, people have been
reporting this issue since as early as 2005 and it still hasn't been
addressed.  Can someone PLEASE actually look into it?

Reproduce code:
---
prepare("SELECT name, longtext1 FROM sampletable");
$stmt->execute();
$stmt->bind_result($name, $value);
$count = 1;
while ($stmt->fetch()) {
$size = sizeof($value);
echo "$name $size\n";
$count++;
}
$stmt->close();
?>

Expected result:

To retrieve the exact contents of all longtext values without crashing.

Actual result:
--
Segmentation fault.
$ gdb php core
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show
copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /lib/tls/i686/cmov/libcrypt.so.1...done.
Loaded symbols for /lib/tls/i686/cmov/libcrypt.so.1
Reading symbols from /lib/tls/i686/cmov/librt.so.1...done.
Loaded symbols for /lib/tls/i686/cmov/librt.so.1
Reading symbols from /lib/tls/i686/cmov/libresolv.so.2...done.
Loaded symbols for /lib/tls/i686/cmov/libresolv.so.2
Reading symbols from /lib/tls/i686/cmov/libdl.so.2...done.
Loaded symbols for /lib/tls/i686/cmov/libdl.so.2
Reading symbols from /usr/lib/libmysqlclient.so.15...done.
Loaded symbols for /usr/lib/libmysqlclient.so.15
Reading symbols from /lib/tls/i686/cmov/libpthread.so.0...done.
Loaded symbols for /lib/tls/i686/cmov/libpthread.so.0
Reading symbols from /lib/tls/i686/cmov/libnsl.so.1...done.
Loaded symbols for /lib/tls/i686/cmov/libnsl.so.1
Reading symbols from /lib/tls/i686/cmov/libm.so.6...done.
Loaded symbols for /lib/tls/i686/cmov/libm.so.6
Reading symbols from /usr/lib/libz.so.1...done.
Loaded symbols for /usr/lib/libz.so.1
Reading symbols from /usr/lib/libxml2.so.2...done.
Loaded symbols for /usr/lib/libxml2.so.2
Reading symbols from /lib/tls/i686/cmov/libc.so.6...done.
Loaded symbols for /lib/tls/i686/cmov/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/tls/i686/cmov/libnss_files.so.2...done.
Loaded symbols for /lib/tls/i686/cmov/libnss_files.so.2
Core was generated by `./php'.
Program terminated with signal 11, Segmentation fault.
[New process 5006]
#0  0x08130eda in zif_mysqli_stmt_fetch (ht=0, return_value=0x856e20c,
return_value_ptr=0x0, this_ptr=0x856e0b8, return_value_used=1)
at /home/wshields/php-5.2.8/ext/mysqli/mysqli_api.c:665
665 if (Z_TYPE_P(stmt->result.vars[i]) ==
IS_

#46808 [Com]: Mysqli crashes on LONGTEXT columns

2008-12-11 Thread webmaster at ajeux dot com
 ID:   46808
 Comment by:   webmaster at ajeux dot com
 Reported By:  wcshields at gmail dot com
 Status:   Open
 Bug Type: MySQLi related
 Operating System: Ubuntu 8.04 LTS x86 32 bit
 PHP Version:  5.2.8
 New Comment:

Note: No bug when mysqlnd is used. (configure with
--with-mysqli=mysqlnd)


Previous Comments:


[2008-12-11 11:18:32] webmaster at ajeux dot com

Bug confirmed here on PHP 5.3 with Mysql 5.0.51
SELECT query : 

"SELECT id, UNCOMPRESS(myfield) FROM mytable ORDER BY id LIMIT 8"
myfield is BLOB.

How can we help to get it fixed ?

"Program received signal SIGSEGV, Segmentation fault."

Backtrace:
#0  0xb7aedb00 in mysqli_stmt_fetch_libmysql (ht=0,
return_value=0xb71cbe4c, return_value_ptr=0x0, this_ptr=0xb7265748,
return_value_used=1)
at /usr/src/php5.3-200812091530/ext/mysqli/mysqli_api.c:842
#1  0xb7aedf0d in zif_mysqli_stmt_fetch (ht=0, return_value=0xb71cbe4c,
return_value_ptr=0x0, this_ptr=0xb7265748, return_value_used=1)
at /usr/src/php5.3-200812091530/ext/mysqli/mysqli_api.c:984
#2  0x0827a4b9 in zend_do_fcall_common_helper_SPEC
(execute_data=0xb776af88) at
/usr/src/php5.3-200812091530/Zend/zend_vm_execute.h:313
#3  0x08279a32 in execute (op_array=0xb738bd94) at
/usr/src/php5.3-200812091530/Zend/zend_vm_execute.h:104
#4  0x08253c17 in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /usr/src/php5.3-200812091530/Zend/zend.c:1197
#5  0x081faf59 in php_execute_script (primary_file=0xbfb12090) at
/usr/src/php5.3-200812091530/main/main.c:2080
#6  0x082ec5a9 in main (argc=1, argv=0xbfb121e4) at
/usr/src/php5.3-200812091530/sapi/cgi/cgi_main.c:2000



[2008-12-09 07:31:00] wcshields at gmail dot com

Description:

Mysqli restores garbage from longtext columns in mysql 5.0.51a
connected over TCP (also happens with Unix domain sockets) and, after a
random number of rows, seg faults.  The number of rows is unpredictable
but consistent.  If you find something that crashes after 11 rows, it
will crash after 11 rows every time.  Change the order by clause and it
might crash every time after 3 rows.

As per bugs #44867 and several others I've found, people have been
reporting this issue since as early as 2005 and it still hasn't been
addressed.  Can someone PLEASE actually look into it?

Reproduce code:
---
prepare("SELECT name, longtext1 FROM sampletable");
$stmt->execute();
$stmt->bind_result($name, $value);
$count = 1;
while ($stmt->fetch()) {
$size = sizeof($value);
echo "$name $size\n";
$count++;
}
$stmt->close();
?>

Expected result:

To retrieve the exact contents of all longtext values without crashing.

Actual result:
--
Segmentation fault.
$ gdb php core
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show
copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /lib/tls/i686/cmov/libcrypt.so.1...done.
Loaded symbols for /lib/tls/i686/cmov/libcrypt.so.1
Reading symbols from /lib/tls/i686/cmov/librt.so.1...done.
Loaded symbols for /lib/tls/i686/cmov/librt.so.1
Reading symbols from /lib/tls/i686/cmov/libresolv.so.2...done.
Loaded symbols for /lib/tls/i686/cmov/libresolv.so.2
Reading symbols from /lib/tls/i686/cmov/libdl.so.2...done.
Loaded symbols for /lib/tls/i686/cmov/libdl.so.2
Reading symbols from /usr/lib/libmysqlclient.so.15...done.
Loaded symbols for /usr/lib/libmysqlclient.so.15
Reading symbols from /lib/tls/i686/cmov/libpthread.so.0...done.
Loaded symbols for /lib/tls/i686/cmov/libpthread.so.0
Reading symbols from /lib/tls/i686/cmov/libnsl.so.1...done.
Loaded symbols for /lib/tls/i686/cmov/libnsl.so.1
Reading symbols from /lib/tls/i686/cmov/libm.so.6...done.
Loaded symbols for /lib/tls/i686/cmov/libm.so.6
Reading symbols from /usr/lib/libz.so.1...done.
Loaded symbols for /usr/lib/libz.so.1
Reading symbols from /usr/lib/libxml2.so.2...done.
Loaded symbols for /usr/lib/libxml2.so.2
Reading symbols from /lib/tls/i686/cmov/libc.so.6...done.
Loaded symbols for /lib/tls/i686/cmov/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/tls/i686/cmov/libnss_files.so.2...done.
Loaded symbols for /lib/tls/i686/cmov/libnss_files.so.2
Core was generated by `./php'.
Program terminated with signal 11, Segmentation fault.
[New process 5006]
#0  0x08130eda in zif_mysqli_stmt_fetch (ht=0, return_value=0x856e20c,
return_