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 vstinner
Recipients amaury.forgeotdarc, christian.heimes, vstinner
Date 2008-10-31.01:10:22
SpamBayes Score 0.00077738386
Marked as misclassified No
Message-id <1225415426.34.0.321790766829.issue4236@psf.upfronthosting.co.za>
In-reply-to
Content
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 is exiting.

Call trace:

Py_Finalize() -> PyImport_Cleanup() -> 
builtin___import__("warnings") -> builtin___import__("_warnings") -> 
_PyWarnings_Init() -> PyModule_Create2()

Full backtrace:
(gdb) where
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb7d68875 in raise () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7d6a201 in abort () from /lib/tls/i686/cmov/libc.so.6
#3  0x080ba54b in Py_FatalError (msg=0x8163ad0 "Interpreter not 
initialized (version mismatch?)") at Python/pythonrun.c:1922
#4  0x081248e2 in PyModule_Create2 (module=0x8174e20, 
module_api_version=1013) at Objects/moduleobject.c:71
#5  0x080882d7 in _PyWarnings_Init () at Python/_warnings.c:879
#6  0x080abcb0 in init_builtin (name=0xbf8627a3 "_warnings") at 
Python/import.c:1867
#7  0x080aba9f in load_module (name=0xbf8627a3 "_warnings", fp=0x0, 
buf=0xbf8627a3 "_warnings", type=6, loader=0x0) at 
Python/import.c:1795
#8  0x080ad54f in import_submodule (mod=0x81695a4, 
subname=0xbf863833 "_warnings", fullname=0xbf863833 "_warnings") at 
Python/import.c:2567
#9  0x080acd21 in load_next (mod=0x81695a4, altmod=0x81695a4, 
p_name=0xbf863814, buf=0xbf863833 "_warnings", p_buflen=0xbf86381c)
    at Python/import.c:2372
#10 0x080ac26e in import_module_level (name=0x0, globals=0xb7b2802c, 
locals=0xb7b2802c, fromlist=0xb7b208fc, level=0) at 
Python/import.c:2089
#11 0x080ac5b2 in PyImport_ImportModuleLevel 
(name=0xb7b2c650 "_warnings", globals=0xb7b2802c, locals=0xb7b2802c, 
fromlist=0xb7b208fc,
    level=0) at Python/import.c:2140
#12 0x08088b0d in builtin___import__ (self=0xb7be8eac, 
args=0xb7b2098c, kwds=0x0) at Python/bltinmodule.c:173
#13 0x081241c6 in PyCFunction_Call (func=0xb7be8f6c, arg=0xb7b2098c, 
kw=0x0) at Objects/methodobject.c:84
#14 0x080ec5b8 in PyObject_Call (func=0xb7be8f6c, arg=0xb7b2098c, 
kw=0x0) at Objects/abstract.c:2184
#15 0x08094bae in PyEval_CallObjectWithKeywords (func=0xb7be8f6c, 
arg=0xb7b2098c, kw=0x0) at Python/ceval.c:3278
#16 0x080916dd in PyEval_EvalFrameEx (f=0x826661c, throwflag=0) at 
Python/ceval.c:1985
#17 0x08093d64 in PyEval_EvalCodeEx (co=0xb7b25608, 
globals=0xb7b2802c, locals=0xb7b2802c, args=0x0, argcount=0, kws=0x0, 
kwcount=0,
    defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at 
Python/ceval.c:2835
#18 0x0808d2b4 in PyEval_EvalCode (co=0xb7b25608, globals=0xb7b2802c, 
locals=0xb7b2802c) at Python/ceval.c:519
#19 0x080a9be8 in PyImport_ExecCodeModuleEx 
(name=0xbf866dd3 "warnings", co=0xb7b25608,
    pathname=0xbf864ca3 "/home/haypo/prog/py3k/Lib/warnings.pyc") at 
Python/import.c:729
#20 0x080aa41e in load_source_module (name=0xbf866dd3 "warnings", 
pathname=0xbf864ca3 "/home/haypo/prog/py3k/Lib/warnings.pyc", 
fp=0x82650f8)
    at Python/import.c:1020
#21 0x080aba14 in load_module (name=0xbf866dd3 "warnings", 
fp=0x82650f8, buf=0xbf865d43 "/home/haypo/prog/py3k/Lib/warnings.py", 
type=1,
    loader=0x0) at Python/import.c:1773
