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 <[email protected]>
---
 .../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
+}

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to