unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* deadlock in 1.7.91 ?
@ 2006-02-20 13:33 Stanislav Ievlev
  2006-02-26  9:58 ` Stanislav Ievlev
  0 siblings, 1 reply; 4+ messages in thread
From: Stanislav Ievlev @ 2006-02-20 13:33 UTC (permalink / raw)


Greetings!

I've tried to made guile module with glib's main_loop.

Following example below shows some strange interpreter freeze

--
# cat test.c
#include <glib.h>
#include <libguile.h>

SCM scm_test_mainloop()
{
        GMainLoop *loop= g_main_loop_new(NULL, FALSE);
        g_main_loop_run(loop);
}

void scm_init_test(void)
{
        scm_c_define_gsubr("test-mainloop", 0, 0, 0,(SCM(*)())scm_test_mainloop);
}

---
# gcc -fpic -shared `pkg-config glib-2.0 --cflags --libs` test.c -o
# libguile-test.so
# LD_LIBRARY_PATH=`pwd`  guile
guile> (+ 1 2)
3
guile> (dynamic-call "scm_init_test" (dynamic-link "libguile-test.so"))
guile> (+ 1 2)
3
guile> (define z (begin-thread (test-mainloop)))
guile> +
#<primitive-generic +>
guile> (+ 1 2)
....
<freezing here>

--

In strace log we see:
--
....... <guile eats (+ 1 2) here> .............
23004 read(0, "\r", 1)                  = 1
23004 write(17, "\n", 1)                = 1
23004 rt_sigprocmask(SIG_BLOCK, [INT], [RTMIN], 8) = 0
23004 ioctl(16, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig icanon echo
...}) = 0
23004 rt_sigprocmask(SIG_SETMASK, [RTMIN], NULL, 8) = 0
23004 rt_sigaction(SIGINT, {0xb7e17d90, [], SA_RESTART}, {0xb7e17d90, [],
0}, 8) = 0
23004 rt_sigaction(SIGTERM, {SIG_DFL}, {0xb7e17d90, [], 0}, 8) = 0
23004 rt_sigaction(SIGQUIT, {SIG_DFL}, {0xb7e17d90, [], 0}, 8) = 0
23004 rt_sigaction(SIGALRM, {SIG_DFL}, {0xb7e17d90, [], 0}, 8) = 0
23004 rt_sigaction(SIGTSTP, {SIG_DFL}, {0xb7e17d90, [], 0}, 8) = 0
23004 rt_sigaction(SIGTTOU, {SIG_DFL}, {0xb7e17d90, [], 0}, 8) = 0
23004 rt_sigaction(SIGTTIN, {SIG_DFL}, {0xb7e17d90, [], 0}, 8) = 0
23004 rt_sigaction(SIGWINCH, {SIG_DFL}, {0xb7e17d90, [], SA_RESTART}, 8) =
0
23004 close(16)                         = 0
23004 munmap(0xb7fd1000, 4096)          = 0
23004 close(17)                         = 0
23004 munmap(0xb7fd0000, 4096)          = 0
23004 time(NULL)                        = 1140441331
23004 rt_sigprocmask(SIG_SETMASK, NULL, [RTMIN], 8) = 0
23004 rt_sigsuspend([] <unfinished ...>
...... <main guile thread suspends and never returns> ...
23005 poll([{fd=10, events=POLLIN}], 1, 2000) = 0
23005 getppid()                         = 23004
23005 poll([{fd=10, events=POLLIN}], 1, 2000) = 0
23005 getppid()                         = 23004
23005 poll([{fd=10, events=POLLIN}], 1, 2000) = 0
23005 getppid()                         = 23004
23005 poll([{fd=10, events=POLLIN}], 1, 2000) = 0
 .... <etc.>
--

---
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] 4+ messages in thread

end of thread, other threads:[~2006-03-06 19:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-20 13:33 deadlock in 1.7.91 ? Stanislav Ievlev
2006-02-26  9:58 ` Stanislav Ievlev
2006-03-06  9:27   ` Stanislav Ievlev
2006-03-06 19:57     ` Ken Raeburn

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).