Python Coredump on FreeBSD

Andrew MacIntyre andymac at bullseye.apana.org.au
Tue May 13 04:16:06 EDT 2003


On Mon, 12 May 2003, A.M. Kuchling wrote:

> On Mon, 12 May 2003 16:20:08 +0200,
> 	Harald Schneider <h_schneider at marketmix.com> wrote:
> > When I call
> > re.compile(.......).search(.....)
> > in sequence a few times, then the regular expression module re causes this
> > coredump. It's implementation must differ from other platforms. It looks
>
> What is the pattern being compiled, and how large is the string being
> searched?  There are patterns that consume a lot of C stack space while
> searching.  There's a fixed recursion limit that's intended to prevent core
> dumps, and it's possible the recursion limit is set incorrectly for FreeBSD.

If Harald is working with a recent CVS checkout of Python, rather than
Python 2.2.2, then there is definitely an issue, although I see bus errors
(sig 10) rather than sig 11's.

For 2.3b1, I supplied a patch which reduced the recursion depth for gcc
3.x builds to 7500 (from 10000).

Recent changes to _sre.c have extended the problem (again) to 2.95.3,
with backtraces showing recursion maxing out at about 8100.  gcc 3.x
builds can't even survive with 7500 any more either :-(

and this is using an account with notionally unlimited stack size...

I'll be posting another patch shortly for this, but I really wish I could
understand the situation better.

None of the above applies to Python 2.2.x AFAIK.

Harald, the first page full of output from the gdb command "bt"
(backtrace) would be useful, as would details on the specific version of
Python involved.

Regards,
Andrew.

--
Andrew I MacIntyre                     "These thoughts are mine alone..."
E-mail: andymac at bullseye.apana.org.au  | Snail: PO Box 370
        andymac at pcug.org.au            |        Belconnen  ACT  2616
Web:    http://www.andymac.org/        |        Australia






More information about the Python-list mailing list