Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Python 2.2.3 test_re.py fails with coredump on FreeBSD 5.0, fails also on FreeBSD4.8

0 views
Skip to first unread message

PieterB

unread,
Jun 21, 2003, 2:09:27 PM6/21/03
to
Ok,

I had a little look at testing Python 2.2.3 under FreeBSD and
5.0. When I use './configure ; make ; make test' Lib/test/test_re.py
gives a Signal 10 (coredump) on FreeBSD5. The test coredumps because
of the following test from Lib/test/test_re.py:

<code>
if verbose:
print 'Test engine limitations'

# Try nasty case that overflows the straightforward recursive
# implementation of repeated groups.
try:
verify(re.match('(x)*', 50000*'x').span() == (0, 50000))
except RuntimeError, v:
print v
</code>

On FreeBSD 4.8 this test also fails, but doesn't core dump:
%python2.2.3 test_re.py
Running tests on re.search and re.match
Running tests on re.sub
Running tests on symbolic references
Running tests on re.subn
Running tests on re.split
Running tests on re.findall
Running tests on re.match
Running tests on re.escape
Pickling a RegexObject instance
Test engine limitations
maximum recursion limit exceeded
Running re_tests test suite
=== Failed incorrectly ('(?u)\\w', u'\xc4', 0, 'found', u'\xc4')

Can anybody, give me a clue:
a) if this is caused by a FreeBSD5.0 issue, or by Python.
Can somebody test this on FreeBSD 5.1 or FreeBSD5-CVS?
b) how can I fix the coredump on FreeBSD 5.0?
c) what should be done to fix the test on FreeBSD 4.8?

Can this related to the FreeBSD python/zope/zwiki stability problems
for FreeBSD. (see http://zwiki.org/GeneralDiscussion200306). Zwiki
makes heavy use of regular expressions.

I also made some patches to make regrtest.py aware of freebsd4/freebsd5.
I've put them online at: http://www.gewis.nl/~pieterb/python/bugs-2.2.3/

Thanks in advance,

PieterB

--
http://zwiki.org/PieterB

Martin v. Löwis

unread,
Jun 21, 2003, 3:04:09 PM6/21/03
to
pie...@gewis.nl (PieterB) writes:

> Can anybody, give me a clue:
> a) if this is caused by a FreeBSD5.0 issue, or by Python.

Yes. :-)

Python causes a stack overflow on FreeBSD. It is a FreeBSD issue, for
having a unreasonable tiny stack, and a Python issue, for not knowing
about that.

> Can somebody test this on FreeBSD 5.1 or FreeBSD5-CVS?

It has been tested before, and various patches have been applied in
various versions of the software. Everytime it got "fixed", a new
FreeBSD version came along, and broke it again.

This time, it is gcc 3.2, which produces larger stack frames, causing
stack exhaustion earlier.

> b) how can I fix the coredump on FreeBSD 5.0?

I recommend to check out the release22-maint branch of Python, and
copy Modules/_sre.c from there. This is a backport of the patch that
reportedly fixes the problem for 2.3.

> c) what should be done to fix the test on FreeBSD 4.8?

Likewise.

> Can this related to the FreeBSD python/zope/zwiki stability problems
> for FreeBSD. (see http://zwiki.org/GeneralDiscussion200306). Zwiki
> makes heavy use of regular expressions.

That might be the case.

Regards,
Martin

Andrew MacIntyre

unread,
Jun 21, 2003, 9:21:29 PM6/21/03
to
On Sun, 21 Jun 2003, PieterB wrote:

> I had a little look at testing Python 2.2.3 under FreeBSD and
> 5.0. When I use './configure ; make ; make test' Lib/test/test_re.py
> gives a Signal 10 (coredump) on FreeBSD5.

{...}

> On FreeBSD 4.8 this test also fails, but doesn't core dump:

It coredumps on 4.8 for me...

> Can anybody, give me a clue:
> a) if this is caused by a FreeBSD5.0 issue, or by Python.
> Can somebody test this on FreeBSD 5.1 or FreeBSD5-CVS?
> b) how can I fix the coredump on FreeBSD 5.0?
> c) what should be done to fix the test on FreeBSD 4.8?

Take Martin's advice. If you want to know more, review SF #740234.

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

Harald Schneider

unread,
Jun 23, 2003, 2:25:44 AM6/23/03
to
import pre as re

is a practical workaround for most appliacations on the FreeBSD platform.

--Harald


"PieterB" <pie...@gewis.nl> schrieb im Newsbeitrag
news:2251d03c.03062...@posting.google.com...

0 new messages