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

 
 

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

Submitted by:  Kannan Vijayan <kvijayan>
Submitted on:  Tue 14 Oct 2008 01:39:58 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Invalid
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 20 Jul 2009 09:51:56 PM UTCcivodulOpen/ClosedOpen=>Closed
    Sun 30 Nov 2008 06:42:02 PM UTCcivodulStatusNone=>Invalid

    Back to the top


    Powered by Savane 3.1-cleanup1