public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* strcpy returns NULL pointer and not destination pointer
@ 2006-05-03 13:38 Bob Picco
  2006-05-03 18:08 ` Chen, Kenneth W
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Bob Picco @ 2006-05-03 13:38 UTC (permalink / raw)
  To: linux-ia64

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-05-03 18:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-03 13:38 strcpy returns NULL pointer and not destination pointer Bob Picco
2006-05-03 18:08 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox