php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26579 Crash
Submitted: 2003-12-10 07:48 UTC Modified: 2003-12-10 09:52 UTC
From: jonas at datatal dot se Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2003-12-10 OS: win2k
Private report: No CVE-ID: None
 [2003-12-10 07:48 UTC] jonas at datatal dot se
Description:
------------
Hello

I cant reproduce the bug with a small example, but I get it every time on my site. I use a Template class to separate the buisiness logic from the presentation layer.

I got a main template, a menu template and a body template. If I exlude the menu template or the body template everything works, but if I include both, i get the following crash: The instruction at "0x100fe35a" referenced memory at "0x28776f78". The memory could not be "read".

1. The site can be downloaded from http://www.gauffin.org/site.php
2. Just unzip it and create the testdatabase by using support5.sql
3. surf to http://testsite/case.php?action=list
4. php should crash.

Reproduce code:
---------------
I can zip my site (quite small) and send it to you with instructions how to reproduce the error.

<?php 
	require_once('config.php');
	require_once('include\general.php');
	require_once('include\adodb\adodb.inc.php');
	require_once('include\Template.php');
	require_once('classes\SessionUser.php');
	require_once('classes\Case.php');
	require_once('classes\UserHandler.php');
	$curUser = new SessionUser;
	
	$conn = &ADONewConnection('mysql'); 
	$conn->PConnect('localhost','root','','support5_v2');
	
	$action = 'list.php';
	if (isset($_GET['action'])) $action = $_GET['action'];
	
	/* @var $handler QueryHandler */
	$handler = new QueryHandler($conn);
	$body = $handler->HandleAction($action);
	
	/* uncommeting these lines will crash php 
	$menuTemplate = new Template('templates\menuSupport.tpl');
	$menuTemplate->Set('curUser', $curUser);
	*/
	
	$mainTemplate = new Template('templates\design1.tpl');
	$mainTemplate->Set('body', $body);
	$mainTemplate->Set('title', 'First page');
	$mainTemplate->Set('leftMenu', $menuTemplate);
	$mainTemplate->Set('curUser', $curUser);
	$mainTemplate->Set('rightMenu', 'ingenting');
	echo $mainTemplate->Fetch();
	
	
?>

Expected result:
----------------
No crash? =)

Actual result:
--------------
crash.

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-10 07:49 UTC] jonas at gauffin dot org
sorry, the correct url is http://www.gauffin.org/site.zip
 [2003-12-10 09:20 UTC] sniper@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 <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.


 [2003-12-10 09:24 UTC] sniper@php.net
The zip package of yours is not proper testcase. Make it shorter. 


 [2003-12-10 09:38 UTC] jonas at datatal dot se
i've tried to make the script shorter, but the bug do not occur then.
 [2003-12-10 09:51 UTC] jonas at datatal dot se
sorry, I had not extracted the latest snapshot properly. The bug seems to be fixed in it.
 [2003-12-10 09:52 UTC] derick@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

great
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Aug 18 19:01:28 2024 UTC