[Zope-dev] [BUG] Python 2.1.2 & Zope 2.4.1

Anthony Baxter Anthony Baxter <anthony@interlink.com.au>
Tue, 29 Jan 2002 14:37:59 +1100


>>> "Olivier Deckmyn" wrote
> assertion "STACK_LEVEL() <= f->f_stacksize" failed: file "Python/ceval.c",
> line 687

This is a new assertion, put in to catch the case where the RestrictedCompiler
code used by PythonScripts incorrectly calculates stack size.

> After some hours of researches, I have a (dirty, really) fix :
> I had to modify Python sources and hack line 687 in ceval.c  : I removed
> it...

This is _not_ a fix, any more than putting in a signal handler for 
SIGSEGV that ignored it and kept going would be a "fix" for a segfault
bug. The bug is _real_ and causes memory corruption. The most likely 
result is that Zope will crash mysteriously, some time later down the 
track, but it's also possible you'll end up with random data corruption. 
This is _far_ worse than just a crash.

If upgrading to 2.5 or 2.4.4-to-be is not an issue, just replace the
lib/python/RestrictedPython package in your Zope installation and reboot.

Please, please, please, don't propagate dodgy and incorrect fixes like
the above (removing the assertion). The assertion is in the code for a
very, very good reason.

Anthony