Commit f38fe448 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

zdtm: use tkill instead of kill in sigaltstack

Each signals should be sent to a proper thread..

Probably it was a reason of a error, which was caught yesterday
+ cat zdtm/live/static/sigaltstack.out
20:57:10.933:  4380:        thread in sas: at 0x6083e0 (size   0x2000 flags 0x1)
20:57:10.934:  4380: Waiting in thread SAS
20:57:11.219:  4380: Thread may leave SAS
20:57:11.219:  4380: Leaving thread SAS
20:57:11.219:  4380:        leader in sas: at 0x6083e0 (size   0x2000 flags 0x1)
20:57:11.219:  4380:             main old: at 0x6063e0 (size   0x2000 flags 0x1)
20:57:11.220:  4380:             main new: at 0x6083e0 (size   0x2000 flags 0x1)
20:57:11.220:  4380:             thrd old: at 0x6083e0 (size   0x2000 flags 0x1)
20:57:11.220:  4380:             thrd new: at 0x6083e0 (size   0x2000 flags 0x1)
20:57:11.220:  4380: FAIL: sigaltstack.c:163: sas not restored (errno = 11 (Resource temporarily unavailable))

https://bugzilla.openvz.org/show_bug.cgi?id=2668Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent ae44dd36
...@@ -88,7 +88,7 @@ static void *thread_func(void *arg) ...@@ -88,7 +88,7 @@ static void *thread_func(void *arg)
exit_group(-1); exit_group(-1);
} }
kill(gettid(), SIGUSR2); syscall(__NR_tkill, gettid(), SIGUSR2);
return NULL; return NULL;
} }
...@@ -145,7 +145,7 @@ int main(int argc, char *argv[]) ...@@ -145,7 +145,7 @@ int main(int argc, char *argv[])
test_msg("Thread may leave SAS\n"); test_msg("Thread may leave SAS\n");
task_waiter_complete(&t, 3); task_waiter_complete(&t, 3);
kill(gettid(), SIGUSR1); syscall(__NR_tkill, gettid(), SIGUSR1);
if (pthread_join(thread, NULL)) { if (pthread_join(thread, NULL)) {
fail("Error joining thread"); fail("Error joining thread");
......
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