[CRIU] [PATCH] zdtm: use tkill instead of kill in sigaltstack

Andrey Vagin avagin at openvz.org
Thu Jul 11 17:09:07 EDT 2013


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))

Cc: Cyrill Gorcunov <gorcunov at openvz.org>
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 test/zdtm/live/static/sigaltstack.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/zdtm/live/static/sigaltstack.c b/test/zdtm/live/static/sigaltstack.c
index b84c3d6..37a23c9 100644
--- a/test/zdtm/live/static/sigaltstack.c
+++ b/test/zdtm/live/static/sigaltstack.c
@@ -88,7 +88,7 @@ static void *thread_func(void *arg)
 		exit_group(-1);
 	}
 
-	kill(gettid(), SIGUSR2);
+	syscall(__NR_tkill, gettid(), SIGUSR2);
 
 	return NULL;
 }
@@ -145,7 +145,7 @@ int main(int argc, char *argv[])
 	test_msg("Thread may leave SAS\n");
 	task_waiter_complete(&t, 3);
 
-	kill(gettid(), SIGUSR1);
+	syscall(__NR_tkill, gettid(), SIGUSR1);
 
 	if (pthread_join(thread, NULL)) {
 		fail("Error joining thread");
-- 
1.8.3.1



More information about the CRIU mailing list