From:             zakirov at rain dot ifmo dot ru
Operating system: Windows XP Pro SP2
PHP version:      5.2.0
PHP Bug Type:     Reproducible crash
Bug description:  Apache crashes when page (XTemplate) writes to $_SESSION

Description:
------------
If PHP page uses XTPL library (http://xtpl.sf.net), then writing to
$_SESSION causes Apache to crash.

Though commenting body of method scan_globals() (class XTemplate)
neutralize bug:
...
function scan_globals () {
  reset($GLOBALS);
  foreach ($GLOBALS as $k => $v) {
    $GLOB[$k] = $v;
  }
  $this->assign('PHP', $GLOB); /* access global variables as
{PHP.HTTP_SERVER_VARS.HTTP_HOST} in your template! */
}
...
function assign ($name, $val = '') {
  if (is_array($name)) {
    foreach ($name as $k => $v) {
      $this->vars[$k] = $v;
    }
  } else {
    $this->vars[$name] = $val;
  }
}
...

Reproduce code:
---------------
Download any last version of XTPL library from
http://sourceforge.net/project/showfiles.php?group_id=16714

Create test template-file 'test.html':
<!-- BEGIN: main -->
<html>
<head>
</head>
<body>
</body>
</html>
<!-- END: main -->

Create and test php file:
<?php
require_once('XTemplate.php');

session_start();

$xtpl = new XTemplate('test.html');

$_SESSION['TEST'] = "test";
?>

Expected result:
----------------
Expected no errors.

Actual result:
--------------
Apache crashes. Windows shows popup:
"Apache HTTP Server has encountered a problem and needs to close. We are
sorry for the inconvenience."

Error signature:
szAppName: httpd.exe
szAppVer: 2.2.4.0
szModName: php5ts.dll
szModVer: 5.2.0.0
offset: 00098178

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

Reply via email to