All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] memcg_test_2.c: clear all fields of sigaction structure
@ 2011-08-22 13:40 Jan Stancek
  2011-08-24 11:36 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Stancek @ 2011-08-22 13:40 UTC (permalink / raw)
  To: ltp-list; +Cc: jburke

[-- Attachment #1: Type: text/plain, Size: 733 bytes --]


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 <jstancek@redhat.com>
---
  .../controllers/memcg/regression/memcg_test_2.c    |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)



[-- Attachment #2: 0001-memcg_test_2.c-clear-all-fields-of-sigaction-structu.patch --]
[-- Type: text/x-patch, Size: 651 bytes --]

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
+}


[-- Attachment #3: Type: text/plain, Size: 351 bytes --]

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

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [LTP] [PATCH] memcg_test_2.c: clear all fields of sigaction structure
  2011-08-22 13:40 [LTP] [PATCH] memcg_test_2.c: clear all fields of sigaction structure Jan Stancek
@ 2011-08-24 11:36 ` Cyril Hrubis
  0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2011-08-24 11:36 UTC (permalink / raw)
  To: Jan Stancek; +Cc: ltp-list, jburke

Hi!
Commited, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-08-24 11:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-22 13:40 [LTP] [PATCH] memcg_test_2.c: clear all fields of sigaction structure Jan Stancek
2011-08-24 11:36 ` Cyril Hrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.