php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37950 PHP segfaults when assigning $errcontext to Smarty var when debugging enabled
Submitted: 2006-06-28 16:23 UTC Modified: 2006-07-06 01:00 UTC
From: bugs dot php dot net at zetafleet dot com Assigned:
Status: No Feedback Package: Reproducible crash
PHP Version: 5.1.4 OS: Linux 2.6.15 (Debian testing)
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bugs dot php dot net at zetafleet dot com
New email:
PHP Version: OS:

 

 [2006-06-28 16:23 UTC] bugs dot php dot net at zetafleet dot com
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 ?? ()


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-28 16:27 UTC] tony2001@php.net
Please try using this CVS snapshot:

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


 [2006-07-06 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2007-01-04 17:24 UTC] abaker_php at yahoo dot com
This also appears in PHP 5.1.5
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 13 15:01:27 2025 UTC