Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 634596 - app-emulation/xen-tools-4.8.2-r2 fails to build with gcc-7: xenpmd.c:90:36: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size 19 [-Werror=format-truncation=]
Summary: app-emulation/xen-tools-4.8.2-r2 fails to build with gcc-7: xenpmd.c:90:36: e...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal trivial (vote)
Assignee: Gentoo Xen Devs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: gcc-7
  Show dependency tree
 
Reported: 2017-10-18 00:22 UTC by CaptainBlood
Modified: 2017-12-10 17:33 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log.bz2 (build.log.bz2,90.85 KB, application/x-bzip2)
2017-10-18 04:27 UTC, Tomáš Mózes
Details

Note You need to log in before you can comment on or make changes to this bug.
Description CaptainBlood 2017-10-18 00:22:28 UTC
--- xen-4.8.2/tools/xenpmd/xenpmd.c	2017-09-06 13:26:35.000000000 +0300
+++ xen-4.8.2/tools/xenpmd/xenpmd.c.new	2017-10-18 02:47:01.161149379 +0300
@@ -100,7 +100,7 @@
 {
     FILE *file = 0;
     struct dirent *dir_entries;
-    char file_name[32];
+    char file_name[276];
     
     do 
     {
@@ -110,10 +110,10 @@
         if ( strlen(dir_entries->d_name) < 4 )
             continue;
         if ( battery_info_type == BIF ) 
-            snprintf(file_name, 32, BATTERY_INFO_FILE_PATH,
+            snprintf(file_name, 276 , BATTERY_INFO_FILE_PATH,
                      dir_entries->d_name);
         else 
-            snprintf(file_name, 32, BATTERY_STATE_FILE_PATH,
+            snprintf(file_name, 276, BATTERY_STATE_FILE_PATH,
                      dir_entries->d_name);
         file = fopen(file_name, "r");
     } while ( !file );


-------------------------------------------------------------------------
https://www.mail-archive.com/opensuse-commit@opensuse.org/msg110939.html
-------------------------------------------------------------------------
Comment 1 Tomáš Mózes 2017-10-18 02:30:04 UTC
Does 4.8.2-r2 fail to build?

A patch was applied for a build fail:
https://bugs.gentoo.org/634338
Comment 2 Tomáš Mózes 2017-10-18 04:27:34 UTC
Created attachment 499046 [details]
build.log.bz2
Comment 3 Tomáš Mózes 2017-10-18 04:28:01 UTC
Portage 2.3.11 (python 3.4.6-final-0, default/linux/amd64/13.0, gcc-7.2.0, glibc-2.25-r7, 4.13.7-gentoo x86_64)
=================================================================
System uname: Linux-4.13.7-gentoo-x86_64-Intel-R-_Core-TM-_i5-3570_CPU_@_3.40GHz-with-gentoo-2.4.1
KiB Mem:    10587016 total,   8399656 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Wed, 18 Oct 2017 00:15:01 +0000
Head commit of repository gentoo: 26bf793827a21ba3d68c93e9f1c98b39c7f9e96e
sh bash 4.4_p12
ld GNU ld (Gentoo 2.29.1 p1.0) 2.29.1
app-shells/bash:          4.4_p12::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.26.1::gentoo
dev-lang/python:          2.7.14::gentoo, 3.4.6::gentoo, 3.5.4::gentoo, 3.6.3::gentoo
dev-util/cmake:           3.9.4::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.33::gentoo
sys-apps/sandbox:         2.12::gentoo
sys-devel/autoconf:       2.69-r4::gentoo
sys-devel/automake:       1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15.1-r1::gentoo
sys-devel/binutils:       2.29.1::gentoo
sys-devel/gcc:            7.2.0::gentoo
sys-devel/gcc-config:     1.9.0::gentoo
sys-devel/libtool:        2.4.6-r4::gentoo
sys-devel/make:           4.2.1-r1::gentoo
sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.25-r7::gentoo

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.1/ext-active/ /etc/php/apache2-php7.2/ext-active/ /etc/php/cgi-php7.1/ext-active/ /etc/php/cgi-php7.2/ext-active/ /etc/php/cli-php7.1/ext-active/ /etc/php/cli-php7.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://tux.rainside.sk/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl amd64 berkdb bzip2 cli cracklib crypt cxx dri fortran gdbm iconv ipv6 modules multilib ncurses nptl openmp pam pcre readline seccomp session ssl tcpd unicode xattr zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core authz_host dir mime unixd socache_shmcb log_config rewrite vhost_alias log_forensic proxy proxy_fcgi proxy_http proxy_connect info status deflate filter authn_file authz_user access_compat actions alias authn_alias authn_anon env expires headers mime_magic negotiation reqtimeout setenvif version remoteip" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-1" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4 python3_5 python3_6" RUBY_TARGETS="ruby22 ruby23 ruby24" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 4 Tomáš Mózes 2017-10-18 04:28:39 UTC
Yes, confirmed on a box with gcc-7. Please next time be more specific that the build failed and attach the build.log with emerge --info, thanks.
Comment 5 Tomáš Mózes 2017-10-18 04:55:52 UTC
With the following upstream patch, xen-tools-4.8.2-r2 builds with gcc-7:
https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=2d78f78a14528752266982473c07118f1bc336e3
Comment 6 Tomáš Mózes 2017-11-03 22:17:40 UTC
Fixed for 4.9.0:
https://github.com/gentoo/gentoo/pull/6114
Comment 7 Tomáš Mózes 2017-11-25 02:19:37 UTC
Fixed with xen 4.9.0, thanks for reporting.