classification
Title: imp.reload() on a package leads to a segfault or a GC assertion failure
Type: crash Stage:
Components: Library (Lib) Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: Arfrever, brett.cannon
Priority: release blocker Keywords:

Created on 2012-04-22 23:17 by brett.cannon, last changed 2012-04-29 18:41 by brett.cannon. This issue is now closed.

Messages (3)
msg158993 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2012-04-22 23:17
> ./python.exe -c "import urllib.parse as x; import imp; imp.reload(x)"
Assertion failed: (gc->gc.gc_refs != 0), function visit_decref, file Modules/gcmodule.c, line 327.
zsh: abort      ./python.exe -c "import urllib.parse as x; import imp; imp.reload(x)"

I even triggered a segfault that I can't reproduce.
msg158994 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2012-04-22 23:21
Segfault:

> ./python.exe -c "import importlib.abc as x; import imp; imp.reload(x)"                                                     
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 611, in load_module
  File "<frozen importlib._bootstrap>", line 271, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 499, in _load_module
  File "/Users/bcannon/Developer/repo/cpython/py3k/Lib/importlib/abc.py", line 2, in <module>
    from . import _bootstrap
ImportError: cannot import name _bootstrap
zsh: segmentation fault  ./python.exe -c "import importlib.abc as x; import imp; imp.reload(x)"
msg159642 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2012-04-29 18:41
Fixed by http://hg.python.org/cpython/rev/eb68502731dd
History
Date User Action Args
2012-04-29 18:41:56brett.cannonsetstatus: open -> closed
messages: + msg159642

assignee: brett.cannon
resolution: fixed
stage: test needed ->
2012-04-24 05:03:06Arfreversetnosy: + Arfrever
2012-04-22 23:21:14brett.cannonsettype: crash
messages: + msg158994
title: imp.reload() on a package leads to a GC assertion failure -> imp.reload() on a package leads to a segfault or a GC assertion failure
2012-04-22 23:17:56brett.cannoncreate