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 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).
History
Date User Action Args
2012-08-18 05:59:47eric.snowsetrecipients: + eric.snow, twouters, brett.cannon, gregory.p.smith, r.david.murray, nordaux
2012-08-18 05:59:46eric.snowsetmessageid: <1345269586.97.0.658354884733.issue15578@psf.upfronthosting.co.za>
2012-08-18 05:59:46eric.snowlinkissue15578 messages
2012-08-18 05:59:46eric.snowcreate