Message168495
| Author |
eric.snow |
| Recipients |
brett.cannon, eric.snow, gregory.p.smith, nordaux, r.david.murray, twouters |
| Date |
2012年08月18日.05:59:45 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1345269586.97.0.658354884733.issue15578@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Here's the deal. import_module_level() gets called for v1 from sa (where "globals" comes from). In that function it first calls get_parent(), which returns a borrowed reference to the sa module object. Then that parent object is passed to load_next() where the actual load of v1 will take place (and the segfault happens).
The problem is that get_parent() returns a borrowed reference. When the sa module is replaced in sys.modules, the old sa module is decref'ed. That's fine except load_next is using that same module as the parent. Enter segfault, stage left.
Here's a quick patch that fixes the failure (along with a test). |
|