From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
To: Bob Tracy <rct@gherkin.frus.com>
Cc: Mathieu Chouquet-Stringer <mchouque@free.fr>,
linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org,
rth@twiddle.net
Subject: Re: strncpy (maybe others) broken on Alpha
Date: Sat, 22 Apr 2006 01:12:05 +0400 [thread overview]
Message-ID: <20060422011205.A1270@jurassic.park.msu.ru> (raw)
In-Reply-To: <20060421193759.55D55DBA1@gherkin.frus.com>; from rct@gherkin.frus.com on Fri, Apr 21, 2006 at 02:37:59PM -0500
On Fri, Apr 21, 2006 at 02:37:59PM -0500, Bob Tracy wrote:
> WITHOUT the patch, and everything else the same, gcc-4.0 and gcc-4.1
> appear to work, but the gcc-3.3 build produces the bad behavior we've
> been seeing.
Actually the bug doesn't show up with gcc-4 *only* because it tends
to pack the data more tightly, so that both src[] and dest[] have different
alignment vs. gcc-3 compiled foo.c:
src 0x11ffff8f4, dest 0x11ffff926 - gcc-4
src 0x11ffff8c0, dest 0x11ffff900 - gcc-3
If you add __attribute__((aligned(8))) to both src and dest declarations
in Mathieu's foo.c, you'll see the bug is still here.
> Pending a knowledgable peer review of Ivan's patch (no insult intended:
> I'm not qualified), I'd say we're close to putting this to rest. If it
> turns out the patch is the correct fix, I'm genuinely concerned about
> how long this bug went undetected :-(. The modification date of
> arch/alpha/lib/strncpy.S is 28 Jul 2003 in my tree. The stxncpy.S file
> is not quite a year newer: 10 May 2004.
Well, these things happen. I think it's not quite surprising.
First, the kernel is not overloaded with strncpy calls. ;-)
Second, strncpy was mostly used in drivers that are rarely (if at all)
used on alpha.
Third, to discover this bug you need some special combination of source
and destination alignment, source string length and byte count.
Ivan.
next prev parent reply other threads:[~2006-04-21 21:12 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-19 21:31 class_device_add error in SCSI with 2.6.17-rc2-g52824b6b Mathieu Chouquet-Stringer
2006-04-19 21:58 ` Bob Tracy
2006-04-19 22:17 ` Mathieu Chouquet-Stringer
2006-04-20 10:14 ` Mathieu Chouquet-Stringer
2006-04-20 10:57 ` Mathieu Chouquet-Stringer
2006-04-20 17:11 ` strncpy (maybe others) broken on Alpha Mathieu Chouquet-Stringer
2006-04-20 20:55 ` Mathieu Chouquet-Stringer
2006-04-20 21:24 ` Ivan Kokshaysky
2006-04-20 21:27 ` Mathieu Chouquet-Stringer
2006-04-20 21:40 ` Bob Tracy
2006-04-20 21:57 ` Mathieu Chouquet-Stringer
2006-04-21 2:43 ` Bob Tracy
2006-04-21 8:15 ` Mathieu Chouquet-Stringer
2006-04-21 9:21 ` Mathieu Chouquet-Stringer
2006-04-21 9:50 ` Mathieu Chouquet-Stringer
2006-04-21 11:41 ` Bob Tracy
2006-04-21 11:55 ` Mathieu Chouquet-Stringer
2006-04-21 14:22 ` Ivan Kokshaysky
2006-04-21 19:37 ` Bob Tracy
2006-04-21 21:12 ` Ivan Kokshaysky [this message]
2006-04-21 22:49 ` Bob Tracy
2006-04-22 8:47 ` Mathieu Chouquet-Stringer
2006-04-22 8:45 ` Mathieu Chouquet-Stringer
2006-04-22 10:39 ` Bryan Østergaard
2006-04-20 21:22 ` Ivan Kokshaysky
2006-04-20 21:25 ` Mathieu Chouquet-Stringer
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=20060422011205.A1270@jurassic.park.msu.ru \
--to=ink@jurassic.park.msu.ru \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchouque@free.fr \
--cc=rct@gherkin.frus.com \
--cc=rth@twiddle.net \
/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
all inboxes | Powered by JetHome®