make test segfaults with "--enable-shared" on Python 2.3.3

Berthold Höllmann bhoel at web.de
Sat Jan 3 17:31:35 EST 2004


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

> On Mon, 29 Dec 2003, Berthold Höllmann wrote:
>
>> so it seems that the other modules loaded in the "make test" run
>> decrease the avaliable stack so that the test does not succeed but
>> calling the test alone finds enough stack space avaliable?
...
> Note that there are some subtleties here - even though your ulimit says
> unlimited stackspace, in the presence of threads this may not hold.
> It certainly doesn't on FreeBSD 4.x where there the pthreads support has a
> hardcoded 1MB stack for the primary thread (which is what is running the

I found a document stating it is 2MB for each thread on Linux using Google

> regression test and is distinct from the stack created for each
> instantiated thread).  The LinuxThreads port on FreeBSD seems not to have
> the same restriction.  Exactly what is happening on your Linux system I
> don't know; you would have to do some research to find out.
>
> Depending on how you wish to proceed, you have a couple of options:
> - build normally, then blow away Modules/_sre.o and recompile
>   Modules/_sre.c with -Os (just temporarily doctor the Makefile).
>   From what I've seen -Os cuts the stack consumption enough to get
>   you through the full test suite, and doesn't seriously impact sre's
>   performance.

This does work for me

> - modify the USE_RECURSION_LIMIT macro in Modules/_sre.c to a lower value
>   and rebuild. Linux would be using the default definition of 10000 at
>   line 98 (for 2.3.3).

        #define USE_RECURSION_LIMIT 6835

does succeed,

        #define USE_RECURSION_LIMIT 6840

gives segfault for me. Will submit bugreport.

> - find a way to change the default stack size for the primary thread.

To be honest: I don't have an idea where to look at for this.

Regards

Berthold
-- 
bhoel at web.de / http://starship.python.net/crew/bhoel/
        It is unlawful to use this email address for unsolicited ads
        (USC Title 47 Sec.227). I will assess a US$500 charge for
        reviewing and deleting each unsolicited ad.



More information about the Python-list mailing list