From: Cyril H. <su...@li...> - 2011-08-24 11:30:12
|
The branch, master, has been updated via 3417a3fb67c8107af5b9cb3bcee106dd083ea9a0 (commit) from c03a1b3b155f4d20b9116cd15ca6e1f3de409b11 (commit) - Log ----------------------------------------------------------------- commit 3417a3fb67c8107af5b9cb3bcee106dd083ea9a0 Author: Jan Stancek <jst...@re...> Date: Mon Aug 22 15:40:56 2011 +0200 memcg_test_2.c: clear all fields of sigaction structure This test didn't set all fields of sigaction structure before using it, which caused some of them to be left in random state. Namely sa_flags could end up with SA_RESTORER, which after receiving signal would call invalid pointer in sa_restorer. Something, we apparently hit here: Bug 731954 - segfault on s390x when setting memory.limit_in_bytes https://bugzilla.redhat.com/show_bug.cgi?id=731954 Fix this by zero-ing whole structure before usage. Clearing just sa_flags should be enough, but let's match the style of other test in this group: memcg_test_4. Signed-off-by: Jan Stancek <jst...@re...> ----------------------------------------------------------------------- Summary of changes: .../controllers/memcg/regression/memcg_test_2.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/testcases/kernel/controllers/memcg/regression/memcg_test_2.c b/testcases/kernel/controllers/memcg/regression/memcg_test_2.c index e147e27..1643408 100644 --- a/testcases/kernel/controllers/memcg/regression/memcg_test_2.c +++ b/testcases/kernel/controllers/memcg/regression/memcg_test_2.c @@ -41,7 +41,7 @@ int main(void) { struct sigaction sigusr_action; - sigemptyset(&sigusr_action.sa_mask); + memset(&sigusr_action, 0, sizeof(sigusr_action)); sigusr_action.sa_handler = &sigusr_handler; sigaction(SIGUSR1, &sigusr_action, NULL); @@ -49,4 +49,4 @@ int main(void) sleep(1); return 0; -} \ No newline at end of file +} hooks/post-receive -- ltp |