Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Python/C API bug (multithreading)

Reply
Thread Tools

Python/C API bug (multithreading)

 
 
=?ISO-8859-2?Q?Krzysztof_W=B3odarczyk?=
Guest
Posts: n/a
 
      06-19-2007
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: http://www.velocityreviews.com/forums/(E-Mail 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.

 
Reply With Quote
 
 
 
 
=?ISO-8859-2?Q?=22Martin_v=2E_L=F6wis=22?=
Guest
Posts: n/a
 
      06-19-2007
> Is there any simple way to fix this damned bug??

Sure: just fixed your damned code!!

Regards,
Marttin
 
Reply With Quote
 
 
 
 
Nick Craig-Wood
Guest
Posts: n/a
 
      06-20-2007
Krzysztof Włodarczyk <(E-Mail Removed)> wrote:
> I think I've found a bug in Python/C API and multithreading.


You don't state your python version.

There is an old bug about a similar issue :-

http://mail.python.org/pipermail/pyt...ay/053840.html
http://sourceforge.net/tracker/index...70&atid=105470

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


Locking, locking and more locking

--
Nick Craig-Wood <(E-Mail Removed)> -- http://www.craig-wood.com/nick
 
Reply With Quote
 
=?UTF-8?B?S3J6eXN6dG9mIFfFgm9kYXJjenlr?=
Guest
Posts: n/a
 
      06-20-2007
Nick Craig-Wood pisze:
> Krzysztof WÂłodarczyk <(E-Mail Removed)> wrote:
>
>> I think I've found a bug in Python/C API and multithreading.
>>

>
> You don't state your python version.
>
> There is an old bug about a similar issue :-
>
> http://mail.python.org/pipermail/pyt...ay/053840.html
> http://sourceforge.net/tracker/index...70&atid=105470
>
>
>>
>>This is apparantly fixed in 2.4.2 despite the absence of anentry in

the NEWS for that release.
>>


Python 2.4.1 and 2.4.4 - the same problem exists

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

>
> Locking, locking and more locking
>
>

damn true brother, thx

--

Krzysztof WĹ‚odarczyk
Centrum Technologii Mobilnych Mobiltek S.A.
e-mail: (E-Mail 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
windows-api-0.2.0/lib/windows/api.rb:211: [BUG] Segmentation fault aidy.lewis@googlemail.com Ruby 2 10-25-2007 04:27 AM
*bug* *bug* *bug* David Raleigh Arnold Firefox 12 04-02-2007 03:13 AM
Profiling API or Membership API John123 ASP .Net 0 10-20-2006 03:18 PM
Calling the C API from Python and Python program from same C API -bidirectional Praveen, Tayal (IE10) Python 0 03-17-2005 06:33 AM
What API replaces the unlock API that existed in gcc 2.9.3? Shlomo Anglister C++ 1 08-02-2004 06:50 PM



Advertisments