public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: "Bob Picco" <bob.picco@hp.com>
To: linux-ia64@vger.kernel.org
Subject: strcpy returns NULL pointer and not destination pointer
Date: Wed, 03 May 2006 13:38:06 +0000	[thread overview]
Message-ID: <20060503133806.GC19859@localhost> (raw)

Hi Ken:

I'm assuming you can speak to this because your email address is in
memcpy_mck.S.

The removal of -ffreestanding compiler flag in 2.6.17-rcX (commit id
6edfba1b33c701108717f4e036320fc39abe1912) causes strcpy calls 
with a known size for the source string to be replaced with memcpy which
is faster.  ia64 memcpy has return values which are unlike stdlibc and
the other arch memcpy routines examined by me in the kernel.  The ia64 return
values are 0 for success and number of bytes copied for failure. Thus any
instance of pointer = strcpy(dest, "some string") has zero assigned to
pointer.  I detected this when testing kgdb on 2.6.17-rc3.  

The implementation in memcpy_mck.S doesn't leave a single scratch
register or predicate. I didn't pursue very long for a solution.

thanks,

bob

             reply	other threads:[~2006-05-03 13:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-03 13:38 Bob Picco [this message]
2006-05-03 18:08 ` strcpy returns NULL pointer and not destination pointer Chen, Kenneth W
2006-05-03 18:30 ` Bob Picco
2006-05-03 18:46 ` Chen, Kenneth W
2006-05-03 18:48 ` Matthew Wilcox
2006-05-03 18:53 ` Chen, Kenneth W

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=20060503133806.GC19859@localhost \
    --to=bob.picco@hp.com \
    --cc=linux-ia64@vger.kernel.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