
hello,
I am running Simpy (python simulation framework) within pythondotnet, and, even though this process is single-thread, it hangs misteriously, in an unpredictable way...
Python console cease to respond to Ctrl-C events...
Here is the current Thread status:
Thread Start Address: Symbol Name: Line Number: PC: mscoree!_CorExeMain() + 0x0 --- 7917D08C
Thread Stack:
ntdll ! KiFastSystemCallRet() + 0x KERNEL32 ! WaitForSingleObject() + 0x12 python24 ! PySys_WriteStderr() + 0x14d python24 ! PyTuple_Type() + 0x0
as the entry point in the hanging thread (higher on stack) is PyTuple_Type() and as PyTuple is defined in C# (src/runtime/PyTuple.cs), I suspect this might be the cause of my problem.
[PythonNet-1.0-beta4]> grep -nr "PyTuple_Type" . Binary file ./DLLs/_socket.pyd matches Binary file ./python24.dll matches [PythonNet-1.0-beta4]>
However, I would like to be able to go higher in the stack, to see what caused this deadlock.
Any proposed strategy to guess what happened, or to track down the problem?
thanks a lot,
Stan.

Stan Pinte a écrit :
hello,
I am running Simpy (python simulation framework) within pythondotnet, and, even though this process is single-thread, it hangs misteriously, in an unpredictable way...
Python console cease to respond to Ctrl-C events...
Here is the current Thread status:
Thread Start Address: Symbol Name: Line Number: PC: mscoree!_CorExeMain() + 0x0 --- 7917D08C
Thread Stack:
ntdll ! KiFastSystemCallRet() + 0x KERNEL32 ! WaitForSingleObject() + 0x12 python24 ! PySys_WriteStderr() + 0x14d python24 ! PyTuple_Type() + 0x0
more info, from windows debugging utility:
[Debugging Tools for Windows]> tlist 2632 2632 python.exe OleMainThreadWndName CWD: f:\home\working\phidani\project-stm\tools\ VirtualSize: 171300 KB PeakVirtualSize: 171300 KB WorkingSetSize: 22204 KB PeakWorkingSetSize: 22204 KB NumberOfThreads: 6 2916 Win32StartAddr:0x7917d08c LastErr:0x00000000 State:Waiting 636 Win32StartAddr:0x791d4d45 LastErr:0x00000000 State:Waiting 3796 Win32StartAddr:0x791d0020 LastErr:0x00000000 State:Waiting 2288 Win32StartAddr:0x77e76bf0 LastErr:0x00000000 State:Waiting 2124 Win32StartAddr:0x774fd888 LastErr:0x00000000 State:Waiting 984 Win32StartAddr:0x00000000 LastErr:0x00000000 State:Waiting 1.0.0.0 shp 0x00400000 c:\export\PythonNet-1.0-beta4\python.exe
--> so it is multi-threaded, actually.
as the entry point in the hanging thread (higher on stack) is PyTuple_Type() and as PyTuple is defined in C# (src/runtime/PyTuple.cs), I suspect this might be the cause of my problem.
[PythonNet-1.0-beta4]> grep -nr "PyTuple_Type" . Binary file ./DLLs/_socket.pyd matches Binary file ./python24.dll matches [PythonNet-1.0-beta4]>
However, I would like to be able to go higher in the stack, to see what caused this deadlock.
Any proposed strategy to guess what happened, or to track down the problem?
thanks a lot,
Stan.
Python.NET mailing list - PythonDotNet@python.org http://mail.python.org/mailman/listinfo/pythondotnet

Stan Pinte a écrit :
Stan Pinte a écrit :
hello,
I am running Simpy (python simulation framework) within pythondotnet, and, even though this process is single-thread, it hangs misteriously, in an unpredictable way...
Python console cease to respond to Ctrl-C events...
Here is the current Thread status:
Thread Start Address: Symbol Name: Line Number: PC: mscoree!_CorExeMain() + 0x0 --- 7917D08C
Thread Stack:
ntdll ! KiFastSystemCallRet() + 0x KERNEL32 ! WaitForSingleObject() + 0x12 python24 ! PySys_WriteStderr() + 0x14d python24 ! PyTuple_Type() + 0x0
hello,
actually, the code is always freezing just before a
"yield".

summary info: this was caused by the usage of Queue.queue in my code. I removed all refs to Queue, and am now using a non-reentrant, unsynchronized queue.
This solved the problem.
I submitted a new bug to sourceforge - python: http://sourceforge.net/tracker/index.php?func=detail&aid=1169108&gro...
Stan.
participants (1)
-
Stan Pinte