[PyPy-issue] [issue524] intermittent seg fault

D.S. McNeil pypy-dev-issue at codespeak.net
Thu Apr 29 05:35:29 CEST 2010

D.S. McNeil <dsm053 at gmail.com> added the comment:

I grew frustrated with how sensitive my test case was and so looked
for other loop-intensive code I had around that might crash.  I found
another that segfaulted, and after a fair bit of work I managed to
reduce it to the following which asserts under an lldebug build for me.

ii = range(512)
xx = range(100)

c = 0
for x in xx:
    for i0 in ii:
        a = list()
        for i1 in ii:
            b = list()
            c += 1
            print b, i0, i1, c

which gives

PyPy assertion failed at implement.c:12750:
in pypy_g__check_typeid: invalid type_id

changing the ranges to range(100), range(4) gives

PyPy assertion failed at implement.c:65795:
in pypy_g_SemiSpaceGC_set_forwarding_address: unexpected GCFLAG_EXTERNAL

or, if I print 'a' instead of b, I get

Invalid RPython operation (NULL ptr or bad array index)

Random corruption symptoms 4tw!

Miscellaneous notes: the above only crashes for me when redirected to
a file, but I have other cases which crash without redirection.

Removing the print statement or lowering the range limits sufficiently
avoids the crash.

PyPy development tracker <pypy-dev-issue at codespeak.net>

More information about the Pypy-issue mailing list