qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: hellord <halouworls@gmail.com>
Cc: qemu-devel@nongnu.org, Akihiko Odaki <akihiko.odaki@daynix.com>,
	 Viktor Prutyanov <viktor.prutyanov@phystech.edu>,
	junjiehua <junjiehua@tencent.com>
Subject: Re: [PATCH] contrib/elf2dmp: a workaround for the buggy msvcrt.dll!fwrite
Date: Wed, 10 Jul 2024 17:25:30 +0100	[thread overview]
Message-ID: <CAFEAcA9oGivebEDmKK+rGitH_CDXt+r7kLhpw0vXP76cexN_GA@mail.gmail.com> (raw)
In-Reply-To: <CA+TA2aVV8qSK9zEv+HHyp-ib00vqaCLW_s4Hc5pGa_UJskQvUQ@mail.gmail.com>

On Wed, 10 Jul 2024 at 09:02, hellord <halouworls@gmail.com> wrote:
>
>
>>
>>
>> On Tue, Jul 9, 2024 at 10:39 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>> Is there a particular reason to use 128MB here? If the
>> runtime only fails on 4GB or more, maybe we should use
>> a larger MAX_CHUNK_SIZE, like 2GB ?
>
>
> According to current analysis, size <= 4GB all are safe, however there are many
> versions of msvcrt, this bug exists on Server 2008/2019/2022 and Windows 11(all
> with full latest updates), and it may also exist in other versions, but it is difficult to
> check each version individually. I am not sure if all versions handle boundary sizes
> like 2GB/4GB correctly. So I prefer a relatively conservative value: 128MB.
>
> Maybe we could use #ifdef _WIN32 to differentiate the handling between Linux and
> Windows. For Linux, it remains unchanged, while for Windows, it processes by chunks
> with max_chunk_sizeto 1GB.

I don't think it's worth making this Windows-specific. I agree that
it's OK to be a bit conservative, but 128MB seems to me extremely
conservative. I think we could say, for instance, 512MB or 1GB, without
being at much danger of running into broken implementations here.

thanks
-- PMM


  reply	other threads:[~2024-07-10 16:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-08 11:25 [PATCH] contrib/elf2dmp: a workaround for the buggy msvcrt.dll!fwrite junjiehua
2024-07-09 14:39 ` Peter Maydell
2024-07-10  8:02   ` hellord
2024-07-10 16:25     ` Peter Maydell [this message]
2024-07-11 16:24       ` junjiehua
2024-07-11  7:53     ` Akihiko Odaki
2024-07-11 16:20       ` junjiehua
2024-07-11 16:31       ` Daniel P. Berrangé
2024-07-11 16:49         ` junjiehua
2024-07-11 17:05 ` Daniel P. Berrangé
2024-07-13 12:56   ` Akihiko Odaki

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=CAFEAcA9oGivebEDmKK+rGitH_CDXt+r7kLhpw0vXP76cexN_GA@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=akihiko.odaki@daynix.com \
    --cc=halouworls@gmail.com \
    --cc=junjiehua@tencent.com \
    --cc=qemu-devel@nongnu.org \
    --cc=viktor.prutyanov@phystech.edu \
    /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 NNTP newsgroup(s).