Tue 14 Oct 2008 01:39:58 AM UTC, original submission:
I've scoured the web for anything I could be missing with regards to this bug, including a previous bug report on Savannah dealing with what seems to be the same issue:
https://savannah.gnu.org/bugs/?func=detailitem&item_id=20814
I have tried to follow these directions, but nothing really seems to work. I still get stack overflow errors from guile when doing anything in a new thread.
The following code is a test case that demonstrates the issue:
/* test.c */
#include <libguile.h>
#include <pthread.h>
static void thread_1_scm(void ignore) {
scm_c_eval_string ("(display (+ 2 33)) (newline)");
return NULL;
}
static void thread_1(void ignore) {
return scm_with_guile(thread_1_scm, NULL);
}
static void main_scm(void ignore)
{
scm_c_eval_string("(display (+ 1 55)) (newline)");
pthread_t thr;
pthread_create(&thr, NULL, thread_1, NULL);
pthread_join(thr, NULL);
return NULL;
}
int main(int argc, char **argv) {
scm_with_guile(main_scm, NULL);
return 0;
}
I'm compiling as follows:
gcc -o test test.c -lguile -lpthread
The output of this code is:
56
ERROR: Stack overflow
I really don't know what I'm doing wrong here, if anything. Would appreciate any help.
Cheers.
-kannan
|