I highly doubt that apache is seg-faulting. If you are getting a 500 that could 
just mean that your error reporting is off.
Sent via BlackBerry by AT&T

-----Original Message-----
From: Daniel Jakob <ja...@sc-networks.com>
Sender: phptal-boun...@lists.motion-twin.com
Date: Tue, 01 May 2012 10:36:48 
To: <phptal@lists.motion-twin.com>
Reply-To: Template Attribute Language for PHP <phptal@lists.motion-twin.com>
Subject: [PHPTAL] PHP segfaults due Exception in SaxXmlParser

Hi list

After upgrading TAL to 1.2.2, I found a little problem which makes TAL
quite unuseable in scenarios, when you are not able to control the given
xhtml source. Maybe, the problem depends on newer php versions and/or
eaccelerator.

SaxXmlParser::parseString() throws a PHPTAL_ParserException which isn't
catched by the try/catch block which leads directly to an apache
segfault.
The only exception which gets catched is the PHPTAL_TemplateException.
The ParserException subclasses the TemplateException but - however - php
doesn't care about it. This happens every time when I access the script
BUT not the first time. Setting forceReparse to true also 'fixes' the
problem so I assume, the problem is somewhere between the phptal cache
files and the exceptions in php. Maybe, the eaccelerator is involved,
too.
What definitely helps is to explicitly catch PHPTAL_ParserException at
the end of the switch-block (like the TemplateException does).

A sample:

test.xhtml:

<html>
<body>
<span style="" style="">I kill the parser</span>
</body>
</html>


test.php:

require_once('phptal/PHPTAL.php');
$template = new PHPTAL('test.xhtml');
$template->setOutputMode(PHPTAL::XML);
$template->execute();


Expected result:
PHPTAL Exception
Attribute style in < span > is defined more than once

Actual result:
Apache segmentation fault


Used environments:
1. Gentoo amd64, apache 2.22, php 5.3.11, eaccelerator 0.9.6.1
2. Gentoo amd64, apache 2.22, php 5.3.9, eaccelerator 0.9.6.1
3. Ubuntu x86, apache 2.22, php 5.3.6, eaccelerator 0.9.6.1

Maybe, someone has a clue. At least, this report may help anyone having
the same problem :)

cu

Daniel


_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal
_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to