unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* segfault in 1.7.91
@ 2006-02-17 11:18 Stanislav Ievlev
  2006-02-18 16:51 ` Ken Raeburn
  0 siblings, 1 reply; 3+ messages in thread
From: Stanislav Ievlev @ 2006-02-17 11:18 UTC (permalink / raw)


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.



_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-02-20  9:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-17 11:18 segfault in 1.7.91 Stanislav Ievlev
2006-02-18 16:51 ` Ken Raeburn
2006-02-20  9:00   ` Stanislav Ievlev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).