Hi All,
I have a problem and after a day of smashing my head against a wooded
desk, I thought it might be time to seek some advise. My problem
involves Template Toolkit V 2.13 and mod_perl 1.99.13.
I'm moving some code to perl 5.8.3 compiled with ithreads. I have a
mod_perl handler (Apache 2.0.48- worker mpm/ModPerl 1.99.13) which has a
default template directory and processes a bunch of these templates. I
can write a perl script which will happily process my templates without
any problems from the shell.
The problem seems to arise when I do it through my handler. In this
situation, I seem to get a segmentation fault in the child when I
process the template. I've managed to track this down to one,
apparently
unsuspicious, line in Template::Process' interpolate_text method. It's
in a while loop, which uses the condition:
=======================
while ($text =~
/
( (?: \\. | [^\$] ){1,3000} )
# escaped or non-'$' character [$1]
|
( \$ (?:
# embedded variable [$2]
(?: \{ ([^\}]*) \} )
# ${ ... }[$3]
|
([\w\.]+)
# $word $4]
)
)
/gx) {
=======================
$text being the body of my file. What I find interesting is both that
the regular expression seems straightforward enough, and also that when
I dump $text it appears to only contain a portion of the template which
it is supposed to represent.
The code seg faults and dosn't get past this point. If I replace the
reg. exp. with /./, it obvious screws up elsewhere but there are no seg.
faults.
Can someone please tell me how to resolve this. I've cross-posted due
to this error only occuring under mod_perl. I was hoping that either
someone may have experienced something similar with other handlers or
perhaps it is a known tt2 problem? Further it is also important to note
that I've run the same code without any trouble using the pre-fork
apache model.
Anyhelp would be appreciated! I'm pretty baffled at the moment.
Many thanks!
Raf
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html