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 bkabrda
Recipients bkabrda
Date 2013-11-08.12:30:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <[email protected]>
In-reply-to
Content
When Python is compiled with COUNT_ALLOCS, some tests in test_gc and test_module fail. I'm attaching the patch that skips 3 of them and modifies assertions in one of them, so that the tests pass.

I'm however still unsure about one of the skipped tests, since I'm unsure whether I totally understand what's wrong there - test_gc_ordinary_module_at_shutdown.

My guess is that due to COUNT_ALLOCS causing immortal types, the "final_a" and "final_b" types don't get destroyed on line [1] as they do in builds without COUNT_ALLOCS. AFAICS they are only "un-immortalized" on this line and destroyed during the following loop [2]. The problem here is that the order of destroyed modules is not deterministic, so sometimes the builtins module gets destroyed before the "final_X" and there is no "print" function, which makes the __del__ functions from "final_X" fail. IMO the best thing to do is to just skip this test with COUNT_ALLOCS. But I may be wrong, I don't have a great insight into Python's GC and module unloading.


[1] http://hg.python.org/cpython/annotate/0f48843652b1/Python/import.c#l383
[2] http://hg.python.org/cpython/annotate/0f48843652b1/Python/import.c#l394
History
Date User Action Args
2013-11-08 12:30:13bkabrdasetrecipients: + bkabrda
2013-11-08 12:30:13bkabrdasetmessageid: <[email protected]>
2013-11-08 12:30:13bkabrdalinkissue19527 messages
2013-11-08 12:30:13bkabrdacreate