Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 634338

Summary: app-emulation/xen-tools fails to compile with gcc 7
Product: Gentoo Linux Reporter: Linus Lotz <gentoo>
Component: Current packagesAssignee: Gentoo Xen Devs <xen>
Status: RESOLVED FIXED    
Severity: normal CC: hydrapolic
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 617524    
Attachments: emerge --info

Description Linus Lotz 2017-10-15 14:31:44 UTC
Created attachment 498766 [details]
emerge --info

The compilation fails with the following error:
xenlockprof.c: In function ‘main’:
xenlockprof.c:100:53: error: ‘%s’ directive writing up to 39 bytes into a region of size between 17 and 37 [-Werror=format-overflow=]
             sprintf(name, "unknown type(%d) %d lock %s", data[j].type,
                                                     ^~
In file included from /usr/include/stdio.h:936:0,
                 from /var/tmp/portage/app-emulation/xen-tools-4.8.2-r1/work/xen-4.8.2/tools/misc/../../tools/libxc/include/xenctrl.h:33,
                 from xenlockprof.c:13:
/usr/include/bits/stdio2.h:33:10: note: ‘__builtin___sprintf_chk’ output between 24 and 83 bytes into a destination of size 60
   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       __bos (__s), __fmt, __va_arg_pack ());
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors


There exists a patch for this error:
https://patchwork.kernel.org/patch/9662249/
Comment 1 Tomáš Mózes 2017-10-16 12:34:56 UTC
https://github.com/gentoo/gentoo/pull/5962
Comment 2 Tomáš Mózes 2017-10-17 07:33:58 UTC
https://github.com/gentoo/gentoo/commit/6b9ff912c8bc4db4d4cafe3d72e5803904391725

Thanks for reporting.