This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: while working on an optimized version of strnlen, some string tests fail

On 17/11/2016 16:27, Nam-goo Lee wrote:
> Hi.
> I'm working on an optimized version of strnlen function for arm.
> But following tests fail, and I'm stuck here finding the reasons for
> the failure.
> FAIL: string/stratcliff
> FAIL: string/test-stpncpy
> FAIL: string/test-strncpy
> Summary of test results:
>       3 FAIL
>      57 PASS
> I'm surprised to see that tests for functions other than strnlen fail.
> I'd really appreciate to get some hints on what the 'stratcliff' test does,
> and the reasons for the failure.
> Attached my code.
> Thanks.


ARM uses default string/str{n,p}cpy.c code and strncpy code has:

 26 char *
 27 STRNCPY (char *s1, const char *s2, size_t n)
 28 {
 29   size_t size = __strnlen (s2, n);

So if your optimized strnlen does not provide the expected correct result
the code will potentially fail.  It might the case where it is stressing
a case that test-strnlen does not issue.  Either way, you need to a full 
clean make check to make sure the implementation is ready for upstream review.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]