Python/C API bug (multithreading)
krzysztof.wlodarczyk at mobiltek.pl
Tue Jun 19 19:22:41 CEST 2007
I think I've found a bug in Python/C API and multithreading.
I'm currently creating an intrusion detection system based on mobile agents.
I have an AgentPlatform (C/C++) and 2 agents on it (2 Python scripts:
Snort and Anomaly)
These 2 agents are each running its own Python interpreter (both by
Py_Run*** stuff). Of course I do have Threading on (I mean there is:
PyGILStateEnsure stuff as well).
I also have an interface that is used by both agents (Python scripts) to
access my Agent Platform (C/C++ program). That interface have one
method: AgentPlatform.getPacket() - when I call it in Python -
appropriate method AgentPlatform.getPacket() is called in C/C++
AgentPlatform. Between these two moments somthing bad happens.
This happens when Snort calls Python's AgentPlatform.getPacket() and
just before C/C++'s AgentPlatform.getPacket() is called - another agent
- Anomaly Agent calls its Python's AgentPlatform.getPacket().
In this particular moment everything hangs:(((((((((((((
Let me show it on an image:
Is there any simple way to fix this damned bug??
Centrum Technologii Mobilnych Mobiltek S.A.
e-mail: krzysztof.wlodarczyk at mobiltek.pl
This email is confidential and is intended for receipt solely by the individual or entity to which it is addressed. Any review, use, retention, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message.
More information about the Python-list