[Cheetahtemplate-discuss] Cheetah causing Python to segfault
Brought to you by:
rtyler,
tavis_rudd
|
From: Warren S. <wa...@wa...> - 2002-07-17 21:00:41
|
I have been evaluating Webware and Cheetah for possible use in a number
of upcoming applications. For the most part, I like what I see.
As part of my evaluation, I have been developing a proof-of-concept
application and have run into a situation in which it seems that Cheetahis causing Python to segfault.
My platform looks like this:
OS: FreeBSD 4.6-RELEASE-p2
Web Server: Apache 1.3.26 with mod_webkit
Python: 2.2.1
Webware: 0.7
Cheetah: 0.9.13
I built the application in the manner recommended by the docs, using the
inheritance model. In doing so, my inheritance tree became moderately
deep as I tried to extract common behavior into base classes, anticipating
being able to share these between several applications.
My inheritance tree looks like this:
SkeletonPage # Included with Cheetah
BaseLogic.py # My global base class
BaseTemplate # My global base template
SidebarTemplate # My global "Sidebar" template
AppBaseLogic # My app's base class
AppBaseTemplate # My app's base template
Page1Logic
Page1
Page4Logic
Page4
Page2Logic
Page2
Page3
etc...
Everthing worked fine untill I began work on Page4. I found that if I
requested Page4 (or even Page4Logic) right after restarting WebKit, Python
would segfault. This was surprising given that I had experienced
absolutelyno stability problems with Python or WebKit up to this point.
After much experimentation I found that one of the things that the crashes
seemed to have in common was the inheritance level of the servlet
requested.
Wanting to know if this was a problem produced by my code or by the
Webware and Cheetah code, I changed all of my modules, from BaseLogic
down, to:
from MODULE_NAME import BASE_CLASS_NAME
class SUB_CLASS_NAME(BASE_CLASS_NAME):
pass
Still, any request for Page4Logic or below after restarting WebKit would
cause Python to segfault.
Wanting to know if the problem was with Webware or Cheetah, I changed
BaseLogic to inherit from WebKit.Page and the segfaults stopped.
From this I suspect that there may be a bug in the Cheetah code somewhere,
or that Cheetah is exposing a bug in Webware or Python 2.2.1 somehow.
Since it only happens right after WebKit has been restarted, I suspectit might be code that only executes on import.
It seems I can work around this by requesting a higher level page before
Page4. However, since I will not be able to control the sequence of real
requests, I cannot seriously consider using Cheetah for a real application
until I resolve this issue.
Thanks in advance for any help that anyone can give me.
--
Warren Smith
wa...@wa...
|