summary refs log tree commit diff
path: root/libio/Makefile
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2019-05-21 10:34:21 +0200
committerFlorian Weimer <fweimer@redhat.com>2019-05-21 12:03:54 +0200
commit7e740ab2e7be7d83b75513aa406e0b10875f7f9c (patch)
treeddeb5ddc8c43af310927c3db8b164a91a74ac248 /libio/Makefile
parent09e1b0e3f6facc1af2dbcfef204f0aaa8718772b (diff)
downloadglibc-7e740ab2e7be7d83b75513aa406e0b10875f7f9c.tar.gz
glibc-7e740ab2e7be7d83b75513aa406e0b10875f7f9c.tar.xz
glibc-7e740ab2e7be7d83b75513aa406e0b10875f7f9c.zip
libio: Fix gconv-related memory leak [BZ #24583]
struct gconv_fcts for the C locale is statically allocated,
and __gconv_close_transform deallocates the steps object.
Therefore this commit introduces __wcsmbs_close_conv to avoid
freeing the statically allocated steps objects.
Diffstat (limited to 'libio/Makefile')
-rw-r--r--libio/Makefile16
1 files changed, 14 insertions, 2 deletions
diff --git a/libio/Makefile b/libio/Makefile
index a5236c7042..7d53cb06b0 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -66,7 +66,11 @@ tests = tst_swprintf tst_wprintf tst_swscanf tst_wscanf tst_getwc tst_putwc   \
 	tst-fwrite-error tst-ftell-partial-wide tst-ftell-active-handler \
 	tst-ftell-append tst-fputws tst-bz22415 tst-fgetc-after-eof \
 	tst-sprintf-ub tst-sprintf-chk-ub tst-bz24051 tst-bz24153 \
-	tst-wfile-sync
+	tst-wfile-sync tst-wfile-gconv
+
+# This test tests interaction with the gconv cache.  Setting
+# GCONV_CACHE during out-of-container testing disables the cache.
+tests-container += tst-wfile-ascii
 
 tests-internal = tst-vtables tst-vtables-interposed tst-readline
 
@@ -163,10 +167,12 @@ tst_wprintf2-ARGS = "Some Text"
 test-fmemopen-ENV = MALLOC_TRACE=$(objpfx)test-fmemopen.mtrace
 tst-fopenloc-ENV = MALLOC_TRACE=$(objpfx)tst-fopenloc.mtrace
 tst-bz22415-ENV = MALLOC_TRACE=$(objpfx)tst-bz22415.mtrace
+tst-wfile-gconv-ENV = MALLOC_TRACE=$(objpfx)tst-wfile-gconv.mtrace
 
 generated += test-fmemopen.mtrace test-fmemopen.check
 generated += tst-fopenloc.mtrace tst-fopenloc.check
 generated += tst-bz22415.mtrace tst-bz22415.check
+generated += tst-wfile-gconv.mtrace tst-wfile-gconv.check
 
 aux	:= fileops genops stdfiles stdio strops
 
@@ -181,7 +187,8 @@ shared-only-routines = oldiofopen oldiofdopen oldiofclose oldfileops	\
 
 ifeq ($(run-built-tests),yes)
 tests-special += $(objpfx)test-freopen.out $(objpfx)test-fmemopen-mem.out \
-		 $(objpfx)tst-bz22415-mem.out
+		 $(objpfx)tst-bz22415-mem.out \
+		 $(objpfx)tst-wfile-gconv-mem.out
 ifeq (yes,$(build-shared))
 # Run tst-fopenloc-cmp.out and tst-openloc-mem.out only if shared
 # library is enabled since they depend on tst-fopenloc.out.
@@ -214,6 +221,7 @@ $(objpfx)tst-ungetwc2.out: $(gen-locales)
 $(objpfx)tst-widetext.out: $(gen-locales)
 $(objpfx)tst_wprintf2.out: $(gen-locales)
 $(objpfx)tst-wfile-sync.out: $(gen-locales)
+$(objpfx)tst-wfile-gconv.out: $(gen-locales)
 endif
 
 $(objpfx)test-freopen.out: test-freopen.sh $(objpfx)test-freopen
@@ -237,3 +245,7 @@ $(objpfx)tst-fopenloc-mem.out: $(objpfx)tst-fopenloc.out
 $(objpfx)tst-bz22415-mem.out: $(objpfx)tst-bz22415.out
 	$(common-objpfx)malloc/mtrace $(objpfx)tst-bz22415.mtrace > $@; \
 	$(evaluate-test)
+
+$(objpfx)tst-wfile-gconv-mem.out: $(objpfx)tst-wfile-gconv.out
+	$(common-objpfx)malloc/mtrace $(objpfx)tst-wfile-gconv.mtrace > $@; \
+	$(evaluate-test)