From: KOSAKI Motohiro Date: 2011-07-29T00:19:23+09:00 Subject: [ruby-core:38585] Re: [Ruby 1.9 - Feature #5097] Supported platforms of Ruby 1.9.3 >> > * bootstraptest/test_thread.rb: Skip 2 tests. The first one appears to hang, the second crashes with a sigaltstack error. >> >> signalstack error seems because of the lack of OpenBSD specific setting. >> see thread_pthread.c:506 and edit it. > > I don't think the problem is there, as reading the documentation the call there (pthread_stackseg_np(pthread_self(), &stk)) appears to be correct. �The error I get in the 2nd bootstrap test is "rb_register_sigaltstack. malloc error", which comes from signal.c: > > �439 � � newSS.ss_sp = th->altstack = malloc(ALT_STACK_SIZE); > �440 � � if (newSS.ss_sp == NULL) > �441 � � � � /* should handle error */ > �442 � � � � rb_bug("rb_register_sigaltstack. malloc error\n"); > > If you change the rb_bug call to a return, the 2nd bootstrap test passes. �I'm not sure if that's a valid fix, as it probably affects signal handling for the thread. �I first tried to change it to raise NoMemError, but that causes a segfault. �Like the comment there states, the error should be handled, but I'm not sure how best to do that. �I don't think this is an error caused by OpenBSD, just one that only manifests itself on OpenBSD. I wonder why OpenBSD can't allocate SIGSTKSZ size. Usually it's very small. Can you please tell us openbsd has which value of SIGSTKSZ and MINSIGSTKSZ? Also, can you please try following stack size reducing patch? Index: signal.c =================================================================== --- signal.c (revision 32646) +++ signal.c (working copy) @@ -423,10 +423,12 @@ #ifdef POSIX_SIGNAL #ifdef USE_SIGALTSTACK -#ifdef SIGSTKSZ -#define ALT_STACK_SIZE (SIGSTKSZ*2) -#else -#define ALT_STACK_SIZE (4*1024) + #if defined(__OpenBSD__) + #define ALT_STACK_SIZE (4*1024) + //#define ALT_STACK_SIZE (MINSIGSTKSZ*2) + #elif defined(SIGSTKSZ) + #define ALT_STACK_SIZE (SIGSTKSZ*2) + #else + #define ALT_STACK_SIZE (4*1024) #endif /* alternate stack for SIGSEGV */ void