Commit 3ec54155 authored by Nils Goroll's avatar Nils Goroll Committed by Pål Hermunn Johansen

set the sigaltstack for each thread - SunOS needs it

Ref: #2396
parent 6568a2a6
......@@ -41,6 +41,11 @@
#include "hash/hash_slinger.h"
#ifdef HAVE_SIGALTSTACK
#include <signal.h>
extern stack_t altstack;
#endif
static void Pool_Work_Thread(struct pool *pp, struct worker *wrk);
/*--------------------------------------------------------------------
......@@ -401,6 +406,9 @@ pool_thread(void *priv)
struct pool_info *pi;
CAST_OBJ_NOTNULL(pi, priv, POOL_INFO_MAGIC);
#ifdef HAVE_SIGALTSTACK
AZ(sigaltstack(&altstack, NULL));
#endif
WRK_Thread(pi->qp, pi->stacksize, cache_param->workspace_thread);
FREE_OBJ(pi);
return (NULL);
......
......@@ -84,6 +84,10 @@ static struct vlu *child_std_vlu;
static struct vsb *child_panic = NULL;
#ifdef HAVE_SIGALTSTACK
stack_t altstack;
#endif
static void mgt_reap_child(void);
/*=====================================================================
......@@ -365,15 +369,14 @@ mgt_launch_child(struct cli *cli)
(void)sigaction(SIGABRT, &sa, NULL);
#ifdef HAVE_SIGALTSTACK
stack_t ss;
size_t sz = SIGSTKSZ + 4096;
if (sz < mgt_param.wthread_stacksize)
sz = mgt_param.wthread_stacksize;
ss.ss_sp = malloc(sz);
AN(ss.ss_sp);
ss.ss_size = sz;
ss.ss_flags = 0;
AZ(sigaltstack(&ss, NULL));
altstack.ss_sp = malloc(sz);
AN(altstack.ss_sp);
altstack.ss_size = sz;
altstack.ss_flags = 0;
AZ(sigaltstack(&altstack, NULL));
sa.sa_flags |= SA_ONSTACK;
#endif
(void)sigaction(SIGSEGV, &sa, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment