This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author neologix
Recipients greg.ath, neologix, pitrou
Date 2011-06-21.10:28:30
SpamBayes Score 6.1411974e-08
Marked as misclassified No
Message-id <1308652111.4.0.820493628091.issue12352@psf.upfronthosting.co.za>
In-reply-to
Content
> Looking closely to the gdb stack, there is that frame:

Yeah, but it calls _free, which runs unlocked. That's not the problem.

> I am still unable to reproduce the bug in a simple script.

Try with this one:

"""
import multiprocessing.heap


tab = []

for i in range(100000):
    print(i)
    b = multiprocessing.heap.BufferWrapper(10)
    # create a circular reference (we want GC and not refcount collection when
    # the block goes out of scope)
    b.tab = tab
    tab.append(b)
    # drop buffers refcount to 0 to make them eligible to GC
    if i % 100 == 0:
        del tab
        tab = []
"""

It deadlocks pretty quickly (well, on my box).
And, as expected, disabling/enabling the GC inside malloc solves the problem.
I have to think a little bit more for a clean solution.
History
Date User Action Args
2011-06-21 10:28:31neologixsetrecipients: + neologix, pitrou, greg.ath
2011-06-21 10:28:31neologixsetmessageid: <1308652111.4.0.820493628091.issue12352@psf.upfronthosting.co.za>
2011-06-21 10:28:30neologixlinkissue12352 messages
2011-06-21 10:28:30neologixcreate