This is the third and final release candidate of the upcoming
maintenance release of PHP 4.3.2.
Please download and test it as much as possible on real-life
applications to uncover any remaining issues.
Sources:
http://downloads.php.net/jani/php-4.3.2RC3.tar.bz2
http://downloads.php.net/jani/php-4.3.2RC3.tar.gz
Windows binaries:
http://downloads.php.net/jani/php-4.3.2RC3-Win32.zip
md5sums:
a454d1fd9aa4ca24848c53bb7160de22 php-4.3.2RC3-Win32.zip
f910021c6d931b68c53d5b511655bb13 php-4.3.2RC3.tar.bz2
c8ead30bdc146319719b65034c0ee44a php-4.3.2RC3.tar.gz
List of additions/changes/fixes can be found here:
http://cvs.php.net/diff.php/php4/NEWS?r1=1.1247.2.35.4.1&r2=1.1247.2.200&tr2=1.1403&ty=h
Howdy,
It seems the patch to fix the set_error_handler() didn't make it in
the RC3 build.
set_error_handler( array(&$this, "errorhandler")) is broken.
This bug is also described in http://bugs.php.net/?id=23619
http://bugs.php.net/?id=23619&edit=2
but it seems that the only intelligent response from sniper@php.net
mailto:sniper@php.net seems to be
"this patch is bogus" and fails to explain himself at all. This is not
very productive, and is not helping to solve the issue.
I have tried it in php 4.3.1 and php 4.3.2 RC2 and RC3. It doesn't
work. I have provided a very simple php script which shows the
problem. the TestError::error() method is never called, and it should
be. You can comment the TestError error handler out, and use the
global_error() function and see it working.
It is a very simple bug. set_error_handler() assumes that the param
passed in is a string, and tries to test the string the length, which is
bogus in the case of it being an array. Z_STRLEN_PP of an array?
<?php
ini_set("error_reporting" , E_ALL);
ini_set("display_errors", true);
// This handler works
function global_error($errno, $errstr, $errfile, $errline) {
echo("global_error HANDLER CALLED (".$errstr.")\n");
}
class TestError {
function TestError() {
//This set_error_handler does not work.
//it returns `TRUE` (which is wrong, because it never is set)
$res = set_error_handler(array(&$this, "error"));
echo("set_error_handler::error done retcode =" .
var_export($res, true) . "\n");
}
//This handler FAILS to be called.
function error($errno, $errstr, $errfile, $errline) {
echo("TestError::error HANDLER CALLED (".$errstr.")\n");
}
function runTest() {
$bar = $foo;
}
}
$t = new TestError();
//uncomment and use this handler to see it working.
//$res = set_error_handler("global_error");
//echo("set_error_handler::global_error done retcode =" .
var_export($res, true) . "\n");
$t->runTest();
?>
The TestError::error handler fails to ever be called without the patch I
provided, because
set_error_handler() on line 894
...
if (Z_STRLEN_PP(error_handler)==0) { /* unset user-defined handler */
FREE_ZVAL(EG(user_error_handler));
EG(user_error_handler) = NULL;
RETURN_TRUE;
}
...
it assumes error_handler zval is a string. It is an array. Clearly
doing a Z_STRLEN_PP on an array is completely wrong, and causes this to
fall through. Why are we returning TRUE in this case anyways, and isn't
this error case handled in the is_callable() check anyway? This code is
broken, and will never work in its current state.
It should include a test to make sure its a string before trying to see
what the string length is!
if (Z_TYPE_PP(error_handler) == IS_STRING &&
Z_STRLEN_PP(error_handler)==0) { /* unset user-defined handler */
FREE_ZVAL(EG(user_error_handler));
EG(user_error_handler) = NULL;
RETURN_TRUE;
}
This prevents the test of the string length unless its actually a
string! go figure.
Walt
Disclaimer: It worked fine for me. :)
(I have huge configure line, I'm trying to figure out currently
what caused it to work, even when it shouldn't..)
Simple ./configure --disable-all produced a php binary that
shows the symptom described in the bug report.
The last patch is ok, that part of the code in zend_builtin_functions.c
seems to have been forgotten there by Andrei, who added support
of object methods for `set_error_handler()`.
--Jani
p.s. This is not critical bug, the fix will be in next release, 4.3.3
along with couple of dozen other fixes that didn't make it into 4.3.2.
Howdy,
It seems the patch to fix theset_error_handler()didn't make it in
the RC3 build.set_error_handler( array(&$this, "errorhandler")) is broken.
This bug is also described in http://bugs.php.net/?id=23619
http://bugs.php.net/?id=23619&edit=2
but it seems that the only intelligent response from sniper@php.net
mailto:sniper@php.net seems to be
"this patch is bogus" and fails to explain himself at all. This is not
very productive, and is not helping to solve the issue.I have tried it in php 4.3.1 and php 4.3.2 RC2 and RC3. It doesn't
work. I have provided a very simple php script which shows the
problem. the TestError::error() method is never called, and it should
be. You can comment the TestError error handler out, and use the
global_error() function and see it working.It is a very simple bug.
set_error_handler()assumes that the param
passed in is a string, and tries to test the string the length, which is
bogus in the case of it being an array. Z_STRLEN_PP of an array?<?php
ini_set("error_reporting" , E_ALL);
ini_set("display_errors", true);// This handler works
function global_error($errno, $errstr, $errfile, $errline) {
echo("global_error HANDLER CALLED (".$errstr.")\n");
}class TestError {
function TestError() {//This set_error_handler does not work. //it returns `TRUE` (which is wrong, because it never is set) $res = set_error_handler(array(&$this, "error")); echo("set_error_handler::error done retcode =" .var_export($res, true) . "\n");
}//This handler FAILS to be called.
function error($errno, $errstr, $errfile, $errline) {
echo("TestError::error HANDLER CALLED (".$errstr.")\n");
}function runTest() {
$bar = $foo;
}
}$t = new TestError();
//uncomment and use this handler to see it working.
//$res = set_error_handler("global_error");
//echo("set_error_handler::global_error done retcode =" .
var_export($res, true) . "\n");
$t->runTest();
?>The TestError::error handler fails to ever be called without the patch I
provided, because
set_error_handler() on line 894
...
if (Z_STRLEN_PP(error_handler)==0) { /* unset user-defined handler */
FREE_ZVAL(EG(user_error_handler));
EG(user_error_handler) = NULL;
RETURN_TRUE;
}
...
it assumes error_handler zval is a string. It is an array. Clearly
doing a Z_STRLEN_PP on an array is completely wrong, and causes this to
fall through. Why are we returningTRUEin this case anyways, and isn't
this error case handled in theis_callable()check anyway? This code is
broken, and will never work in its current state.It should include a test to make sure its a string before trying to see
what the string length is!if (Z_TYPE_PP(error_handler) == IS_STRING &&
Z_STRLEN_PP(error_handler)==0) { /* unset user-defined handler */
FREE_ZVAL(EG(user_error_handler));
EG(user_error_handler) = NULL;
RETURN_TRUE;
}This prevents the test of the string length unless its actually a
string! go figure.Walt
--
<- For Sale!
Jani Taskinen wrote:
Please download and test it as much as possible on real-life
applications to uncover any remaining issues.
Woke up, updated and built the PHP_4_3 branch on my laptop, did a final
check for a presentation I'm going to give later today -- and it
segfaults with PHPUnit's HTML GUI.
Gotta run now, so no backtrace. I hopefully find the time tonight to
investigate.
--
Sebastian Bergmann
http://sebastian-bergmann.de/ http://phpOpenTracker.de/
Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/
The following problem occurs now:
[16/May/2003:11:01:26] failure (19685): Configuration initialization
failed: Error running init function load-modules: dlopen of
/pangaea/webserver/bin/libphp4.so failed (ld.so.1: ns-httpd: fatal:
relocation error: file /pangaea/webserver/bin/libphp4.so: symbol
zend_is_auto_global: referenced symbol not found)
I am using the NSAPI module. Not good. All my CVS checkouts before
worked... Could it be that the linking does not work correct?
Uwe
At 02:28 16.05.2003 +0300, you wrote:
This is the third and final release candidate of the upcoming maintenance release of PHP 4.3.2. Please download and test it as much as possible on real-life applications to uncover any remaining issues. Sources: http://downloads.php.net/jani/php-4.3.2RC3.tar.bz2 http://downloads.php.net/jani/php-4.3.2RC3.tar.gz Windows binaries: http://downloads.php.net/jani/php-4.3.2RC3-Win32.zip md5sums: a454d1fd9aa4ca24848c53bb7160de22 php-4.3.2RC3-Win32.zip f910021c6d931b68c53d5b511655bb13 php-4.3.2RC3.tar.bz2 c8ead30bdc146319719b65034c0ee44a php-4.3.2RC3.tar.gz List of additions/changes/fixes can be found here:http://cvs.php.net/diff.php/php4/NEWS?r1=1.1247.2.35.4.1&r2=1.1247.2.200&tr2=1.1403&ty=h
--
Uwe Schindler
Addr 1: Bamberger Str. 24a, D-96049 Bamberg
Addr 2: Drausnickstr. 153, D-91052 Erlangen
http://www.thetaphi.de - http:///www.schindlers-software.de
eMails: uwe@thetaphi.de (private); info@schindlers-software.de (company)
Tel./Fax: +49 700 PCLATEIN (+49 700 72528346)
Schindlers Software - Home of Schindlers PC-LATEIN 3.10
DIE Software zum Lateinlernen!
Sorry was a problem with a replaced .c file in ext/standard (was the php5
version).
Sorry works fine now :)
At 11:03 16.05.2003 +0200, Uwe Schindler wrote:
The following problem occurs now:
[16/May/2003:11:01:26] failure (19685): Configuration initialization
failed: Error running init function load-modules: dlopen of
/pangaea/webserver/bin/libphp4.so failed (ld.so.1: ns-httpd: fatal:
relocation error: file /pangaea/webserver/bin/libphp4.so: symbol
zend_is_auto_global: referenced symbol not found)I am using the NSAPI module. Not good. All my CVS checkouts before
worked... Could it be that the linking does not work correct?Uwe
At 02:28 16.05.2003 +0300, you wrote:
This is the third and final release candidate of the upcoming maintenance release of PHP 4.3.2. Please download and test it as much as possible on real-life applications to uncover any remaining issues. Sources: http://downloads.php.net/jani/php-4.3.2RC3.tar.bz2 http://downloads.php.net/jani/php-4.3.2RC3.tar.gz Windows binaries: http://downloads.php.net/jani/php-4.3.2RC3-Win32.zip md5sums: a454d1fd9aa4ca24848c53bb7160de22 php-4.3.2RC3-Win32.zip f910021c6d931b68c53d5b511655bb13 php-4.3.2RC3.tar.bz2 c8ead30bdc146319719b65034c0ee44a php-4.3.2RC3.tar.gz List of additions/changes/fixes can be found here:http://cvs.php.net/diff.php/php4/NEWS?r1=1.1247.2.35.4.1&r2=1.1247.2.200&tr2=1.1403&ty=h
--
Uwe Schindler
Addr 1: Bamberger Str. 24a, D-96049 Bamberg
Addr 2: Drausnickstr. 153, D-91052 Erlangen
http://www.thetaphi.de - http:///www.schindlers-software.de
eMails: uwe@thetaphi.de (private); info@schindlers-software.de (company)
Tel./Fax: +49 700 PCLATEIN (+49 700 72528346)Schindlers Software - Home of Schindlers PC-LATEIN 3.10
DIE Software zum Lateinlernen!
Uwe Schindler
Addr 1: Bamberger Str. 24a, D-96049 Bamberg
Addr 2: Drausnickstr. 153, D-91052 Erlangen
http://www.thetaphi.de - http:///www.schindlers-software.de
eMails: uwe@thetaphi.de (private); info@schindlers-software.de (company)
Tel./Fax: +49 700 PCLATEIN (+49 700 72528346)
Schindlers Software - Home of Schindlers PC-LATEIN 3.10
DIE Software zum Lateinlernen!