[Python-Dev] Preserving the blamelist (original) (raw)
Tim Peters tim.peters at gmail.com
Wed Apr 12 09:00:11 CEST 2006
- Previous message: [Python-Dev] Preserving the blamelist
- Next message: [Python-Dev] Preserving the blamelist
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[Neal]
... I'm concerned about the negative ref leak in testcontextlib. I wonder if this was a result of PJE's fix for generators?
[Tim]
I don't know, but if you do
while 1: testcontextlib.testmain() gc.collect() under a debug build it eventually (> 500 iterations) crashes with Fatal Python error: deallocating None ...
OK, I fixed that (incorrect decref in gen_throw()).
Neal, that should also repair test_contextlib's ref leak oddities. The reason you didn't see this before is that test_contextlib didn't actually run any tests until recently.
Phillip, when eyeballing gen_dealloc(), I didn't understand two things:
Why doesn't
if (gen->gi_frame->f_stacktop!=NULL) {
check first to be sure that gen->gi_frame != Py_None? Is that impossible here for some reason?
It looks like "gi_frame != NULL" is an (undocumented) invariant. Right? If so,
Py_XDECREF(gen->gi_frame);
sends a confusing message (because of the "X", implying that NULL is OK). Regardless, it would be good to add comments to genobject.h explaining the possible values gi_frame can hold. For example, what does it mean when gi_frame is Py_None? Can it ever be NULL? It's very hard to reverse- engineer invariants and "special value" intents from staring at code. Not to say that isn't fun ;-)
- Previous message: [Python-Dev] Preserving the blamelist
- Next message: [Python-Dev] Preserving the blamelist
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]