[Python-Dev] [Fwd: segfault in sre on 64-bit plats]

Trent Mick trentm@ActiveState.com
Thu, 17 Aug 2000 14:41:04 -0700


On Thu, Aug 17, 2000 at 09:17:42AM +0800, Mark Favas wrote:
> [Trent]
> > This test on Win32 and Linux32 hits the recursion limit check of 10000 in
> > SRE_MATCH(). However, on Linux64 the segfault occurs at a recursion depth of
> > 7500. I don't want to just willy-nilly drop the recursion limit down to make
> > the problem go away.
> > 
> 
> Sorry for the delay - yes, I had these segfaults due to exceeding the
> stack size on Tru64 Unix (which, by default, is 2048 kbytes) before
> Fredrick introduced the recusrion limit of 10000 in _sre.c. You'd expect
> a 64-bit OS to use a bit more bytes of the stack when handling recursive
> calls, but your 7500 down from 10000 sounds a bit much - unless the

Actually with pointers being twice the size the stack will presumably get
comsumed more quickly (right?), so all other things being equal the earlier
stack overflow is expected.

> stack size limit you're using on Linux64 is smaller than that for
> Linux32 - what are they?

------------------- snip --------- snip ----------------------
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>

int main(void)
{
    struct rlimit lims;
    if (getrlimit(RLIMIT_STACK, &lims) != 0) {
        printf("error in getrlimit\n");
        exit(1);
    }
    printf("cur stack limit = %d, max stack limit = %d\n",
        lims.rlim_cur, lims.rlim_max);
    return 0;
}
------------------- snip --------- snip ----------------------

On Linux32:

    cur stack limit = 8388608, max stack limit = 2147483647

On Linux64:

    cur stack limit = 8388608, max stack limit = -1


Trent

-- 
Trent Mick
TrentM@ActiveState.com