Seg fault with a python analyzer

"ben Chistador" <[email protected]>
Newsgroups gmane.comp.security.ids.prelude.devel
Message-ID <[email protected]>
Hi,

This piece of python code is intended to print "Message received" everytime
a new alert is received by the Prelude Manager. It works ok, but when I send
a signal to it (e.g. SIGINT) in order to stop it, I get a segmentation
fault... Any idea where this could come from?

Thanks in advance,

Ben

==========
import time
import prelude
import sys

def correlator_stop(signum, frame):
    prelude.prelude_client_destroy(client,
prelude.PRELUDE_CLIENT_EXIT_STATUS_SUCCESS)
    print "Stop"
    sys.exit()

signal.signal(signal.SIGINT, correlator_stop)

prelude.prelude_init(1, ["PythonTest"])
client = prelude.prelude_client_new("PythonTest")

prelude.prelude_client_set_required_permission(client,
prelude.PRELUDE_CONNECTION_PERMISSION_IDMEF_READ|prelude.PRELUDE_CONNECTION_PERMISSION_IDMEF_WRITE
);

prelude.prelude_client_start(client);

pool = prelude.prelude_client_get_connection_pool(client)

while 1 :
    msg = prelude.prelude_connection_pool_recv(pool, -1)
    print "Message received"

==========
_______________________________________________
Prelude-devel site list
[email protected]
http://www.prelude-ids.org/mailman/listinfo/prelude-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.