From: bugs dot php dot net at zetafleet dot com
Operating system: Linux 2.6.15 (Debian testing)
PHP version: 5.1.4
PHP Bug Type: Reproducible crash
Bug description: PHP segfaults when assigning $errcontext to Smarty var when
debugging enabled
Description:
------------
When $smarty->debugging = true and using $smarty->assign
to assign a template variable with the value of
$errcontext, PHP segfaults when trying to output the
debugging console for Smarty.
Reproduce code:
---------------
<?
include('Smarty.class.php');
$smarty = new Smarty();
$smarty->debugging = true; // the error will not occur if
debugging = false
set_error_handler("error_handler",E_ALL);
function error_handler($errno, $errstr, $errfile, $errline,
$errcontext)
{
global $smarty;
$smarty->assign('killme',$errcontext);
$smarty->display('killsmarty.tpl'); // this file can be
empty but it has to exist
echo($errstr);
}
trigger_error("Uh-ho!",E_USER_ERROR);
?>
Expected result:
----------------
$errcontext should be assigned to Smarty template variable
$killme.
Actual result:
--------------
#0 0xb7a56e40 in vfprintf () from /lib/tls/libc.so.6
#1 0xb7a73ffb in vsprintf () from /lib/tls/libc.so.6
#2 0xb7a5fe1e in sprintf () from /lib/tls/libc.so.6
#3 0x08277eb1 in _convert_to_string ()
#4 0x0827f684 in zend_make_printable_zval ()
#5 0x08277a1c in concat_function ()
#6 0x082a2b7e in execute ()
#7 0x0829d9c8 in execute ()
#8 0x0829bf83 in zend_get_user_opcode_handler ()
#9 0x00000000 in ?? ()
--
Edit bug report at http://bugs.php.net/?id=37950&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=37950&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=37950&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=37950&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=37950&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=37950&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=37950&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=37950&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=37950&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=37950&r=support
Expected behavior: http://bugs.php.net/fix.php?id=37950&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=37950&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=37950&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=37950&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37950&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=37950&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=37950&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=37950&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=37950&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=37950&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=37950&r=mysqlcfg