aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstas <stas@FreeBSD.org>2010-04-28 06:14:06 +0800
committerstas <stas@FreeBSD.org>2010-04-28 06:14:06 +0800
commit8cd38b308648792cbe6a9b424c07536f7b2b9998 (patch)
treec8744dfb2a1cf1bea5f5e7191b4848ab15af3e71
parent5a71031394b0a0b65d9d5aece3362619c2d1169f (diff)
downloadfreebsd-ports-gnome-8cd38b308648792cbe6a9b424c07536f7b2b9998.tar.gz
freebsd-ports-gnome-8cd38b308648792cbe6a9b424c07536f7b2b9998.tar.zst
freebsd-ports-gnome-8cd38b308648792cbe6a9b424c07536f7b2b9998.zip
- Do not try to stop the timer thread in child after fork: at this moment
there's already nothing to stop. Only mark the timer thread as stopped. That fixes spontaneous lockups in ruby popen call. Reported by: renchap @ FreeNode
-rw-r--r--Mk/bsd.ruby.mk2
-rw-r--r--lang/ruby18/files/patch-eval.c24
-rw-r--r--lang/ruby18/files/patch-intern.h10
-rw-r--r--lang/ruby18/files/patch-process.c11
4 files changed, 46 insertions, 1 deletions
diff --git a/Mk/bsd.ruby.mk b/Mk/bsd.ruby.mk
index 6497ed98ee6d..3e0084dbafee 100644
--- a/Mk/bsd.ruby.mk
+++ b/Mk/bsd.ruby.mk
@@ -170,7 +170,7 @@ RUBY?= ${LOCALBASE}/bin/${RUBY_NAME}
# Ruby 1.8
#
RUBY_RELVERSION= 1.8.7
-RUBY_PORTREVISION= 0
+RUBY_PORTREVISION= 1
RUBY_PORTEPOCH= 1
RUBY_PATCHLEVEL= 248
diff --git a/lang/ruby18/files/patch-eval.c b/lang/ruby18/files/patch-eval.c
new file mode 100644
index 000000000000..0c32f5b5996c
--- /dev/null
+++ b/lang/ruby18/files/patch-eval.c
@@ -0,0 +1,24 @@
+--- eval.c.orig 2010-04-27 01:09:22.000000000 -0700
++++ eval.c 2010-04-27 01:11:14.000000000 -0700
+@@ -12343,7 +12343,7 @@
+ safe_mutex_lock(&time_thread.lock);
+ if (pthread_create(&time_thread.thread, 0, thread_timer, args) == 0) {
+ thread_init = 1;
+- pthread_atfork(0, 0, rb_thread_stop_timer);
++ pthread_atfork(0, 0, rb_thread_stop_timer_fake);
+ pthread_cond_wait(&start, &time_thread.lock);
+ }
+ pthread_cleanup_pop(1);
+@@ -12359,6 +12359,12 @@
+ pthread_cleanup_pop(1);
+ pthread_join(time_thread.thread, NULL);
+ }
++
++void
++rb_thread_stop_timer_fake()
++{
++ thread_init = 0;
++}
+ #elif defined(HAVE_SETITIMER)
+ static void
+ catch_timer(sig)
diff --git a/lang/ruby18/files/patch-intern.h b/lang/ruby18/files/patch-intern.h
new file mode 100644
index 000000000000..bdd25e8ebc65
--- /dev/null
+++ b/lang/ruby18/files/patch-intern.h
@@ -0,0 +1,10 @@
+--- intern.h.orig 2010-04-27 01:11:20.000000000 -0700
++++ intern.h 2010-04-27 01:11:30.000000000 -0700
+@@ -209,6 +209,7 @@
+ void rb_gc_mark_threads _((void));
+ void rb_thread_start_timer _((void));
+ void rb_thread_stop_timer _((void));
++void rb_thread_stop_timer_fake _((void));
+ void rb_thread_schedule _((void));
+ void rb_thread_wait_fd _((int));
+ int rb_thread_fd_writable _((int));
diff --git a/lang/ruby18/files/patch-process.c b/lang/ruby18/files/patch-process.c
new file mode 100644
index 000000000000..6b8f08bae09c
--- /dev/null
+++ b/lang/ruby18/files/patch-process.c
@@ -0,0 +1,11 @@
+--- process.c.orig 2010-04-27 01:11:32.000000000 -0700
++++ process.c 2010-04-27 01:11:39.000000000 -0700
+@@ -920,7 +920,7 @@
+ #endif
+
+ #ifdef HAVE_SETITIMER
+-#define before_exec() rb_thread_stop_timer()
++#define before_exec() rb_thread_stop_timer_fake()
+ #define after_exec() rb_thread_start_timer()
+ #else
+ #define before_exec()