Hi,

In message "--enable-pthread broken?"
    on 03/12/12, Nathaniel Talbott <nathaniel / talbott.ws> writes:

|[ruby-talk: 87759] and the surrounding thread seem to indicate that 
|--enable-pthread is broken in latest CVS. Will it be fixed before 1.8.1 
|final? Or is --enable-pthread just not a viable option for the 
|foreseeable future?

How often do you have crash?  I had two out of many tries.

This might be caused by mixing longjmp and pthread, but I haven't able
to confirm it yet.  Can you try the attached patch?
At least I had no crash after this modify.

							matz.


Index: eval.c
===================================================================
RCS file: /src/ruby/eval.c,v
retrieving revision 1.601
diff -p -u -1 -r1.601 eval.c
--- eval.c	5 Dec 2003 08:27:19 -0000	1.601
+++ eval.c	11 Dec 2003 16:44:24 -0000
@@ -7857,4 +7857,8 @@ Init_Proc()
 
-#ifdef __ia64__
+#if defined(__ia64__) || defined(HAVE_NATIVETHREAD)
+# define USE_CONTEXT
+#endif
+
 #include <ucontext.h>
+#ifdef __ia64__
 #if defined(__FreeBSD__)
@@ -7963,3 +7967,3 @@ struct thread {
     struct thread *next, *prev;
-#ifdef __ia64__
+#ifdef USE_CONTEXT
     ucontext_t context;
@@ -8350,3 +8354,3 @@ rb_thread_save_context(th)
     MEMCPY(th->stk_ptr, th->stk_pos, VALUE, th->stk_len);
-#ifdef __ia64__
+#ifdef USE_CONTEXT
     {
@@ -8356,2 +8360,3 @@ rb_thread_save_context(th)
 	getcontext(&ctx);
+#ifdef __ia64__
 	bot = (VALUE*)__libc_ia64_register_backing_store_base;
@@ -8365,2 +8370,3 @@ rb_thread_save_context(th)
 	MEMCPY(th->bstr_ptr, (VALUE*)__libc_ia64_register_backing_store_base, VALUE, th->bstr_len);
+#endif
     }
@@ -8434,3 +8440,3 @@ rb_thread_switch(n)
 
-#ifdef __ia64__
+#ifdef USE_CONTEXT
 # define THREAD_SAVE_CONTEXT(th) \
@@ -8521,3 +8527,3 @@ rb_thread_restore_context(th, exit)
 
-#ifdef __ia64__
+#ifdef USE_CONTEXT
     tmp->context_status = ex;