unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: "Dmitry V. Levin" <ldv@altlinux.org>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH v4] libio: do not attempt to free wide buffers of legacy streams [BZ #24228]
Date: Wed, 19 Jun 2019 23:15:36 +0200	[thread overview]
Message-ID: <87y31x1dl3.fsf@oldenburg2.str.redhat.com> (raw)
In-Reply-To: <20190619195130.GA27256@altlinux.org> (Dmitry V. Levin's message of "Wed, 19 Jun 2019 22:51:31 +0300")

* Dmitry V. Levin:

> Commit a601b74d31ca086de38441d316a3dee24c866305 aka glibc-2.23~693
> ("In preparation for fixing BZ#16734, fix failure in misc/tst-error1-mem
> when _G_HAVE_MMAP is turned off.") introduced a regression:
> _IO_unbuffer_all() now invokes _IO_wsetb() to free wide buffers of all
> files, including legacy standard files which are small statically
> allocated objects that do not have wide buffers and the _mode member,
> causing memory corruption.
>
> Another memory corruption in _IO_unbuffer_all() happens when -1
> is assigned to the _mode member of legacy standard files that do not
> have it.

GNU style calls for not putting () after function names.  (Sorry, I must
sound like a broken record).

> diff --git a/libio/Makefile b/libio/Makefile
> index 7d53cb06b0..b81e8bf5e2 100644
> --- a/libio/Makefile
> +++ b/libio/Makefile
> @@ -65,7 +65,7 @@ tests = tst_swprintf tst_wprintf tst_swscanf tst_wscanf tst_getwc tst_putwc   \
>  	tst-setvbuf1 tst-popen1 tst-fgetwc bug-wsetpos tst-fseek \
>  	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-sprintf-ub tst-sprintf-chk-ub tst-bz24051 tst-bz24153 tst-bz24228 \
>  	tst-wfile-sync tst-wfile-gconv

I suggest to qualify the new test with “ifeq ($(build-shared),yes)”.  It
can never meet its test objective with static linking because the
relevant code just is not there.

Rest looks good to me, thanks.

I can confirm that it fixes the OpenJDK failure we saw.

Thanks,
Florian

  reply	other threads:[~2019-06-19 21:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-18 12:44 [PATCH] libio: do not cleanup wide buffers of legacy standard files [BZ #24228] Dmitry V. Levin
2019-02-18 12:56 ` Florian Weimer
2019-02-18 19:10   ` Dmitry V. Levin
2019-02-18 21:38     ` [PATCH v2] " Dmitry V. Levin
2019-02-19  0:57     ` [PATCH] " Dmitry V. Levin
2019-02-19  1:29       ` [PATCH v3] libio: do not unbuffer legacy standard files in compatibility mode " Dmitry V. Levin
2019-03-13 15:08         ` Florian Weimer
2019-03-13 15:46           ` Dmitry V. Levin
2019-03-13 15:49             ` Florian Weimer
2019-03-13 15:59               ` Dmitry V. Levin
2019-06-19 13:10         ` Florian Weimer
2019-06-19 16:03           ` Dmitry V. Levin
2019-06-19 16:15             ` Florian Weimer
2019-06-19 17:46               ` Dmitry V. Levin
2019-06-19 19:04                 ` Florian Weimer
2019-06-19 19:51                   ` [PATCH v4] libio: do not attempt to free wide buffers of legacy streams " Dmitry V. Levin
2019-06-19 21:15                     ` Florian Weimer [this message]
2019-06-19 22:08                       ` [PATCH v5] " Dmitry V. Levin
2019-06-20  8:59                         ` Florian Weimer
2019-06-20 17:42                           ` Dmitry V. Levin

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=87y31x1dl3.fsf@oldenburg2.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=ldv@altlinux.org \
    --cc=libc-alpha@sourceware.org \
    /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).