Bug 1564638 - glibc: Fix compile-time type error in string/test-strncmp.c and other string tests
Summary: glibc: Fix compile-time type error in string/test-strncmp.c and other string ...
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: glibc
Version: 7.6
Hardware: s390x
OS: Linux
Target Milestone: rc
: 7.6
Assignee: Florian Weimer
QA Contact: Alexandra Petlanová Hájková
Depends On: 1268008
Blocks: 1505492 1513404 1609081
TreeView+ depends on / blocked
Reported: 2018-04-06 18:27 UTC by Florian Weimer
Modified: 2018-10-30 09:39 UTC (History)
10 users (show)

Fixed In Version: glibc-2.17-224.el7
Doc Type: No Doc Update
Doc Text:
Clone Of:
Last Closed: 2018-10-30 09:38:06 UTC
Target Upstream Version:

Attachments (Terms of Use)
Further fixes in string/wcsmbs tests compared to upstream version (4.09 KB, patch)
2018-04-09 13:41 UTC, IBM Bug Proxy
no flags Details | Diff

System ID Private Priority Status Summary Last Updated
IBM Linux Technology Center 166516 0 None None None 2019-04-24 19:37:21 UTC
Red Hat Bugzilla 1268008 1 None None None 2021-01-20 06:05:38 UTC
Red Hat Product Errata RHSA-2018:3092 0 None None None 2018-10-30 09:39:09 UTC

Internal Links: 1268008

Description Florian Weimer 2018-04-06 18:27:50 UTC
glibc-rh1268008-19.patch has a crucial difference compared to upstream:

-  strcpy(s1, L("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs"));
-  strcpy(s2, L("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkLMNOPQRSTUV"));
+  STRCPY(s1, L("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs"));
+  STRCPY(s2, L("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkLMNOPQRSTUV"));

This results in a compile-time type error:

In file included from test-wcsncmp.c:2:0:
../string/test-strncmp.c: In function 'check1':
../string/test-strncmp.c:362:3: warning: passing argument 1 of 'strcpy' from incompatible pointer type [enabled by default]
   strcpy(s1, L("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs"));

As a result, test coverage is reduced.

We need to fix this before we can enable -Werror.

Comment 1 Florian Weimer 2018-04-06 18:31:23 UTC
It turns out the patch set for bug 1268008 has more such issues.

Comment 2 Florian Weimer 2018-04-06 21:42:22 UTC
Just to be clear: This is a test-only fix.  But it is probably a good idea to re-run the tests on z13 s390x hardware nevertheless.

Comment 3 IBM Bug Proxy 2018-04-09 13:41:32 UTC
Created attachment 1419302 [details]
Further fixes in string/wcsmbs tests compared to upstream version

------- Comment on attachment From STLI.com 2018-04-09 09:31 EDT-------

Indeed. In the tests/benchtests are several issues. I've applied the attached patch on top of glibc-2.17-222.el7.src.rpm. Now I don't see those warnings anymore.

I've build the patched src-rpm on 31/64bit on a z14 machine (Note: there are no specific z14 variants, thus the z13 string functions are used).
The string/wcsmbs tests are clean.

Comment 5 IBM Bug Proxy 2018-07-31 12:40:33 UTC
------- Comment From mgrf.com 2018-07-31 08:38 EDT-------
Closing on IBM side - received confirmation that this is verified ok on RHEL 7.6 alpha
....   installed RHEL 7.6 Alpha 1 and rebuild the RPM packages to check whether the corresponding string tests run without fails.

Please set the status to VERIFIED.

Comment 8 errata-xmlrpc 2018-10-30 09:38:06 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.