bugGuile - Bugs: bug #24554, Pthreads and Stack overflow in...

 
 

bug #24554: Pthreads and Stack overflow in guile (reopen bug 20814?) (guile 1.8.5)

Submitter:  Kannan Vijayan <kvijayan>
Submitted:  Tue 14 Oct 2008 01:39:58 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Invalid
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 14 Oct 2008 03:07:25 PM UTC, comment #2: 

I have confirmed that the bug is not really a bug.  The debian changelog indicates that the --with-threads option was turned off with one of the 1.8.0 releases of guile due to a bug.  It doesn't seem to have been turned back on since then.  I've rebuilt the packages with the flag turned on and the stack overflow problem has disappeared.

Sorry again for the distraction.

-kannan

Kannan Vijayan <kvijayan>
Tue 14 Oct 2008 03:05:56 AM UTC, comment #1: 


Hrm, this may be a non-issue after-all.  Digging through the source, I discovered the SCM_USE_PTHREAD_THREADS macro referred to in key places (crucially, the one-time thread initialization code called by scm_with_guile and scm_init_guile).

From what I can see, it seems that the default debian build of the guile dev package does not seem to have this flag enabled.

If this is the reason for my problems, I guess it's not an issue to be addressed here.  My apologies.

Cheers.
-kannan

Kannan Vijayan <kvijayan>
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

Kannan Vijayan <kvijayan>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by civodul (Updated the item)
  • -email is unavailable- added by kvijayan (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-07-20 civodul Open/ClosedOpen Closed
    2008-11-30 civodul StatusNone Invalid

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code