[issue4236] Crash when importing builtin module during interpreter shutdown

2010-12-14 Thread R. David Murray
R. David Murray added the comment: Committed to py3k in r87251, 3.1 in r87252, and 2.7 in r87255. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___

[issue4236] Crash when importing builtin module during interpreter shutdown

2010-12-14 Thread Brett Cannon
Brett Cannon added the comment: Nothing jumps to my mind. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue4236] Crash when importing builtin module during interpreter shutdown

2010-12-14 Thread R. David Murray
R. David Murray added the comment: Brett applied his doc patch in r69092. Attached is a patch that combines Simon's patch with Martin's test program turned into a unit test. I confirm that the test suite passes with the patch applied (and fails with just the test applied). >From the text o

[issue4236] Crash when importing builtin module during interpreter shutdown

2010-11-20 Thread Simon Cross
Simon Cross added the comment: I'm attaching a patch to relax the check in PyModule_Create2 as suggested by the Amaury (http://bugs.python.org/issue4236#msg75409). The patch uses "PyThreadState_Get()->interp->modules == NULL" to determine whether the import machinery has been cleaned up yet.

[issue4236] Crash when importing builtin module during interpreter shutdown

2010-08-08 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- versions: -Python 2.6, Python 3.0 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue4236] Crash when importing builtin module during interpreter shutdown

2010-07-13 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The bug is still present in 2.7, and 3.2. -- nosy: +belopolsky ___ Python tracker ___ ___ Pyth

[issue4236] Crash when importing builtin module during interpreter shutdown

2009-05-29 Thread R. David Murray
Changes by R. David Murray : -- components: +Interpreter Core stage: -> needs patch type: -> crash versions: +Python 2.6, Python 2.7, Python 3.1, Python 3.2 ___ Python tracker _

[issue4236] Crash when importing builtin module during interpreter shutdown

2008-11-24 Thread Brett Cannon
Changes by Brett Cannon <[EMAIL PROTECTED]>: -- assignee: brett.cannon -> ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-li

[issue4236] Crash when importing builtin module during interpreter shutdown

2008-11-20 Thread Barry A. Warsaw
Barry A. Warsaw <[EMAIL PROTECTED]> added the comment: After consultation with MvL and Crys_ on irc, we've agreed that this should be fixed someday but it's a pathological case that shouldn't hold up the release. I'm lowering to critical because I don't think it should even hold up the final rel

[issue4236] Crash when importing builtin module during interpreter shutdown

2008-11-20 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: Here is a test case (a.py) which produces a FatalError back to Python 2.4 at least) Added file: http://bugs.python.org/file12073/a.py ___ Python tracker <[EMAIL PROTECTED]>

[issue4236] Crash when importing builtin module during interpreter shutdown

2008-11-19 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: I don't think there is anything to fix here beyond the docs for __del__. You should never expect anything to be working in __del__, and that includes the import machinery. It should be bare-bones, not trying to pull in new code! I have attached

[issue4236] Crash when importing builtin module during interpreter shutdown

2008-11-19 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: So if you look at Python/pythonrun.c, there is a comment from Tim Peters (from r34776) where he explicitly points out that this is possibility but that it has never been reported before. Oops. =) -- nosy: +brett.cannon

[issue4236] Crash when importing builtin module during interpreter shutdown

2008-11-07 Thread Barry A. Warsaw
Changes by Barry A. Warsaw <[EMAIL PROTECTED]>: -- priority: deferred blocker -> release blocker ___ Python tracker <[EMAIL PROTECTED]> ___

[issue4236] Crash when importing builtin module during interpreter shutdown

2008-11-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: Christian, The initial example only works in interactive mode. To make your script crash, you have to set __builtins__._ = Crasher() There are several other places where Crasher() will crash on shutdown: sys.argv.insert(0, Cras

[issue4236] Crash when importing builtin module during interpreter shutdown

2008-11-06 Thread Christian Heimes
Christian Heimes <[EMAIL PROTECTED]> added the comment: Strange, I can't reproduce the problem with any Python version. Even py3k doesn't crash with either "import imp" and "import warnings". $ cat ../issue4236.py class Crasher(object): def __del__(self): print("__del__ called")

[issue4236] Crash when importing builtin module during interpreter shutdown

2008-11-06 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: PyModule_Create2 might be new, but the warning certainly is not - for 2.x, it lives in Py_InitModule4. Indeed, I can reproduce the problem with 2.7a0, replacing the import of warnings with an import of imp. __

[issue4236] Crash when importing builtin module during interpreter shutdown

2008-11-05 Thread Barry A. Warsaw
Barry A. Warsaw <[EMAIL PROTECTED]> added the comment: This seems like a corner case to me. We should fix it before the final release, but I don't think it's worth holding up 3.0rc2 for it. Deferring. -- priority: release blocker -> deferred blocker ___

[issue4236] Crash when importing builtin module during interpreter shutdown

2008-11-03 Thread Barry A. Warsaw
Barry A. Warsaw <[EMAIL PROTECTED]> added the comment: Can you add some tests for this problem? -- nosy: +barry ___ Python tracker <[EMAIL PROTECTED]> ___ _

[issue4236] Crash when importing builtin module during interpreter shutdown

2008-10-31 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: Setting builtins._=None is not enough. My example is very simple, but the crash I had initially was during the deletion of sys.last_tb: the C() object may be stored anywhere. I agree that the test in PyModule_Create2 is too strong: the

[issue4236] Crash when importing builtin module during interpreter shutdown

2008-10-30 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: Python2 is not affected because the bug comes from PyModule_Create2() which was introduced in Python3. ___ Python tracker <[EMAIL PROTECTED]>

[issue4236] Crash when importing builtin module during interpreter shutdown

2008-10-30 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: Another solution: just remove the initialization test from PyModule_Create2(). I don't know if it's a safety test or something like that. Added file: http://bugs.python.org/file11915/pymodule_create2.patch _

[issue4236] Crash when importing builtin module during interpreter shutdown

2008-10-30 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: Here is a patch fixing this issue: set builtins._=None at exit. The new introduced function, PyRun_InteractiveCleanup(), might also be called at the end of other functions like PyRun_InteractiveOne() or PyRun_InteractiveOneFlags(). If not,

[issue4236] Crash when importing builtin module during interpreter shutdown

2008-10-30 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: The problem occurs in PyImport_Cleanup() on this line: PyDict_SetItemString(dict, "_", Py_None); So the problem is that "_" (special variable in the Python interpreter) is removed too late, or that a destructor loads a module when Python

[issue4236] Crash when importing builtin module during interpreter shutdown

2008-10-29 Thread Christian Heimes
Christian Heimes <[EMAIL PROTECTED]> added the comment: I can reproduce the same output with CTRL+D on Linux. $ python3.0 Python 3.0rc1+ (py3k:67029M, Oct 26 2008, 23:48:21) [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> c

[issue4236] Crash when importing builtin module during interpreter shutdown

2008-10-29 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc <[EMAIL PROTECTED]>: The following interactive session crashes the interpreter on shutdown: >>> class C: ... def __del__(self): ... import warnings ... >>> C() <__main__.C object at 0x00C29D58> >>> ^Z Fatal Python error: Interpreter not initialized