Just thought I'd mention in passing... no need for responses or navel gazing. :) We have two identical Zope envts on different OS platforms. (python 2.1.2, gcc 2.95.3, Zope 2.5.0 on openBSD 3.0 and Solaris 8) We migrated a Zope DTML application from Solaris systems (where it worked fine on 3 different Zope instances) to two openBSD systems. An obscure bit of "superfluous" DTML code caused lib/python/DTML.py to crash. Of course, when using ProxyPass method, it caused Zope itself to crash, but if we used FastCGI or port 8080, then it just failed... The offending code (marked *) <dtml-if sequence-end> * <dtml-call "REQUEST.set('span', (5 - (_.int(_.getitem('sequence-number')) % 4)) )"> * <dtml-if "_.getitem('span') > 4"><dtml-call "REQUEST.set('span', 1)"></dtml-if> <dtml-else> <dtml-call "REQUEST.set('span', 1)"> </dtml-if> then fixed with: <dtml-call "REQUEST.set('span', 1 )"> <dtml-if "_.getitem('span') > 4"><dtml-call "REQUEST.set('span', 1)"></dtml-if> In hindsight, the programmer qualifies this with: "ok.. but be prepared for some abuse about the shitty code.. I don't remember what I was thinking at the time and I could not understand what I was doing when I read it back.. that is generally a sign of bad code :)" We're all still learning.... :) I was just surprised (read "horrified", since it was production) that some DTML appln code would crash Zope itself. I put it down to the vagaries of C compiles on different platforms. cheers all hope you have a code-free Easter holiday... Graham
Graham King wrote:
We migrated a Zope DTML application from Solaris systems (where it worked fine on 3 different Zope instances) to two openBSD systems. An obscure bit of "superfluous" DTML code caused lib/python/DTML.py to crash.
Of course, when using ProxyPass method, it caused Zope itself to crash, but if we used FastCGI or port 8080, then it just failed...
What do you mean by crash? I've never had that problem with ProxyPass...
The offending code (marked *)
<dtml-if sequence-end> * <dtml-call "REQUEST.set('span', (5 - (_.int(_.getitem('sequence-number')) % 4)) )"> * <dtml-if "_.getitem('span') > 4"><dtml-call "REQUEST.set('span', 1)"></dtml-if> <dtml-else> <dtml-call "REQUEST.set('span', 1)"> </dtml-if>
then fixed with:
<dtml-call "REQUEST.set('span', 1 )"> <dtml-if "_.getitem('span') > 4"><dtml-call "REQUEST.set('span', 1)"></dtml-if>
This is pretty offensive code anyway! ;-) You should be using a python script for all this logic, and more than likely ZPT instead of DTML. Then your life will be much less painfull...
"ok.. but be prepared for some abuse about the shitty code.. I don't remember what I was thinking at the time and I could not understand what I was doing when I read it back.. that is generally a sign of bad code :)"
...no comment ;-)
We're all still learning.... :) I was just surprised (read "horrified", since it was production) that some DTML appln code would crash Zope itself.
I wouldn't expect a crash, comeone should look into that further... cheers, Chris
participants (2)
-
Chris Withers -
Graham King