From: Ralf Baechle <ralf@oss.sgi.com>
To: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Cc: "Gleb O. Raiko" <raiko@niisi.msk.ru>, linux-mips@oss.sgi.com
Subject: Re: Bug in memmove
Date: Sat, 23 Jun 2001 16:22:21 +0200 [thread overview]
Message-ID: <20010623162221.A29966@bacchus.dhis.org> (raw)
In-Reply-To: <Pine.GSO.3.96.1010622200059.18677C-100000@delta.ds2.pg.gda.pl>; from macro@ds2.pg.gda.pl on Fri, Jun 22, 2001 at 08:21:30PM +0200
On Fri, Jun 22, 2001 at 08:21:30PM +0200, Maciej W. Rozycki wrote:
> > It seems there is a bug in our memmove routine. The condition is rare
> > though, for example, memmove copies incorrectly, if src=5, dst=4, len=9.
> [...]
> > Two questions here. First, do we have a pattern that satisfies the
> > condition, i.e. is the bug showstopper? My guess, it's not. Second, does
> > somebody have ideas how to fix the bug? Well, I have, but want to hear
> > somebody else.
>
> Here is a quick fix I developed after reading your report. It fixes the
> case you described. Now memcpy() is invoked only if there is no overlap
> at all -- the approach is taken from the Alpha port.
>
> The copy loop begs for optimization (the original memmove() bits do as
> well), but at least it works correctly. The patch applies cleanly to
> 2.4.5 as of today.
>
> Ralf, I think it should get applied unless someone cooks up a better
> solution, i.e. optimizes it. I'll optimize it myself, eventually, if no
> one else does, but don't hold your breath.
Applied to my working tree. I'll commit it in a few hours once I found
time to implement the same fix for 2.2 and mips64.
Ralf
next prev parent reply other threads:[~2001-06-23 14:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-06 13:11 Bug in memmove Gleb O. Raiko
2001-06-22 18:21 ` Maciej W. Rozycki
2001-06-23 14:22 ` Ralf Baechle [this message]
2001-06-25 12:03 ` Gleb O. Raiko
2001-06-25 12:13 ` Maciej W. Rozycki
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=20010623162221.A29966@bacchus.dhis.org \
--to=ralf@oss.sgi.com \
--cc=linux-mips@oss.sgi.com \
--cc=macro@ds2.pg.gda.pl \
--cc=raiko@niisi.msk.ru \
/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