-
Notifications
You must be signed in to change notification settings - Fork 752
Debugging crash in Python 3.6 #884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
(lldb) clrstack -f
OS Thread Id: 0x4422 (1)
Child SP IP Call Site
00007FFFB92B1378 00007F8AA9F2835F libpython3.6m.so!Py_DecRef + 15
00007FFFB92B1380 00007F8A3CED902D
00007FFFB92B1390 [InlinedCallFrame: 00007fffb92b1390] Python.Runtime.dll!Python.Runtime.Runtime.Py_DecRef(IntPtr)
00007FFFB92B1390 [InlinedCallFrame: 00007fffb92b1390] Python.Runtime.dll!Python.Runtime.Runtime.Py_DecRef(IntPtr)
00007FFFB92B1380 00007F8A3CED902D Python.Runtime.dll!DomainBoundILStubClass.IL_STUB_PInvoke(IntPtr) + 157
00007FFFB92B1430 00007F8A3CED90CC Python.Runtime.dll!Python.Runtime.Runtime.XDecref(IntPtr) + 44 [/users/isys/my-user/git/medusa-recipes/pythonnet/2.3.0/ws/src/src/runtime/runtime.cs @ 547]
00007FFFB92B1450 00007F8A3CED6BE5 Python.Runtime.dll!Python.Runtime.Runtime.Initialize() + 1861 [/users/isys/my-user/git/medusa-recipes/pythonnet/2.3.0/ws/src/src/runtime/runtime.cs @ 292]
00007FFFB92B1610 00007F8A3CED5479 Python.Runtime.dll!Python.Runtime.PythonEngine.Initialize(System.Collections.Generic.IEnumerable`1<System.String>, Boolean) + 217 [/users/isys/my-user/git/medusa-recipes/pythonnet/2.3.0/ws/src/src/runtime/pythonengine.cs @ 167]
00007FFFB92B1850 00007F8A3CED2C6B Python.Runtime.dll!Python.Runtime.PythonEngine.Initialize(Boolean) + 75 [/users/isys/my-user/git/medusa-recipes/pythonnet/2.3.0/ws/src/src/runtime/pythonengine.cs @ 145]
00007FFFB92B1870 00007F8A3CED25E4 Python.Runtime.dll!Python.Runtime.PythonEngine.InitExt() + 68 [/users/isys/my-user/git/medusa-recipes/pythonnet/2.3.0/ws/src/src/runtime/pythonengine.cs @ 239]
00007FFFB92B1910 00007F8AB58E354F libcoreclr.so!UMThunkStub + 294 at /coreclr/src/vm/amd64/umthunkstub.S:144
00007FFFB92B19E0 00007F8AB653E044 clr.cpython-36m-x86_64-linux-gnu.so!init + 580 at /users/isys/my-user/git/medusa-recipes/pythonnet/2.3.0/ws/src/src/coreclr/pynetinit.c:190
00007FFFB92B1A40 00007F8AB653E0E8 clr.cpython-36m-x86_64-linux-gnu.so!PyNet_Init + 120 at /users/isys/my-user/git/medusa-recipes/pythonnet/2.3.0/ws/src/src/coreclr/pynetinit.c:52
00007FFFB92B1A60 00007F8AB653E156 clr.cpython-36m-x86_64-linux-gnu.so!PyInit_clr + 70 at /users/isys/my-user/git/medusa-recipes/pythonnet/2.3.0/ws/src/src/coreclr/clrmod.c:47
00007FFFB92B1A60 00007F8AB653E122 clr.cpython-36m-x86_64-linux-gnu.so!PyInit_clr + 18 at /users/isys/my-user/git/medusa-recipes/pythonnet/2.3.0/ws/src/src/coreclr/clrmod.c:37
00007FFFB92B1A80 00005586BBBC48E5 python!_PyImport_LoadDynamicModuleWithSpec + 389
00007FFFB92B1AD0 00005586BBBC4AE5 python!_imp_create_dynamic + 197
|
(lldb) eestack
---------------------------------------------
Thread 1
TEB information is not available so a stack size of 0xFFFF is assumed
Current frame: libpython3.6m.so!Py_DecRef + 0xf
Child-SP RetAddr Caller, Callee
00007FFFB92B1370 00007f8a3ced902d (MethodDesc 00007f8a3d31c6b8 + 0x9d DomainBoundILStubClass.IL_STUB_PInvoke(IntPtr))
00007FFFB92B13B0 00007f8a3ced902d (MethodDesc 00007f8a3d31c6b8 + 0x9d DomainBoundILStubClass.IL_STUB_PInvoke(IntPtr))
00007FFFB92B1420 00007f8a3ced90cc (MethodDesc 00007f8a3d088a48 + 0x2c Python.Runtime.Runtime.XDecref(IntPtr)), calling 00007f8a3ced7520 (stub for Python.Runtime.Runtime.Py_DecRef(IntPtr))
00007FFFB92B1440 00007f8a3ced6be5 (MethodDesc 00007f8a3d088888 + 0x745 Python.Runtime.Runtime.Initialize()), calling (MethodDesc 00007f8a3d088a48 + 0 Python.Runtime.Runtime.XDecref(IntPtr))
00007FFFB92B1600 00007f8a3ced5479 (MethodDesc 00007f8a3b7d6dc0 + 0xd9 Python.Runtime.PythonEngine.Initialize(System.Collections.Generic.IEnumerable`1<System.String>, Boolean)), calling 00007f8a3ced4d80 (stub for Python.Runtime.Runtime.Initialize())
00007FFFB92B1840 00007f8a3ced2c6b (MethodDesc 00007f8a3b7d6d88 + 0x4b Python.Runtime.PythonEngine.Initialize(Boolean)), calling 00007f8a3ced2108 (stub for Python.Runtime.PythonEngine.Initialize(System.Collections.Generic.IEnumerable`1<System.String>, Boolean))
00007FFFB92B1860 00007f8a3ced25e4 (MethodDesc 00007f8a3b7d6df8 + 0x44 Python.Runtime.PythonEngine.InitExt()), calling 00007f8a3ced2100 (stub for Python.Runtime.PythonEngine.Initialize(Boolean))
00007FFFB92B1900 00007f8ab58e354f libcoreclr.so!UMThunkStub + 0x126 [/coreclr/src/vm/amd64/umthunkstub.S:144]
00007FFFB92B19D0 00007f8ab653e044 clr.cpython-36m-x86_64-linux-gnu.so!init + 0x244 [/users/isys/my-user/git/medusa-recipes/pythonnet/2.3.0/ws/src/src/coreclr/pynetinit.c:190]
00007FFFB92B1A30 00007f8ab653e0e8 clr.cpython-36m-x86_64-linux-gnu.so!PyNet_Init + 0x78 [/users/isys/my-user/git/medusa-recipes/pythonnet/2.3.0/ws/src/src/coreclr/pynetinit.c:52], calling clr.cpython-36m-x86_64-linux-gnu.so!init
00007FFFB92B1A50 00007f8ab653e156 clr.cpython-36m-x86_64-linux-gnu.so!PyInit_clr + 0x46 [/users/isys/my-user/git/medusa-recipes/pythonnet/2.3.0/ws/src/src/coreclr/clrmod.c:47], calling clr.cpython-36m-x86_64-linux-gnu.so!PyNet_Init
00007FFFB92B1A70 00005586bbbc48e5 python!_PyImport_LoadDynamicModuleWithSpec + 0x185
00007FFFB92B1AC0 00005586bbbc4ae5 python!_imp_create_dynamic + 0xc5, calling python!_PyImport_LoadDynamicModuleWithSpec
00007FFFB92B1B20 00005586bbac0a61 python!PyCFunction_Call + 0x131
00007FFFB92B1B60 00005586bbb74fdb python!_PyEval_EvalFrameDefault + 0x561b, calling python!PyCFunction_Call
00007FFFB92B1BE0 00005586bbab0a20 python!PyDict_GetItem + 0x70
00007FFFB92B1C30 00005586bbaee666 python!PyFrame_New + 0x146, calling python!PyType_IsSubtype
00007FFFB92B1C80 00005586bbb46a94 python!_PyEval_EvalCodeWithName + 0x334, calling python!PyEval_EvalFrameEx
00007FFFB92B1D60 00005586bbb47941 python!fast_function + 0x341, calling python!_PyEval_EvalCodeWithName
00007FFFB92B1DF0 00005586bbb4d755 python!call_function + 0x155, calling python!fast_function
00007FFFB92B1E40 00005586bbb6fcba python!_PyEval_EvalFrameDefault + 0x2fa, calling python!call_function
00007FFFB92B1EC0 00005586bbab0a20 python!PyDict_GetItem + 0x70
00007FFFB92B1F10 00005586bbaee7d8 python!PyFrame_New + 0x2b8, calling libc.so.6!__memset_sse2
00007FFFB92B1F60 00005586bbb4770b python!fast_function + 0x10b, calling python!PyEval_EvalFrameEx
00007FFFB92B1FA0 00005586bbb4d755 python!call_function + 0x155, calling python!fast_function
00007FFFB92B1FF0 00005586bbb6fcba python!_PyEval_EvalFrameDefault + 0x2fa, calling python!call_function
00007FFFB92B2070 00005586bbabb2fc python!_PyObject_GenericGetAttrWithDict + 0x1dc
00007FFFB92B20C0 00005586bbaa75ba python!PyErr_Occurred + 0xa, calling python!_PyThreadState_UncheckedGet
00007FFFB92B2110 00005586bbb4770b python!fast_function + 0x10b, calling python!PyEval_EvalFrameEx
00007FFFB92B2150 00005586bbb4d755 python!call_function + 0x155, calling python!fast_function
00007FFFB92B21A0 00005586bbb6fcba python!_PyEval_EvalFrameDefault + 0x2fa, calling python!call_function
00007FFFB92B2220 00005586bbaeec84 python!PyTuple_New + 0x64, calling libc.so.6!__memset_sse2
00007FFFB92B2270 00005586bbb47941 python!fast_function + 0x341, calling python!_PyEval_EvalCodeWithName
00007FFFB92B22C0 00005586bbb4770b python!fast_function + 0x10b, calling python!PyEval_EvalFrameEx
00007FFFB92B2300 00005586bbb4d755 python!call_function + 0x155, calling python!fast_function
00007FFFB92B2350 00005586bbb6fcba python!_PyEval_EvalFrameDefault + 0x2fa, calling python!call_function
00007FFFB92B23C0 00005586bbadc2ed python!PyObject_CallFunctionObjArgs + 0xed, calling python!_PyObject_FastCallDict
00007FFFB92B23D0 00005586bbaa75ba python!PyErr_Occurred + 0xa, calling python!_PyThreadState_UncheckedGet
00007FFFB92B2420 00005586bbaa75ba python!PyErr_Occurred + 0xa, calling python!_PyThreadState_UncheckedGet
00007FFFB92B2470 00005586bbb4770b python!fast_function + 0x10b, calling python!PyEval_EvalFrameEx
00007FFFB92B24B0 00005586bbb4d755 python!call_function + 0x155, calling python!fast_function
00007FFFB92B2500 00005586bbb6fcba python!_PyEval_EvalFrameDefault + 0x2fa, calling python!call_function
00007FFFB92B2580 00005586bbab0a20 python!PyDict_GetItem + 0x70
00007FFFB92B25A0 00005586bbad9dbe python!_Py_Call + 0x2e, calling python!PyArena_Malloc
00007FFFB92B25D0 00005586bbaee666 python!PyFrame_New + 0x146, calling python!PyType_IsSubtype
00007FFFB92B2620 00005586bbb47d7b python!_PyFunction_FastCallDict + 0x11b, calling python!PyEval_EvalFrameEx
00007FFFB92B2640 00005586bbab0a20 python!PyDict_GetItem + 0x70
00007FFFB92B26B0 00005586bbabdf5f python!_PyObject_FastCallDict + 0x26f, calling python!_PyFunction_FastCallDict
00007FFFB92B2700 00005586bbb02670 python!_PyObject_CallMethodIdObjArgs + 0x100, calling python!_PyObject_FastCallDict
00007FFFB92B27F0 00005586bbab0a76 python!PyDict_GetItem + 0xc6, calling python!PyErr_Clear
00007FFFB92B2840 00005586bbab4a70 python!PyImport_ImportModuleLevelObject + 0x340, calling python!_PyObject_CallMethodIdObjArgs
00007FFFB92B2860 00005586bbab0a20 python!PyDict_GetItem + 0x70
00007FFFB92B28B0 00005586bbb72033 python!_PyEval_EvalFrameDefault + 0x2673, calling python!PyImport_ImportModuleLevelObject
00007FFFB92B2930 00005586bbab0a20 python!PyDict_GetItem + 0x70
00007FFFB92B2950 00005586bba9e0da python!tupledealloc + 0x16a
00007FFFB92B2980 00005586bbaee92b python!PyFrame_New + 0x40b, calling python!PyModule_GetDict
00007FFFB92B29D0 00005586bbb48459 python!PyEval_EvalCodeEx + 0x329, calling python!PyEval_EvalFrameEx
00007FFFB92B2A30 00005586bbbc30c6 python!PyAST_CompileObject + 0x196
00007FFFB92B2A90 00005586bbb491ec python!PyEval_EvalCode + 0x1c, calling python!PyEval_EvalCodeEx
00007FFFB92B2AD0 00005586bbbc39a4 python!run_mod + 0x34, calling python!PyEval_EvalCode
00007FFFB92B2AF0 00005586bbbc3a3d python!PyRun_StringFlags + 0x7d, calling python!run_mod
00007FFFB92B2B40 00005586bbbc3a9f python!PyRun_SimpleStringFlags + 0x3f, calling python!PyRun_StringFlags
00007FFFB92B2B60 00005586bbbc789b python!Py_Main + 0x43b, calling python!PyRun_SimpleStringFlags
00007FFFB92B2C70 00005586bba8f4be python!main + 0xee, calling python!Py_Main
00007FFFB92B2C80 00005586bbbcb661 python!__libc_csu_init + 0x31 [/opt/conda/conda-bld/compilers_linux-64_1520532893746/work/.build/src/glibc-2.12.2/csu/elf-init.c:123], calling python!_init
00007FFFB92B2CC0 00007f8abd5de445 libc.so.6!__libc_start_main + 0xf5
00007FFFB92B2D40 00007f8abdbb4b03 ld-linux-x86-64.so.2!_dl_init_internal + 0x113
00007FFFB92B2D80 00005586bbb76773 python!_start + 0x29, calling python + 0xffffffff
---------------------------------------------
Thread 6
TEB information is not available so a stack size of 0xFFFF is assumed
Current frame: libpthread.so.0!__pthread_cond_timedwait + 0x132
Child-SP RetAddr Caller, Callee
00007F8AB146DD60 00007f8ab5e19395 libcoreclr.so!CorUnix::CPalSynchronizationManager::ThreadNativeWait(CorUnix::_ThreadNativeWaitData*, unsigned int, CorUnix::ThreadWakeupReason*, unsigned int*) + 0x2a5 [/coreclr/src/pal/src/synchmgr/synchmanager.cpp:484], calling libcoreclr.so!pthread_cond_timedwait
00007F8AB146DD70 00007f8ab5df99ee libcoreclr.so!ObtainCurrentThreadIdImpl(CorUnix::CPalThread*, char const*) + 0x4e [/coreclr/src/pal/src/sync/cs.cpp:184], calling libcoreclr.so!syscall
00007F8AB146DDA0 00007f8ab54c40bf libcoreclr.so!Volatile<unsigned int>::Store(unsigned int const&) + 0x1f [/coreclr/src/pal/../inc/volatile.h:312], calling libcoreclr.so!void VolatileStore<unsigned int>(unsigned int*, unsigned int) [/coreclr/src/inc/volatile.h:196]
00007F8AB146DDC0 00007f8ab5df99ee libcoreclr.so!ObtainCurrentThreadIdImpl(CorUnix::CPalThread*, char const*) + 0x4e [/coreclr/src/pal/src/sync/cs.cpp:184], calling libcoreclr.so!syscall
00007F8AB146DE10 00007f8ab54b78e5 libcoreclr.so!Volatile<int>::Load() const + 0x15 [/coreclr/src/pal/../inc/volatile.h:292], calling libcoreclr.so!int VolatileLoad<int>(int const*) [/coreclr/src/inc/volatile.h:136]
00007F8AB146DE80 00007f8ab54b78e5 libcoreclr.so!Volatile<int>::Load() const + 0x15 [/coreclr/src/pal/../inc/volatile.h:292], calling libcoreclr.so!int VolatileLoad<int>(int const*) [/coreclr/src/inc/volatile.h:136]
00007F8AB146DEC0 00007f8ab5e1861b libcoreclr.so!CorUnix::CPalSynchronizationManager::BlockThread(CorUnix::CPalThread*, unsigned int, bool, bool, CorUnix::ThreadWakeupReason*, unsigned int*) + 0x64b [/coreclr/src/pal/src/synchmgr/synchmanager.cpp:302], calling libcoreclr.so!CorUnix::CPalSynchronizationManager::ThreadNativeWait(CorUnix::_ThreadNativeWaitData*, unsigned int, CorUnix::ThreadWakeupReason*, unsigned int*) [/coreclr/src/pal/src/synchmgr/synchmanager.cpp:446]
00007F8AB146DF00 00007f8ab5a07991 libcoreclr.so!Volatile<int>::operator++(int) + 0x41 [/coreclr/src/pal/../inc/volatile.h:390], calling libcoreclr.so!Volatile<int>::Store(int const&) [/coreclr/src/inc/volatile.h:309]
00007F8AB146DF20 00007f8ab5e155a1 libcoreclr.so!CorUnix::CSynchCache<CorUnix::CSynchWaitController>::Unlock(CorUnix::CPalThread*) + 0x21 [/coreclr/src/pal/src/include/pal/synchcache.hpp:50], calling libcoreclr.so!CorUnix::InternalLeaveCriticalSection(CorUnix::CPalThread*, _CRITICAL_SECTION*) [/coreclr/src/pal/src/sync/cs.cpp:854]
00007F8AB146DF40 00007f8ab5e15495 libcoreclr.so!CorUnix::CSynchCache<CorUnix::CSynchWaitController>::Add(CorUnix::CPalThread*, CorUnix::CSynchWaitController*) + 0x105 [/coreclr/src/pal/src/include/pal/synchcache.hpp:166], calling libcoreclr.so!CorUnix::CSynchCache<CorUnix::CSynchWaitController>::Unlock(CorUnix::CPalThread*) [/coreclr/src/pal/src/include/pal/synchcache.hpp:50]
00007F8AB146DF90 00007f8ab5e142f4 libcoreclr.so!CorUnix::CPalSynchronizationManager::CacheAddWaitCtrlr(CorUnix::CPalThread*, CorUnix::CSynchWaitController*) + 0x34 [/coreclr/src/pal/src/synchmgr/synchmanager.hpp:731], calling libcoreclr.so!CorUnix::CSynchCache<CorUnix::CSynchWaitController>::Add(CorUnix::CPalThread*, CorUnix::CSynchWaitController*) [/coreclr/src/pal/src/include/pal/synchcache.hpp:138]
00007F8AB146DFC0 00007f8ab5e0a57f libcoreclr.so!CorUnix::CSynchControllerBase::Release() + 0x30f [/coreclr/src/pal/src/synchmgr/synchcontrollers.cpp:125], calling libcoreclr.so!CorUnix::CPalSynchronizationManager::CacheAddWaitCtrlr(CorUnix::CPalThread*, CorUnix::CSynchWaitController*) [/coreclr/src/pal/src/synchmgr/synchmanager.hpp:729]
00007F8AB146E070 00007f8ab5e1a546 libcoreclr.so!CorUnix::CPalSynchronizationManager::GetSynchWaitControllersForObjects(CorUnix::CPalThread*, CorUnix::IPalObject**, unsigned int, CorUnix::ISynchWaitController**) + 0x36 [/coreclr/src/pal/src/synchmgr/synchmanager.cpp:681], calling libcoreclr.so!CorUnix::CPalSynchronizationManager::GetSynchControllersForObjects(CorUnix::CPalThread*, CorUnix::IPalObject**, unsigned int, void**, CorUnix::CSynchControllerBase::ControllerType) [/coreclr/src/pal/src/synchmgr/synchmanager.cpp:721]
00007F8AB146E0B0 00007f8ab5e2acae libcoreclr.so!CorUnix::InternalWaitForMultipleObjectsEx(CorUnix::CPalThread*, unsigned int, void* const*, int, unsigned int, int, int) + 0x16ce [/coreclr/src/pal/src/synchmgr/wait.cpp:636]
00007F8AB146E4F0 00007f8ab5e2b8b1 libcoreclr.so!WaitForSingleObjectEx + 0x111 [/coreclr/src/pal/src/synchmgr/wait.cpp:139], calling libcoreclr.so!CorUnix::InternalWaitForMultipleObjectsEx(CorUnix::CPalThread*, unsigned int, void* const*, int, unsigned int, int, int) [/coreclr/src/pal/src/synchmgr/wait.cpp:363]
00007F8AB146E590 00007f8ab5869d40 libcoreclr.so!CLREventWaitHelper2(void*, unsigned int, int) + 0x30 [/coreclr/src/vm/synch.cpp:385], calling libcoreclr.so!WaitForSingleObjectEx [/coreclr/src/pal/src/synchmgr/wait.cpp:130]
00007F8AB146E5B0 00007f8ab5869bea libcoreclr.so!CLREventWaitHelper(void*, unsigned int, int)::$_1::operator()(CLREventWaitHelper(void*, unsigned int, int)::Param*) const + 0x2a [/coreclr/src/vm/synch.cpp:411], calling libcoreclr.so!CLREventWaitHelper2(void*, unsigned int, int) [/coreclr/src/vm/synch.cpp:381]
00007F8AB146E5D0 00007f8ab586845d libcoreclr.so!CLREventWaitHelper(void*, unsigned int, int) + 0x8d [/coreclr/src/vm/synch.cpp:413], calling libcoreclr.so!CLREventWaitHelper(void*, unsigned int, int)::$_1::operator()(CLREventWaitHelper(void*, unsigned int, int)::Param*) const [/coreclr/src/vm/synch.cpp:407]
00007F8AB146E690 00007f8ab58683ae libcoreclr.so!CLREventBase::WaitEx(unsigned int, WaitMode, PendingSync*) + 0x1ae [/coreclr/src/vm/synch.cpp:483], calling libcoreclr.so!CLREventWaitHelper(void*, unsigned int, int) [/coreclr/src/vm/synch.cpp:389]
00007F8AB146E6A0 00007f8ab5dbdbec libcoreclr.so!QueryPerformanceCounter + 0x23c [/coreclr/src/pal/src/misc/time.cpp:253], calling libcoreclr.so!Volatile<int>::operator int() const [/coreclr/src/inc/volatile.h:344]
00007F8AB146E6F0 00007f8ab58681ed libcoreclr.so!CLREventBase::Wait(unsigned int, int, PendingSync*) + 0x4d [/coreclr/src/vm/synch.cpp:426], calling libcoreclr.so!CLREventBase::WaitEx(unsigned int, WaitMode, PendingSync*) [/coreclr/src/vm/synch.cpp:431]
00007F8AB146E720 00007f8ab5733e9c libcoreclr.so!FinalizerThread::WaitForFinalizerEvent(CLREvent*) + 0x1c [/coreclr/src/vm/finalizerthread.cpp:408], calling libcoreclr.so!CLREventBase::Wait(unsigned int, int, PendingSync*) [/coreclr/src/vm/synch.cpp:424]
00007F8AB146E730 00007f8ab5503593 libcoreclr.so!Thread::CatchAtSafePoint() + 0x33 [/coreclr/src/vm/threads.h:1474], calling libcoreclr.so!Volatile<Thread::ThreadState>::operator Thread::ThreadState() const [/coreclr/src/inc/volatile.h:344]
00007F8AB146E750 00007f8ab54ff7ee libcoreclr.so!Thread::EnablePreemptiveGC() + 0xee [/coreclr/src/vm/threads.h:2162], calling libcoreclr.so!Thread::CatchAtSafePoint() [/coreclr/src/vm/threads.h:1472]
00007F8AB146E780 00007f8ab57342b6 libcoreclr.so!FinalizerThread::FinalizerThreadWorker(void*) + 0x116 [/coreclr/src/vm/finalizerthread.cpp:564], calling libcoreclr.so!FinalizerThread::WaitForFinalizerEvent(CLREvent*) [/coreclr/src/vm/finalizerthread.cpp:390]
00007F8AB146E7D0 00007f8ab5df99ee libcoreclr.so!ObtainCurrentThreadIdImpl(CorUnix::CPalThread*, char const*) + 0x4e [/coreclr/src/pal/src/sync/cs.cpp:184], calling libcoreclr.so!syscall
00007F8AB146E7F0 00007f8ab54ff6f8 libcoreclr.so!GetAppDomain + 0x28 [/coreclr/src/classlibnative/../vm/threads.inl:39], calling libcoreclr.so!__tls_get_addr
00007F8AB146E830 00007f8ab5647eae libcoreclr.so!ManagedThreadBase_DispatchInner(ManagedThreadCallState*) + 0xce [/coreclr/src/vm/threads.cpp:8850]
00007F8AB146E840 00007f8ab54ed81d libcoreclr.so!CLRException::HandlerState::HandlerState(Thread*) + 0x6d [/coreclr/src/binder/../vm/clrex.inl:32], calling libcoreclr.so!Thread::PreemptiveGCDisabled() [/coreclr/src/vm/threads.h:2177]
00007F8AB146E870 00007f8ab564d025 libcoreclr.so!ManagedThreadBase_DispatchMiddle(ManagedThreadCallState*) + 0x95 [/coreclr/src/vm/threads.cpp:8901], calling libcoreclr.so!ManagedThreadBase_DispatchInner(ManagedThreadCallState*) [/coreclr/src/vm/threads.cpp:8808]
00007F8AB146E890 00007f8ab54b78e5 libcoreclr.so!Volatile<int>::Load() const + 0x15 [/coreclr/src/pal/../inc/volatile.h:292], calling libcoreclr.so!int VolatileLoad<int>(int const*) [/coreclr/src/inc/volatile.h:136]
00007F8AB146E8B0 00007f8ab54b7895 libcoreclr.so!Volatile<int>::operator int() const + 0x15 [/coreclr/src/pal/../inc/volatile.h:346], calling libcoreclr.so!Volatile<int>::Load() const [/coreclr/src/inc/volatile.h:290]
00007F8AB146E8D0 00007f8ab5df99ee libcoreclr.so!ObtainCurrentThreadIdImpl(CorUnix::CPalThread*, char const*) + 0x4e [/coreclr/src/pal/src/sync/cs.cpp:184], calling libcoreclr.so!syscall
00007F8AB146E900 00007f8ab5df99ee libcoreclr.so!ObtainCurrentThreadIdImpl(CorUnix::CPalThread*, char const*) + 0x4e [/coreclr/src/pal/src/sync/cs.cpp:184], calling libcoreclr.so!syscall
00007F8AB146E920 00007f8ab5dfc061 libcoreclr.so!Volatile<unsigned int>::operator+=(unsigned int) + 0x41 [/coreclr/src/pal/../inc/volatile.h:376], calling libcoreclr.so!Volatile<unsigned int>::Store(unsigned int const&) [/coreclr/src/inc/volatile.h:309]
00007F8AB146E950 00007f8ab54b78e5 libcoreclr.so!Volatile<int>::Load() const + 0x15 [/coreclr/src/pal/../inc/volatile.h:292], calling libcoreclr.so!int VolatileLoad<int>(int const*) [/coreclr/src/inc/volatile.h:136]
0
8000
0007F8AB146E990 00007f8ab5df98bf libcoreclr.so!CorUnix::InternalLeaveCriticalSection(CorUnix::CPalThread*, _CRITICAL_SECTION*) + 0x74f [/coreclr/src/pal/src/sync/cs.cpp:907], calling libcoreclr.so!InterlockedCompareExchange [/coreclr/src/pal/inc/pal.h:3483]
00007F8AB146E9A0 00007f8ab54b78e5 libcoreclr.so!Volatile<int>::Load() const + 0x15 [/coreclr/src/pal/../inc/volatile.h:292], calling libcoreclr.so!int VolatileLoad<int>(int const*) [/coreclr/src/inc/volatile.h:136]
00007F8AB146E9C0 00007f8ab54b78e5 libcoreclr.so!Volatile<int>::Load() const + 0x15 [/coreclr/src/pal/../inc/volatile.h:292], calling libcoreclr.so!int VolatileLoad<int>(int const*) [/coreclr/src/inc/volatile.h:136]
00007F8AB146EA30 00007f8ab564ce5d libcoreclr.so!ManagedThreadBase_DispatchOuter(ManagedThreadCallState*)::$_8::operator()(ManagedThreadBase_DispatchOuter(ManagedThreadCallState*)::TryArgs*) const::{lambda(Param*)#1}::operator()(Param*) const + 0x1d [/coreclr/src/vm/threads.cpp:9141], calling libcoreclr.so!ManagedThreadBase_DispatchMiddle(ManagedThreadCallState*) [/coreclr/src/vm/threads.cpp:8855]
00007F8AB146EA50 00007f8ab564cc5f libcoreclr.so!ManagedThreadBase_DispatchOuter(ManagedThreadCallState*)::$_8::operator()(ManagedThreadBase_DispatchOuter(ManagedThreadCallState*)::TryArgs*) const + 0x6f [/coreclr/src/vm/threads.cpp:9141], calling libcoreclr.so!ManagedThreadBase_DispatchOuter(ManagedThreadCallState*)::$_8::operator()(ManagedThreadBase_DispatchOuter(ManagedThreadCallState*)::TryArgs*) const::{lambda(Param*)#1}::operator()(Param*) const [/coreclr/src/vm/threads.cpp:9137]
00007F8AB146EA70 00007f8ab5542eb5 libcoreclr.so!Frame::Push() + 0x25 [/coreclr/src/vm/frames.cpp:397], calling libcoreclr.so!Frame::Push(Thread*) [/coreclr/src/vm/frames.cpp:400]
00007F8AB146EAD0 00007f8ab5652309 libcoreclr.so!FrameWithCookie<DebuggerU2MCatchHandlerFrame>::FrameWithCookie() + 0x29 [/coreclr/src/vm/frames.h:3428], calling libcoreclr.so!DebuggerU2MCatchHandlerFrame::DebuggerU2MCatchHandlerFrame() [/coreclr/src/vm/frames.h:2851]
00007F8AB146EAF0 00007f8ab5647b39 libcoreclr.so!ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) + 0xe9 [/coreclr/src/vm/threads.cpp:9178], calling libcoreclr.so!ManagedThreadBase_DispatchOuter(ManagedThreadCallState*)::$_8::operator()(ManagedThreadBase_DispatchOuter(ManagedThreadCallState*)::TryArgs*) const [/coreclr/src/vm/threads.cpp:9135]
00007F8AB146EBC0 00007f8ab5647a28 libcoreclr.so!ManagedThreadBase_NoADTransition(void (*)(void*), UnhandledExceptionLocation) + 0x58 [/coreclr/src/vm/threads.cpp:9223], calling libcoreclr.so!ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) [/coreclr/src/vm/threads.cpp:9092]
00007F8AB146EC30 00007f8ab5647d6a libcoreclr.so!ManagedThreadBase::FinalizerBase(void (*)(void*)) + 0x1a [/coreclr/src/vm/threads.cpp:9250], calling libcoreclr.so!ManagedThreadBase_NoADTransition(void (*)(void*), UnhandledExceptionLocation) [/coreclr/src/vm/threads.cpp:9206]
00007F8AB146EC50 00007f8ab5734dd1 libcoreclr.so!FinalizerThread::FinalizerThreadStart(void*)::$_0::operator()(FinalizerThread::FinalizerThreadStart(void*)::__EEParam*) const + 0x61 [/coreclr/src/vm/finalizerthread.cpp:764], calling libcoreclr.so!ManagedThreadBase::FinalizerBase(void (*)(void*)) [/coreclr/src/vm/threads.cpp:9247]
00007F8AB146EC60 00007f8ab54ed7a8 libcoreclr.so!GetThread + 0x28 [/coreclr/src/binder/../vm/threads.inl:34], calling libcoreclr.so!__tls_get_addr
00007F8AB146ECA0 00007f8ab57349a5 libcoreclr.so!FinalizerThread::FinalizerThreadStart(void*) + 0x1e5 [/coreclr/src/vm/finalizerthread.cpp:847], calling libcoreclr.so!FinalizerThread::FinalizerThreadStart(void*)::$_0::operator()(FinalizerThread::FinalizerThreadStart(void*)::__EEParam*) const [/coreclr/src/vm/finalizerthread.cpp:735]
00007F8AB146ED20 00007f8ab5d903d9 libcoreclr.so!UnlockModuleList + 0x49 [/coreclr/src/pal/src/loader/module.cpp:1797], calling libcoreclr.so!CorUnix::InternalLeaveCriticalSection(CorUnix::CPalThread*, _CRITICAL_SECTION*) [/coreclr/src/pal/src/sync/cs.cpp:854]
00007F8AB146ED40 00007f8ab574823d libcoreclr.so!EEHeapFree(void*, unsigned int, void*) + 0x8d [/coreclr/src/vm/hosting.cpp:499], calling libcoreclr.so!HeapFree [/coreclr/src/pal/src/memory/heap.cpp:233]
00007F8AB146ED80 00007f8ab5d52c26 libcoreclr.so!CorUnix::CPalThread::SetLastError(unsigned int) + 0x16 [/coreclr/src/pal/src/include/pal/thread.hpp:485], calling libcoreclr.so!__errno_location
00007F8AB146EDE0 00007f8ab56394e7 libcoreclr.so!Thread::intermediateThreadProc(void*) + 0xa7 [/coreclr/src/vm/threads.cpp:2254]
00007F8AB146EE30 00007f8ab5e430bd libcoreclr.so!CorUnix::CPalThread::ThreadEntry(void*) + 0x68d [/coreclr/src/pal/src/thread/thread.cpp:1682]
00007F8AB146EFB0 00007f8abd6babad libc.so.6!__clone + 0x6d |
(lldb) disass -a 00007F8AA9F2835F
libpython3.6m.so`Py_DecRef:
0x7f8aa9f28350 <+0>: testq %rdi, %rdi
0x7f8aa9f28353 <+3>: je 0x7f8aa9f28370 ; <+32>
0x7f8aa9f28355 <+5>: subq $0x1, (%rdi)
0x7f8aa9f28359 <+9>: jne 0x7f8aa9f28370 ; <+32>
0x7f8aa9f2835b <+11>: movq 0x8(%rdi), %rax
-> 0x7f8aa9f2835f <+15>: jmpq *0x30(%rax)
0x7f8aa9f28362 <+18>: nopl (%rax)
0x7f8aa9f28366 <+22>: nopw %cs:(%rax,%rax)
0x7f8aa9f28370 <+32>: retq |
(lldb) register read
General Purpose Registers:
rax = 0x0000000000000000
rbx = 0x00005586bca365b0
rcx = 0x00005586bcaafe60
rdx = 0xffffffffffffffff
rdi = 0x00007f8aaa291be0 libpython3.6m.so`small_ints.lto_priv.1887 + 160
rsi = 0x0000000000000000
rbp = 0x00007fffb92b1420
rsp = 0x00007fffb92b1378
r8 = 0x00007f8abdcd7000
r9 = 0x00005586bbef0a20 python`free_list.lto_priv.219
r10 = 0x00007f8a3d088b28
r11 = 0x0000000000000000
r12 = 0x00005586bcaafe60
r13 = 0x00007f8a14018500
r14 = 0x00007f8abdd66f08
r15 = 0x0000000000000001
rip = 0x00007f8aa9f2835f libpython3.6m.so`Py_DecRef + 15
rflags = 0x0000000000010246
cs = 0x0000000000000033
fs = 0x0000000000000000
gs = 0x0000000000000000
ss = 0x000000000000002b
ds = 0x0000000000000000
es = 0x0000000000000000 |
According to Jan in the linked thread, it's:
Does this help anyone more than it helps me? :-) |
It you are debugging on a python with Py_DEBUG, you can simply insert // Auto-geerated from ................
public static int _ob_next = 0;
public static int _ob_prev =0;
// before public static int ob_refcnt = 0; to |
Wow. Can you explain to me what this is doing please, I’d love to understand. |
That’s an amazing spot, thank you, I believe our environment at my work is 2.7 (non-debug) and 3.6 (debug) - it’s the 3.6 that’s crashing.
I’ll try this out on Monday, and if it works figure how to fix it in pythonnet.
… On 22 Jun 2019, at 19:01, amos402 ***@***.***> wrote:
I wonder if you are debugging on a debug version python, if so, you should care about the Py_XDECREF due to the debug version do more things than release version.
As you see, there is a _Py_ForgetReference(op); call in _Py_Decalloc, it would deal with the _ob_next and _ob_prev, but in pythonnet
You can see that it just call Py_TYPE(op)->tp_dealloc without _Py_ForgetReference.
All these operations would mess your memory, thus crashing would be just sooner or later.
Well, it consider as a minor bug for pythonnet
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Sometimes you can just use the release configure but set -O0 to make it easy for debugging. |
@amos402 Looks like it's not the problem - back to the drawing board. python -m sysconfig | grep Py_
PY_CORE_CFLAGS = "-Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -I. -I./Include -I/opt/man/releases/python-medusa/36-1/include -fPIC -DPy_BUILD_CORE"
Py_DEBUG = "0"
Py_ENABLE_SHARED = "0"
Py_HASH_ALGORITHM = "0" |
It seems to be this:
When called from here: |
Something to do with the small int list? Works:
Fails:
|
OK - it seems the Python interpreter isn't initialized in Python 3, which is why the small_int cache is missing - anyone have any ideas why? |
Do you have the C code of your library? Is you interpreter a official version or the one you have been modified? |
The library is pythonnet, so I have the code.
The interpreter is the one used inside my company, which is supposed to be the one from conda-lite for CentOS 7. The “company” version of Python 2.7 works with no problems, this is a 3.6.5 problem only.
What’s happening is that the code gets through the C from CentOS Python, and into the .NET runtime.cs successfully. The call to Py_IsInitialized() then fails, which is weird, as I know the interpreter is running, because I can do “a=1” before the call to “import clr “.
The code then calls Py_Initialize(), which doesn’t throw, indicating that all should be well, but calling Py_IsInitialized() from the debug console still fails.
Attempts to access stuff that has been set up in init fails to work properly - specifically, calling PyLong_FromLong on a small integer fails to actually return a valid PyObject*, and the attempt to decref the pointer is what actually causes the crash. This is probably because the small_int cache hasn’t been created, but I can’t understand why Py_Initialize() doesn’t throw if this is the case. Py_Initialize seems to be a bit of a black box ... it’s got an internal Py_Status object, but I can’t find a way of testing it after the call.
When I built a Python on CentOS from sources (debug or release) they both work without this problem, so I can’t even debug the problem. :-(
My current suspicion is that DllImport is importing the incorrect library, which is not actually bound to the running interpreter, but I can’t understand how this would happen.
The fun continues - next I’m going to try adding the sysconfig flags from the corporate Python into my debug Python build, one at a time until it stops working, then try to debug it.
… On 26 Jun 2019, at 20:10, amos402 ***@***.***> wrote:
Do you have the C code of your library? Is you interpreter a official version or the one you have been modified?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
You can use GDB attach to the target process and use |
So, to make a long story short ..... Some versions of python are compiled with the shared library support disabled. For example, the one my company uses: This does not mean that the libpython3.6m.so.1.0 is not created, it means that it is not used by the interpreter. The effect of this is that some Python C calls will work You can test for the setting by running the following (the result below means pythonnet will segfault): python -m sysconfig | grep Py_ENABLE_SHARED
Py_ENABLE_SHARED = "0" The only solution for me is to alter the version of the interpreter to use one that was compiled with the shared library support enabled. We're going to be using this moving forward: Thank you to @amos402 for all your help. |
Environment
Details
I'm trying to debug a crash in pythonnet. I've built a debuggable version of .NET core, and can get stack trace etc from lldb.
The text was updated successfully, but these errors were encountered: