guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

segfault in 1.7.91


From: Stanislav Ievlev
Subject: segfault in 1.7.91
Date: Fri, 17 Feb 2006 14:18:24 +0300

Greetings!

It is unable to call callback from thread in guile extension.

module:
--
#include <libguile.h>
#include <pthread.h>

pthread_t dbus_tid;

void *start_test(void* user_data)
{
        scm_call_0((void*)(user_data));
}

SCM scm_test_thread(SCM arg)
{
        pthread_create(&dbus_tid,NULL,start_test,arg);
}

void scm_init_test(void)
{
        scm_c_define_gsubr("test-thread", 1, 0, 0,(SCM(*)())scm_test_thread);
}
--

testcase:
--
(dynamic-call "scm_init_test" (dynamic-link "libguile-thread.so"))

(define cb (lambda() (write "zzz!\n")))

(test-thread cb)

(pause)
--

how to reproduce:

$gcc -fpic -lpthread dbus.c -shared -o lguile-thread.so

---
guile
guile> (dynamic-call "scm_init_test" (dynamic-link "libguile-thread.so"))
guile> (define cb (lambda() (write "zzz!\n")))
guile> (test-thread cb)
Segmentation fault

--
With best regards
Stanislav Ievlev.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]