Test error with Python 2.3.4c1

Berthold Höllmann hoel at gl-group.com
Mon May 17 10:51:59 EDT 2004


Andrew MacIntyre <andymac at bullseye.apana.org.au> writes:

> On Sun, 16 May 2004, Berthold Höllmann wrote:
>
>> > caused some changes to the way sre operates, so it was a non-starter for
>> > the 2.3.x series.
>> >
>> > Anyway, please close your bug with a note about it being fixed in 2.4
>> > CVS.  As for the other issue, I don't have enough time/energy to even
>> > understand what the issue is.  Given that it's about SAX, I suggest you
>> > start a new thread and hopefully someone else will pick it up.
>>
>> OK, I closed the bug, but still would like to see USE_RECURSION_LIMIT
>> default reduced to something like 6500 (3000 seems to be OK for
>> FreeBSD on sparc64, so I guess this can't be a behavioral change).
>
> Prior to 2.4, sre is recursive.  Recent versions of gcc (in particular)
> at higher optimisation levels are generating much larger stack frames than
> used to be the case.  This is even moreso the case with 64-bit platforms.
>
> In the particular case of FreeBSD 4.x, in the presence of threads (the
> default build choice, using libc_r) there is a hard coded stack size of
> 1MB, which leaves this environment especially sensitive to stack frame
> size.  The alternative threads libraries (libkse/libthr) available on 5.x
> are less affected, but I don't know to what extent (& Python's configure
> script doesn't know about them that I've heard).
>
> I've seen reference to the problem on Linux, but I don't know why that
> platform is (apparently) short on stack.
>
> This is a highly platform/compiler dependant issue, which is why the maze
> of #ifdef'ery for USE_RECURSION_LIMIT - something that has only happened
> since about Python 2.3.1 as I recall.
>
> The most effective solution with recent gcc versions is to recompile sre.c
> with -Os (instead of -O3).  It is unfortunately awkward to implement with
> autoconf.  The non-recursive sre in 2.4 is a complete fix, but is too
> extensive/invasive a change for back-porting for a bug-fix release.

But the current value for USE_RECURSION_LIMIT is a problem on (some)
Linux Platforms. Why is reducing the default value a problem, when
setting it to a smaller value on some platforms is not a problem. I
thought everything causing segmentation faults from Python is to be
avoided.

Regards
Berthold
-- 
Dipl.-Ing. Berthold Höllmann   __   Address:
hoel at GL-Group.com           G /  \ L Germanischer Lloyd
phone: +49-40-36149-7374    -+----+- Vorsetzen 32/35    P.O.Box 111606
fax  : +49-40-36149-7320      \__/   D-20459 Hamburg    D-20416 Hamburg



More information about the Python-list mailing list