Python/C API bug (multithreading)

Discussion in 'Python' started by =?ISO-8859-2?Q?Krzysztof_W=B3odarczyk?=, Jun 19, 2007.

  1. 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:
    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?Krzysztof_W=B3odarczyk?=, Jun 19, 2007
    #1
    1. Advertising

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

    Sure: just fixed your damned code!!

    Regards,
    Marttin
     
    =?ISO-8859-2?Q?=22Martin_v=2E_L=F6wis=22?=, Jun 19, 2007
    #2
    1. Advertising

  3. Nick Craig-Wood, Jun 20, 2007
    #3
  4. Nick Craig-Wood pisze:
    > Krzysztof W³odarczyk <> 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/python-dev/2005-May/053840.html
    > http://sourceforge.net/tracker/index.php?func=detail&aid=1163563&group_id=5470&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:
    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.
     
    =?UTF-8?B?S3J6eXN6dG9mIFfFgm9kYXJjenlr?=, Jun 20, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ilia
    Replies:
    6
    Views:
    3,042
    John Saunders
    Nov 4, 2003
  2. Praveen, Tayal (IE10)
    Replies:
    0
    Views:
    396
    Praveen, Tayal (IE10)
    Mar 17, 2005
  3. abhinav
    Replies:
    1
    Views:
    453
    Armin Steinhoff
    Feb 19, 2006
  4. Replies:
    2
    Views:
    174
    bbiker
    Oct 25, 2007
  5. Replies:
    13
    Views:
    258
    Ned Deily
    Apr 13, 2013
Loading...

Share This Page