Author neologix
Recipients Albert.Zeyer, neologix, pitrou, r.david.murray
Date 2013-02-26.06:57:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAH_1eM3S7C88fdwoF=2ZNnsAtOb2SgCMiJFzh+XgHbPNqCb=CQ@mail.gmail.com>
In-reply-to <1361799442.43.0.308714279488.issue17263@psf.upfronthosting.co.za>
Content
> Note that in threadmodule.c, in local_clear, we are iterating through all threads:
>
> In PyDict_DelItem, if the GIL is released and meanwhile, the list of threadstates is altered, is that a problem for this loop? So maybe tstate becomes invalid there.

Yes.
If PyDict_DelItem() releases the GIL and tstate is deleted,
PyThreadState_Next(tstate) is undefined behavior (it accesses
tstate->next).

Changing your reproducer to create/wait for termination of threads in
a loop in a background thread.
History
Date User Action Args
2013-02-26 06:57:33neologixsetrecipients: + neologix, pitrou, r.david.murray, Albert.Zeyer
2013-02-26 06:57:32neologixlinkissue17263 messages
2013-02-26 06:57:32neologixcreate