Python/C API bug (multithreading)

  • Thread starter =?ISO-8859-2?Q?Krzysztof_W=B3odarczyk?=
  • Start date
?

=?ISO-8859-2?Q?Krzysztof_W=B3odarczyk?=

Hi,

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:

http://www.mobiltek.pl/~mrbpl/tmp/PythonBug.JPG

Is there any simple way to fix this damned bug??

best regards


--

Krzysztof W³odarczyk
Centrum Technologii Mobilnych Mobiltek S.A.
e-mail: (e-mail address removed)
mobile: 502-525-035


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.
Thank you.
 
?

=?ISO-8859-2?Q?=22Martin_v=2E_L=F6wis=22?=

Is there any simple way to fix this damned bug??

Sure: just fixed your damned code!!

Regards,
Marttin
 
G

Guest

Nick Craig-Wood pisze:

Python 2.4.1 and 2.4.4 - the same problem exists :(
Locking, locking and more locking ;-)
damn true brother, thx

--

Krzysztof WÅ‚odarczyk
Centrum Technologii Mobilnych Mobiltek S.A.
e-mail: (e-mail address removed)
mobile: 502-525-035


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.
Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top