public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Paul Pluzhnikov <ppluzhnikov@gmail.com>
To: GLIBC Devel <libc-alpha@sourceware.org>
Cc: Paul Pluzhnikov <ppluzhnikov@google.com>
Subject: Fix failure to cleanup wide stream buffers in preparation for BZ#16734 fix
Date: Sun, 12 Jul 2015 19:22:00 -0000	[thread overview]
Message-ID: <CALoOobPZ9HcdiFqOyXW6+hetSeKMzUYCk1yPQk1_Y9-Ja_46HQ@mail.gmail.com> (raw)

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

Greetings,

In preparation for BZ#16734 fix, I've build libc with (not intended to commit):

diff --git a/libio/libioP.h b/libio/libioP.h
index d8604ca..d1699de 100644
--- a/libio/libioP.h
+++ b/libio/libioP.h
@@ -719,7 +719,7 @@ extern _IO_off64_t _IO_seekpos_unlocked (_IO_FILE
*, _IO_off64_t, int)
 # endif
 #endif

-#if _G_HAVE_MMAP
+#if _G_HAVE_MMAP && 0

 # include <unistd.h>
 # include <fcntl.h>
... etc.

This results in mtrace test failure:
FAIL: misc/tst-error1-mem

Attached patch fixes the test failure.

Thanks,

-- 
Paul Pluzhnikov



2015-07-12  Paul Pluzhnikov  <ppluzhnikov@google.com>

        [BZ #16734]
        * libio/genops.c (_IO_unbuffer_all): Free wide buffer as well.

[-- Attachment #2: pr16734-20150712-patch.txt --]
[-- Type: text/plain, Size: 360 bytes --]

diff --git a/libio/genops.c b/libio/genops.c
index 0f5e800..e13b3d1 100644
--- a/libio/genops.c
+++ b/libio/genops.c
@@ -977,6 +977,9 @@ _IO_unbuffer_all (void)
 
 	  _IO_SETBUF (fp, NULL, 0);
 
+	  if (fp->_mode > 0)
+	    _IO_wsetb (fp, NULL, NULL, 0);
+
 #ifdef _IO_MTSAFE_IO
 	  if (cnt < MAXTRIES && fp->_lock != NULL)
 	    _IO_lock_unlock (*fp->_lock);

             reply	other threads:[~2015-07-12 19:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-12 19:22 Paul Pluzhnikov [this message]
2015-07-15 11:19 ` Siddhesh Poyarekar
2015-08-08 23:31   ` Paul Pluzhnikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALoOobPZ9HcdiFqOyXW6+hetSeKMzUYCk1yPQk1_Y9-Ja_46HQ@mail.gmail.com \
    --to=ppluzhnikov@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=ppluzhnikov@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).