[Prelude Universal SIM system] #342: libprelude >= 0.9.20 can't create thread

"Prelude Universal SIM system" <[email protected]> Thu, 18 Dec 2008 14:01:25 -0000
Newsgroups gmane.comp.security.ids.prelude.devel
Message-ID <[email protected]>
#342: libprelude >= 0.9.20 can't create thread
----------------------------------+-----------------------------------------
 Reporter:  delgado@…             |        Type:  defect    
   Status:  new                   |    Priority:  normal    
Milestone:                        |   Component:  libprelude
  Version:  0.9                   |    Severity:  normal    
 Keywords:  thread prelude-async  |  
----------------------------------+-----------------------------------------
 If I put the following test program (test.c) into the unpacked libprelude
 tarball (libprelude-0.9.xx):

 {{{
 #include <prelude.h>
 #include <prelude-list.h>
 #include <prelude-timer.h>
 #include <prelude-log.h>
 #include <prelude-async.h>
 #include <prelude-io.h>
 #include <prelude-plugin.h>
 #include <prelude-msg.h>
 #include <prelude-message-id.h>
 #include <prelude-msgbuf.h>
 #include <prelude-client.h>
 #include <prelude-string.h>
 #include <prelude-timer.h>
 #include <idmef-message-id.h>
 #include <idmef-tree-wrap.h>
 #include <idmef-data.h>

 #include <stdio.h>
 #include <string.h>

 static prelude_client_t *client = NULL;

 int main(int argc, char **argv) {
   int ret = 0;
   char *profile;
   prelude_client_flags_t flags;

   profile = strdup("test");
   ret = prelude_thread_init(NULL);
   printf("ret: %d\n", ret);
   ret = prelude_init(NULL, NULL);
   printf("ret: %d\n", ret);
   ret = prelude_client_new(&client, profile);
   printf("ret: %d\n", ret);

   flags = PRELUDE_CLIENT_FLAGS_ASYNC_SEND |
 PRELUDE_CLIENT_FLAGS_ASYNC_TIMER;
   ret = prelude_client_set_flags(client, prelude_client_get_flags(client)
 | flags);
   printf("ret: %d\n", ret);
 }
 }}}

 compile it with

 {{{
 gcc -L src/.libs/ -I . -I src/include -I src/libprelude-error -lprelude
 test.c -o test
 }}}

 and run it via

 {{{
 LD_LIBRARY_PATH=src/.libs/ ./test
 }}}

 I get the following result with libprelude <= 0.9.19 (i.e. 0.9.16):
 {{{
 ret: 0
 ret: 0
 ret: 0
 ret: 0
 }}}

 and with libprelude >= 0.9.20 (i.e. 0.9.21.3) I get the following
 output:
 {{{
 ret: 0
 ret: 0
 ret: 0
 18 Dec 14:07:16 (process:14773) ERROR: error creating asynchronous thread:
 Function not implemented. (prelude-async.c:243 do_init_async)
 ret: 0
 }}}

 I'd expect that prelude_client_set_flags() should return != 0 if
 something goes wrong, but maybe I just got the initialisation sequence
 wrong.

 This behaviour occurs on openSUSE 10.3, i586, gcc 4.2.1, glibc 2.6.1.

 If you need any additional information for me or would like me to
 perform some tests for you, feel free to ask, I'll be glad to help.

-- 
Ticket URL: <https://trac.prelude-ids.org/ticket/342>
Prelude Universal SIM system <http://www.prelude-ids.com>
Prelude Universal SIM system
_______________________________________________
Prelude-devel site list
[email protected]
http://lists.prelude-ids.org/mailman/listinfo/prelude-devel