URL:
  <http://savannah.gnu.org/bugs/?24554>

                 Summary: Pthreads and Stack overflow in guile (reopen bug
20814?)  (guile 1.8.5)
                 Project: Guile
            Submitted by: kvijayan
            Submitted on: Tue 14 Oct 2008 01:39:58 AM GMT
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:


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




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?24554>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



Reply via email to