about summary refs log tree commit diff
path: root/malloc
diff options
context:
space:
mode:
authorTulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>2015-06-02 10:32:25 -0300
committerTulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>2015-06-05 09:39:49 -0300
commit02242448bf431a69fd0b8c929ca4408a05479baa (patch)
tree2e551395d222ce28952c9fcc48bc409bdf1f5c0b /malloc
parent7fe9e2e089f4990b7d18d0798f591ab276b15f2b (diff)
downloadglibc-02242448bf431a69fd0b8c929ca4408a05479baa.tar.gz
glibc-02242448bf431a69fd0b8c929ca4408a05479baa.tar.xz
glibc-02242448bf431a69fd0b8c929ca4408a05479baa.zip
Avoid outputting to TTY after an expected memory corruption in testcase
Protect TTY against an expected memory corruption from testcase
tst-malloc-backtrace, which is expected to SIGABRT after a forced memory
corruption.
Diffstat (limited to 'malloc')
-rw-r--r--malloc/tst-malloc-backtrace.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/malloc/tst-malloc-backtrace.c b/malloc/tst-malloc-backtrace.c
index 2e24157907..7b317bbdb2 100644
--- a/malloc/tst-malloc-backtrace.c
+++ b/malloc/tst-malloc-backtrace.c
@@ -30,12 +30,22 @@ call_free (void *ptr)
   *(size_t *)(ptr - sizeof (size_t)) = 1;
 }
 
+int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#define EXPECTED_SIGNAL SIGABRT
+
+#include "../test-skeleton.c"
+
 int
 do_test (void)
 {
   void *ptr1 = malloc (SIZE);
   void *ptr2 = malloc (SIZE);
 
+  /* Avoid unwanted output to TTY after an expected memory corruption.  */
+  ignore_stderr();
+
   call_free (ptr1);
   ptr1 = malloc (SIZE);
 
@@ -43,8 +53,3 @@ do_test (void)
      doesn't optimize out that malloc call.  */
   return (ptr1 == ptr2);
 }
-
-#define TEST_FUNCTION do_test ()
-#define EXPECTED_SIGNAL SIGABRT
-
-#include "../test-skeleton.c"