Bug 1892100

Summary: gcc11 error: '__builtin_memcmp_eq' specified bound 16 exceeds source size 0
Product: [Fedora] Fedora Reporter: Michael Young <m.a.young>
Component: gccAssignee: Jeff Law <law>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 34CC: aoliva, dmalcolm, fweimer, jakub, jwakely, law, mpolacek, msebor, nickc, sipoyare
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-06-07 22:58:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michael Young 2020-10-27 22:02:17 UTC
When doing a scratch build of xen against the [ELN] gcc 11 side tag I get the following error which looks to me like a compiler issue

tboot.c: In function 'tboot_probe':
/builddir/build/BUILD/xen-4.14.0/xen/include/xen/string.h:101:27: error: '__builtin_memcmp_eq' specified bound 16 exceeds source size 0 [-Werror=stringop-overread]
  101 | #define memcmp(s1, s2, n) __builtin_memcmp(s1, s2, n)
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
tboot.c:105:10: note: in expansion of macro 'memcmp'
  105 |     if ( memcmp(&tboot_shared_uuid, (uuid_t *)tboot_shared, sizeof(uuid_t)) )
      |          ^~~~~~
cc1: all warnings being treated as errors

If I replace memcmp with (memcmp) in line 105, thus picking up a copy of memcmp with the xen code, then it builds successfully.

Comment 1 Jeff Law 2020-10-27 23:49:39 UTC
This one is already on my radar as it's flagged by the sidetag build that's already in progress.

Comment 2 Jeff Law 2020-10-30 18:13:28 UTC
I've worked around this with one well placed volatile in tboot_probe while Martin and I work out how the improvements in the stringop-overflow checks should interact with this kind of low level code.

Comment 3 Ben Cotton 2021-02-09 15:21:50 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

Comment 4 Ben Cotton 2022-05-12 16:02:05 UTC
This message is a reminder that Fedora Linux 34 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 34 on 2022-06-07.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '34'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 34 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 5 Ben Cotton 2022-06-07 22:58:29 UTC
Fedora Linux 34 entered end-of-life (EOL) status on 2022-06-07.

Fedora Linux 34 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release.

Thank you for reporting this bug and we are sorry it could not be fixed.