[pypy-issue] Issue #1965: Greenlets on OSX Yosemite segfault (pypy/pypy)

Mike Kaplinskiy issues-reply at bitbucket.org
Tue Jan 20 04:59:42 CET 2015


New issue 1965: Greenlets on OSX Yosemite segfault
https://bitbucket.org/pypy/pypy/issue/1965/greenlets-on-osx-yosemite-segfault

Mike Kaplinskiy:

Looks like it's heap corruption. Something as simple as:

```
#!python

from greenlet import greenlet, getcurrent

def switch_back():
    getcurrent().parent.switch()

i = 0
while True:
    greenlet(switch_back).switch()

    if i % 100 == 0:
        print i
    i += 1
```

GDB says the crash happens at malloc, which seems to be heap corruption.

```
#0  0x00007fff8526cffa in szone_malloc_should_clear () from /usr/lib/system/libsystem_malloc.dylib
#1  0x00007fff8526c877 in malloc_zone_malloc () from /usr/lib/system/libsystem_malloc.dylib
#2  0x00007fff8526b395 in malloc () from /usr/lib/system/libsystem_malloc.dylib
#3  0x00000001010d7555 in g_save_state () from /Users/mkaplinskiy/pypy-hg/libpypy-c.dylib
#4  0x00000001010d746e in slp_switch () from /Users/mkaplinskiy/pypy-hg/libpypy-c.dylib
#5  0x0000000100000000 in ?? ()
#6  0x00000001054131c0 in ?? ()
#7  0x00000000ffffffff in ?? ()
#8  0x000000010495bd30 in ?? ()
#9  0x0000000103f41570 in ?? ()
#10 0x0000000100204970 in pypy_g_BuiltinActivation_UwS_W_Continulet__run () from /Users/mkaplinskiy/pypy-hg/libpypy-c.dylib
#11 0x00000001010d7518 in stacklet_switch () from /Users/mkaplinskiy/pypy-hg/libpypy-c.dylib
...
```




More information about the pypy-issue mailing list