#22 0x080ad54f in import_submodule (mod=0x81695a4, 
subname=0xbf866dd3 "warnings", fullname=0xbf866dd3 "warnings") at 
Python/import.c:2567
#23 0x080acd21 in load_next (mod=0x81695a4, altmod=0x81695a4, 
p_name=0xbf866db4, buf=0xbf866dd3 "warnings", p_buflen=0xbf866dbc)
    at Python/import.c:2372
#24 0x080ac26e in import_module_level (name=0x0, globals=0xb7c0402c, 
locals=0x81695a4, fromlist=0x81695a4, level=0) at Python/import.c:2089
#25 0x080ac5b2 in PyImport_ImportModuleLevel 
(name=0xb7b1f850 "warnings", globals=0xb7c0402c, locals=0x81695a4, 
fromlist=0x81695a4, level=0)
    at Python/import.c:2140
#26 0x08088b0d in builtin___import__ (self=0xb7be8eac, 
args=0xb7b87e6c, kwds=0x0) at Python/bltinmodule.c:173
#27 0x081241c6 in PyCFunction_Call (func=0xb7be8f6c, arg=0xb7b87e6c, 
kw=0x0) at Objects/methodobject.c:84
#28 0x080ec5b8 in PyObject_Call (func=0xb7be8f6c, arg=0xb7b87e6c, 
kw=0x0) at Objects/abstract.c:2184
#29 0x08094bae in PyEval_CallObjectWithKeywords (func=0xb7be8f6c, 
arg=0xb7b87e6c, kw=0x0) at Python/ceval.c:3278
#30 0x080916dd in PyEval_EvalFrameEx (f=0x8264fa4, throwflag=0) at 
Python/ceval.c:1985
#31 0x08093d64 in PyEval_EvalCodeEx (co=0xb7b62c80, 
globals=0xb7c0402c, locals=0x0, args=0xb7b1f4d8, argcount=1, kws=0x0, 
kwcount=0,
    defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at 
Python/ceval.c:2835
---Type <return> to continue, or q <return> to quit---
#32 0x08111b1e in function_call (func=0xb7b2626c, arg=0xb7b1f4cc, 
kw=0x0) at Objects/funcobject.c:628
#33 0x080ec5b8 in PyObject_Call (func=0xb7b2626c, arg=0xb7b1f4cc, 
kw=0x0) at Objects/abstract.c:2184
#34 0x080fe956 in method_call (func=0xb7b2626c, arg=0xb7b1f4cc, 
kw=0x0) at Objects/classobject.c:323
#35 0x080ec5b8 in PyObject_Call (func=0xb7b1f6cc, arg=0xb7bde02c, 
kw=0x0) at Objects/abstract.c:2184
#36 0x08094bae in PyEval_CallObjectWithKeywords (func=0xb7b1f6cc, 
arg=0xb7bde02c, kw=0x0) at Python/ceval.c:3278
#37 0x0806bf2d in slot_tp_del (self=0xb7b2906c) at 
Objects/typeobject.c:5230
#38 0x080613eb in subtype_dealloc (self=0xb7b2906c) at 
Objects/typeobject.c:922
#39 0x0811eb64 in insertdict (mp=0xb7be0acc, key=0xb7c03ac0, 
hash=-724865314, value=0x81695a4) at Objects/dictobject.c:461
#40 0x0811f20d in PyDict_SetItem (op=0xb7be0acc, key=0xb7c03ac0, 
value=0x81695a4) at Objects/dictobject.c:730
#41 0x081218a4 in PyDict_SetItemString (v=0xb7be0acc, 
key=0x8153c82 "_", item=0x81695a4) at Objects/dictobject.c:2092
#42 0x080a902b in PyImport_Cleanup () at Python/import.c:419
#43 0x080b7518 in Py_Finalize () at Python/pythonrun.c:408
#44 0x080c80ad in Py_Main (argc=1, argv=0x81af008) at 
Modules/main.c:639
#45 0x0805a2ab in main (argc=1, argv=0xbf869624) 
at ./Modules/python.c:70
History
Date User Action Args
2008-10-31 01:10:26vstinnersetrecipients: + vstinner, amaury.forgeotdarc, christian.heimes
2008-10-31 01:10:26vstinnersetmessageid: <1225415426.34.0.321790766829.issue4236@psf.upfronthosting.co.za>
2008-10-31 01:10:25vstinnerlinkissue4236 messages
2008-10-31 01:10:22vstinnercreate