From 402ecba487804e9196769f39a8d157847d3b3104 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Sat, 10 Feb 2018 16:24:17 -0500 Subject: [BZ #22830] malloc_stats: restore cancellation for stderr correctly. malloc_stats means to disable cancellation for writes to stderr while it runs, but it restores stderr->_flags2 with |= instead of =, so what it actually does is disable cancellation on stderr permanently. [BZ #22830] * malloc/malloc.c (__malloc_stats): Restore stderr->_flags2 correctly. * malloc/tst-malloc-stats-cancellation.c: New test case. * malloc/Makefile: Add new test case. --- malloc/Makefile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'malloc/Makefile') diff --git a/malloc/Makefile b/malloc/Makefile index 17873e67c4..7d54bad866 100644 --- a/malloc/Makefile +++ b/malloc/Makefile @@ -37,6 +37,7 @@ tests := mallocbug tst-malloc tst-valloc tst-calloc tst-obstack \ tst-malloc-tcache-leak \ tst-malloc_info \ tst-malloc-too-large \ + tst-malloc-stats-cancellation \ tests-static := \ tst-interpose-static-nothread \ @@ -96,6 +97,7 @@ $(objpfx)tst-malloc-backtrace: $(shared-thread-library) $(objpfx)tst-malloc-thread-exit: $(shared-thread-library) $(objpfx)tst-malloc-thread-fail: $(shared-thread-library) $(objpfx)tst-malloc-fork-deadlock: $(shared-thread-library) +$(objpfx)tst-malloc-stats-cancellation: $(shared-thread-library) # Export the __malloc_initialize_hook variable to libc.so. LDFLAGS-tst-mallocstate = -rdynamic -- cgit v1.2.3