[#40298] Re: [ruby-cvs:33760] Ruby:r26545 (trunk): Wed Feb 3 10:12:09 2010 Aaron Patterson <tenderlove@ruby-lang.org> — "NARUSE, Yui" <naruse@...>

成瀬です。

29 messages 2010/02/03
[#40307] Re: [ruby-cvs:33760] Ruby:r26545 (trunk): Wed Feb 3 10:12:09 2010 Aaron Patterson <tenderlove@ruby-lang.org> — KOSAKI Motohiro <kosaki.motohiro@...> 2010/02/03

小崎です

[#40339] Re: [ruby-cvs:33760] Ruby:r26545 (trunk): Wed Feb 3 10:12:09 2010 Aaron Patterson <tenderlove@ruby-lang.org> — Tanaka Akira <akr@...> 2010/02/07

2010年2月3日21:07 KOSAKI Motohiro <kosaki.motohiro@gmail.com>:

[#40345] Re: [ruby-cvs:33760] Ruby:r26545 (trunk): Wed Feb 3 10:12:09 2010 Aaron Patterson <tenderlove@ruby-lang.org> — "NARUSE, Yui" <naruse@...> 2010/02/07

成瀬です。

[#40490] Re: [ruby-cvs:33760] Ruby:r26545 (trunk): Wed Feb 3 10:12:09 2010 Aaron Patterson <tenderlove@ruby-lang.org> — "NARUSE, Yui" <naruse@...> 2010/02/25

成瀬です。

[#40511] Re: [ruby-cvs:33760] Ruby:r26545 (trunk): Wed Feb 3 10:12:09 2010 Aaron Patterson <tenderlove@ruby-lang.org> — Aaron Patterson <aaron.patterson@...> 2010/02/27

2010/2/25 NARUSE, Yui <naruse@airemix.jp>:

[#40513] Re: [ruby-cvs:33760] Ruby:r26545 (trunk): Wed Feb 3 10:12:09 2010 Aaron Patterson <tenderlove@ruby-lang.org> — "U.Nakamura" <usa@...> 2010/02/27

アーロン宛

[#40317] [Bug:trunk] TCPServer#gets gets stuck — Yusuke ENDOH <mame@...>

遠藤です。

19 messages 2010/02/04
[#40371] Re: [Bug:trunk] TCPServer#gets gets stuck — Yusuke ENDOH <mame@...> 2010/02/09

遠藤です。

[#40382] [Bug:trunk] rubyspec: ObjectSpace.define_finalizer doesn't call self-referencing finalizers FAILED — Yusuke ENDOH <mame@...>

なかださんかまつもとさん

9 messages 2010/02/10

[#40418] [Feature #2746] ビルドする拡張ライブラリを configure 時に指定するための --with-exts オプション — Kenta Murata <redmine@...>

Feature #2746: ビルドする拡張ライブラリを configure 時に指定するための --with-exts オプション

11 messages 2010/02/15

[#40461] respond_to?(<protected method name>) returns true — "Akinori MUSHA" <knu@...>

 今さらかもしれませんが、 respond_to? で protected メソッドを

14 messages 2010/02/22
[#40462] Re: respond_to?(<protected method name>) returns true — Yukihiro Matsumoto <matz@...> 2010/02/23

まつもと ゆきひろです

[#40463] Re: respond_to?(<protected method name>) returns true — "Akinori MUSHA" <knu@...> 2010/02/23

At Tue, 23 Feb 2010 14:09:52 +0900,

[#40464] Re: respond_to?(<protected method name>) returns true — Yukihiro Matsumoto <matz@...> 2010/02/23

まつもと ゆきひろです

[#40467] Re: [ruby-cvs:33954] Ruby:r26739 (trunk): * ext/openssl/ossl_digest.c (GetDigestPtr): Allow to pass the — "NARUSE, Yui" <naruse@...>

成瀬です。

27 messages 2010/02/23
[#40468] Re: [ruby-cvs:33954] Ruby:r26739 (trunk): * ext/openssl/ossl_digest.c (GetDigestPtr): Allow to pass the — "Akinori MUSHA" <knu@...> 2010/02/23

At Wed, 24 Feb 2010 01:28:24 +0900,

[#40469] Re: [ruby-cvs:33954] Ruby:r26739 (trunk): * ext/openssl/ossl_digest.c (GetDigestPtr): Allow to pass the — "NARUSE, Yui" <naruse@...> 2010/02/23

(2010/02/24 1:57), Akinori MUSHA wrote:

[#40470] Re: [ruby-cvs:33954] Ruby:r26739 (trunk): * ext/openssl/ossl_digest.c (GetDigestPtr): Allow to pass the — "Akinori MUSHA" <knu@...> 2010/02/23

At Wed, 24 Feb 2010 02:07:00 +0900,

[#40472] Re: [ruby-cvs:33954] Ruby:r26739 (trunk): * ext/openssl/ossl_digest.c (GetDigestPtr): Allow to pass the — "NAKAMURA, Hiroshi" <nakahiro@...> 2010/02/23

2010/2/24 Akinori MUSHA <knu@idaemons.org>:

[#40473] Re: [ruby-cvs:33954] Ruby:r26739 (trunk): * ext/openssl/ossl_digest.c (GetDigestPtr): Allow to pass the — "Akinori MUSHA" <knu@...> 2010/02/23

At Wed, 24 Feb 2010 06:06:13 +0900,

[#40486] Re: [ruby-cvs:33954] Ruby:r26739 (trunk): * ext/openssl/ossl_digest.c (GetDigestPtr): Allow to pass the — "NAKAMURA, Hiroshi" <nakahiro@...> 2010/02/25

MjAxMC8yLzI0IEFraW5vcmkgTVVTSEEgPGtudUBpZGFlbW9ucy5vcmc+Ogo+PiAbJEIwRTlmPWhN

[#41367] Re: [ruby-cvs:33954] Ruby:r26739 (trunk): * ext/openssl/ossl_digest.c (GetDigestPtr): Allow to pass the — "NAKAMURA, Hiroshi" <nakahiro@...> 2010/05/20

2010/2/25 NAKAMURA, Hiroshi <nakahiro@gmail.com>:

[#41373] Re: [ruby-cvs:33954] Ruby:r26739 (trunk): * ext/openssl/ossl_digest.c (GetDigestPtr): Allow to pass the — "Akinori MUSHA" <knu@...> 2010/05/20

 長いことほとんど Ruby に時間が割けておらずすみません。

[#41518] Re: [ruby-cvs:33954] Ruby:r26739 (trunk): * ext/openssl/ossl_digest.c (GetDigestPtr): Allow to pass the — "NAKAMURA, Hiroshi" <nakahiro@...> 2010/06/03

2010/5/20 Akinori MUSHA <knu@idaemons.org>:

[#41520] Re: [ruby-cvs:33954] Ruby:r26739 (trunk): * ext/openssl/ossl_digest.c (GetDigestPtr): Allow to pass the — "NARUSE, Yui" <naruse@...> 2010/06/03

成瀬です。

[#40492] [Bug #2794] Aborted (core dumped) BUG on Ruby/DL — Takao NISHI <redmine@...>

Bug #2794: Aborted (core dumped) BUG on Ruby/DL

10 messages 2010/02/26

[ruby-dev:40354] [Bug #2724] fork from other than the main thread causes wrong pthread condition on NetBSD

From: Yui NARUSE <redmine@...>
Date: 2010-02-08 18:04:37 UTC
List: ruby-dev #40354
Bug #2724: fork from other than the main thread causes wrong pthread condition on NetBSD
http://redmine.ruby-lang.org/issues/show/2724

起票者: Yui NARUSE
ステータス: Third Party's Issue, 優先度: Normal
カテゴリ: core
ruby -v: ruby 1.9.2dev (2010-02-07 trunk 26615) [i386-netbsdelf5.0.1]

NetBSD 5.0.[01] において、main thread 以外の pthread から fork すると、
pthread とカーネルスレッド (lwp) との関連が壊れるという現象が確認されています。

後述のパッチがあまりにアレなのでこの問題は Third Party's Issue とし、
Ruby 側では修正を入れない事としますが、情報の共有と記録のために
ここにチケットを切っておきます。

なお、この workaround の作成には @_enamiさんの助けがありました。

Index: thread_pthread.c
===================================================================
--- thread_pthread.c    (revision 26615)
+++ thread_pthread.c    (working copy)
@@ -17,6 +17,93 @@
 #include <sys/resource.h>
 #endif

+#if defined(__NetBSD_Version__) && __NetBSD_Version__ >= 500000000
+/* Hack for NetBSD 5.0.x's broken pthread->pt_lid */
+/* Copied from /src/lib/libpthread/pthread_int.h */
+#define BROKEN_PTHREAD_T_PT_LID
+#include <lwp.h>
+#include <pthread_queue.h>
+#include <sys/tree.h>
+
+#define PTHREAD_KEYS_MAX       256
+#define        PTHREAD__UNPARK_MAX     32
+
+/*
+ * The size of this structure needs to be no larger than struct
+ * __pthread_cleanup_store, defined in pthread.h.
+ */
+struct pt_clean_t {
+       PTQ_ENTRY(pt_clean_t)   ptc_next;
+       void    (*ptc_cleanup)(void *);
+       void    *ptc_arg;
+};
+
+struct pthread_lock_ops {
+       void    (*plo_init)(__cpu_simple_lock_t *);
+       int     (*plo_try)(__cpu_simple_lock_t *);
+       void    (*plo_unlock)(__cpu_simple_lock_t *);
+       void    (*plo_lock)(__cpu_simple_lock_t *);
+};
+
+struct __pthread_st {
+       pthread_t       pt_self;        /* Must be first. */
+       unsigned int    pt_magic;       /* Magic number */
+       int             pt_state;       /* running, blocked, etc. */
+       pthread_mutex_t pt_lock;        /* lock on state */
+       int             pt_flags;       /* see PT_FLAG_* below */
+       int             pt_cancel;      /* Deferred cancellation */
+       int             pt_errno;       /* Thread-specific errno. */
+       stack_t         pt_stack;       /* Our stack */
+       void            *pt_exitval;    /* Read by pthread_join() */
+       char            *pt_name;       /* Thread's name, set by the app. */
+       int             pt_willpark;    /* About to park */
+       lwpid_t         pt_unpark;      /* Unpark this when parking */
+       struct pthread_lock_ops pt_lockops;/* Cached to avoid PIC overhead */
+       pthread_mutex_t *pt_droplock;   /* Drop this lock if cancelled */
+       pthread_cond_t  pt_joiners;     /* Threads waiting to join. */
+
+       /* Threads to defer waking, usually until pthread_mutex_unlock(). */
+       lwpid_t         pt_waiters[PTHREAD__UNPARK_MAX];
+       size_t          pt_nwaiters;
+
+       /* Stack of cancellation cleanup handlers and their arguments */
+       PTQ_HEAD(, pt_clean_t)  pt_cleanup_stack;
+
+       /* LWP ID and entry on the list of all threads. */
+       lwpid_t         pt_lid;
+       RB_ENTRY(__pthread_st) pt_alltree;
+       PTQ_ENTRY(__pthread_st) pt_allq;
+       PTQ_ENTRY(__pthread_st) pt_deadq;
+
+       /*
+        * General synchronization data.  We try to align, as threads
+        * on other CPUs will access this data frequently.
+        */
+       int             pt_dummy1 __aligned(128);
+       struct lwpctl   *pt_lwpctl;     /* Kernel/user comms area */
+       volatile int    pt_blocking;    /* Blocking in userspace */
+       volatile int    pt_rwlocked;    /* Handed rwlock successfully */
+       volatile int    pt_signalled;   /* Received pthread_cond_signal() */
+       volatile int    pt_mutexwait;   /* Waiting to acquire mutex */
+       void * volatile pt_mutexnext;   /* Next thread in chain */
+       void * volatile pt_sleepobj;    /* Object slept on */
+       PTQ_ENTRY(__pthread_st) pt_sleep;
+       void            (*pt_early)(void *);
+       int             pt_dummy2 __aligned(128);
+
+       /* Thread-specific data.  Large so it sits close to the end. */
+       int             pt_havespecific;
+       void            *pt_specific[PTHREAD_KEYS_MAX];
+
+       /*
+        * Context for thread creation.  At the end as it's cached
+        * and then only ever passed to _lwp_create().
+        */
+       ucontext_t      pt_uc;
+};
+#endif /* __NetBSD__ */
+
+
 static void native_mutex_lock(pthread_mutex_t *lock);
 static void native_mutex_unlock(pthread_mutex_t *lock);
 static int native_mutex_trylock(pthread_mutex_t *lock);
@@ -833,6 +920,9 @@
 native_reset_timer_thread(void)
 {
     timer_thread_id = 0;
+#ifdef BROKEN_PTHREAD_T_PT_LID
+    ((struct __pthread_st *)pthread_self())->pt_lid = _lwp_self();
+#endif
 }

 #ifdef HAVE_SIGALTSTACK


----------------------------------------
http://redmine.ruby-lang.org

In This Thread

Prev Next