mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-17 16:47:50 +00:00
test: sigaltstack -- Setup proper stack size
We use test_msg helper inside alternative stack which in turn allocates TEST_MSG_BUFFER_SIZE by its own, so we increased the stack storage in @stack_thread and @stack_main but miss to inform the kernel about bigger stack size. Thus in worst scenario we can screwup the stack so provide proper size here. Reported-by: Vasily Averin <vvs@virtuozzo.com> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
f0bec2135b
commit
4912da57fb
1 changed files with 2 additions and 2 deletions
|
|
@ -64,7 +64,7 @@ void thread_sigaction(int signo, siginfo_t *info, void *context)
|
|||
static void *thread_func(void *arg)
|
||||
{
|
||||
sas_state[SAS_THRD_OLD] = (stack_t) {
|
||||
.ss_size = SIGSTKSZ,
|
||||
.ss_size = sizeof(stack_thread) - 8,
|
||||
.ss_sp = stack_thread,
|
||||
.ss_flags = SS_ONSTACK,
|
||||
};
|
||||
|
|
@ -106,7 +106,7 @@ int main(int argc, char *argv[])
|
|||
pthread_t thread;
|
||||
|
||||
sas_state[SAS_MAIN_OLD] = (stack_t) {
|
||||
.ss_size = SIGSTKSZ,
|
||||
.ss_size = sizeof(stack_main) - 8,
|
||||
.ss_sp = stack_main,
|
||||
.ss_flags = SS_ONSTACK,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue