[Spambayes] seg faults?
skip at pobox.com
Tue Jan 28 16:08:09 EST 2003
>> sh: ulimit -s 2048
>> Would it be desirable to have pop3proxy.py take care of this?
Richie> Is that possible? Can a process increase its own stack size?
Richie> Or would we need a shellscript wrapper? Any Mac OS X users
Richie> fancy taking on the job?
This topic came up on python-dev. The conclusion there was that the
regression test script should take care of this for its own needs, but not
to do this in general. Here's the relevant code from Lib/test/regrtest.py:
# MacOSX (a.k.a. Darwin) has a default stack size that is too small
# for deeply recursive regular expressions. We see this as crashes in
# the Python test suite when running test_re.py and test_sre.py. The
# fix is to set the stack limit to 2048.
# This approach may also be useful for other Unixy platforms that
# suffer from small default stack limits.
if sys.platform == 'darwin':
soft, hard = resource.getrlimit(resource.RLIMIT_STACK)
newsoft = min(hard, max(soft, 1024*2048))
resource.setrlimit(resource.RLIMIT_STACK, (newsoft, hard))
More information about the Spambayes