Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 645006 - net-analyzer/sarg-2.3.11 - report.c: In function ‘gerarel’: report.c:244:44: error: ‘%s’ directive output may be truncated writing up to 127 bytes into a region of size between 125 and 252 [-Werror=format-truncation=]
Summary: net-analyzer/sarg-2.3.11 - report.c: In function ‘gerarel’: report.c:244:44: ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-19 07:20 UTC by gentoo
Modified: 2018-01-20 13:59 UTC (History)
1 user (show)

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


Attachments
sarg-2.3.11-build-error (sarg-2.3.11_build.log,20.26 KB, text/plain)
2018-01-20 12:37 UTC, Alexandros C. Couloumbis
Details
complete build log (merge.log,22.54 KB, text/plain)
2018-01-20 13:07 UTC, gentoo
Details
sarg-2.3.11-format.patch (sarg-2.3.11-format.patch,289 bytes, patch)
2018-01-20 13:31 UTC, Jeroen Roovers (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description gentoo 2018-01-19 07:20:07 UTC
Compile for net-analyzer/sarg-2.3.11 fails with gcc error message :

report.c: In function ‘gerarel’:
report.c:244:44: error: ‘%s’ directive output may be truncated writing up to 127 bytes into a region of size between 125 and 252 [-Werror=format-truncation=]
      snprintf(arqtt,sizeof(arqtt),"%s/%s/tt%s-%s.html",outdirname,uinfo->filename,uinfo->filename,siteind);
                                            ^~
In file included from /usr/include/stdio.h:862:0,
                 from include/conf.h:9,
                 from report.c:27:
/usr/include/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’ output 11 or more bytes (assuming 265) into a destination of size 256
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
x86_64-pc-linux-gnu-gcc -c -I.  -DBINDIR=\"/usr/bin\" -DSYSCONFDIR=\"/etc/sarg\" -DFONTDIR=\"/usr/share/sarg/fonts\" -DIMAGEDIR=\"/usr/share/sarg/images\" -DSARGPHPDIR=\"/var/www/html\" -DLOCALEDIR=\"/usr/share/locale\" -DPACKAGE_NAME=\"sarg\" -DPACKAGE_TARNAME=\"sarg\" -DPACKAGE_VERSION=\"2.3.11\" -DPACKAGE_STRING=\"sarg\ 2.3.11\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_DIRENT_H=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_TIME_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DIRENT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_NETDB_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_NETINET_IN_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_CTYPE_H=1 -DHAVE_ERRNO_H=1 -DHAVE_SYS_RESOURCE_H=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_STDARG_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_LOCALE_H=1 -DHAVE_EXECINFO_H=1 -DHAVE_MATH_H=1 -DHAVE_LIBINTL_H=1 -DHAVE_LIBGEN_H=1 -DHAVE_STDBOOL_H=1 -DHAVE_GETOPT_H=1 -DHAVE_FCNTL_H=1 -DHAVE_GD_H=1 -DHAVE_GDFONTL_H=1 -DHAVE_GDFONTT_H=1 -DHAVE_GDFONTS_H=1 -DHAVE_GDFONTMB_H=1 -DHAVE_GDFONTG_H=1 -DHAVE_ICONV=1 -DICONV_CONST= -DHAVE_ICONV_H=1 -DHAVE_PCRE_H=1 -DENABLE_NLS=1 -DHAVE_GETTEXT=1 -DHAVE_DCGETTEXT=1 -DHAVE_FOPEN64=1 -D_LARGEFILE64_SOURCE=1 -DHAVE_BZERO=1 -DHAVE_BACKTRACE=1 -DHAVE_SYMLINK=1 -DHAVE_LSTAT=1 -DHAVE_GETNAMEINFO=1 -DHAVE_GETADDRINFO=1 -DHAVE_MKSTEMP=1 -DSIZEOF_RLIM_T=8 -DRLIM_STRING=\"%lli\" -DHAVE__USR_SHARE_SGML_DOCBOOK_XSL_STYLESHEETS_MANPAGES_DOCBOOK_XSL=1 -DHAVE__USR_SHARE_SGML_DOCBOOK_XSL_STYLESHEETS_HTML_ONECHUNK_XSL=1 -march=core-avx2 -O2 -pipe -Wall -Wno-sign-compare -Wextra -Wno-unused-parameter -Werror=implicit-function-declaration -Werror=format  email.c
cc1: some warnings being treated as errors


emerge --info :

Portage 2.3.19 (python 3.6.4-final-0, default/linux/amd64/17.0, gcc-7.2.0, glibc-2.26-r5, 4.14.14-gentoo x86_64)
=================================================================
System uname: Linux-4.14.14-gentoo-x86_64-Intel-R-_Core-TM-_i5-4670S_CPU_@_3.10GHz-with-gentoo-2.4.1
KiB Mem:    16307632 total,  10677392 free
KiB Swap:    3906556 total,   3906556 free
Timestamp of repository gentoo: Fri, 19 Jan 2018 06:15:01 +0000
Head commit of repository gentoo: a0915c09221b91db95ab1af78ee5360043de88d1
sh bash 4.4_p12-r1
ld GNU ld (Gentoo 2.29.1 p3) 2.29.1
app-shells/bash:          4.4_p12-r1::gentoo
dev-lang/perl:            5.26.1-r1::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.6.4::gentoo
dev-util/cmake:           3.10.1::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.11::gentoo
sys-apps/sandbox:         2.12::gentoo
sys-devel/autoconf:       2.69-r4::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.15.1-r1::gentoo
sys-devel/binutils:       2.29.1-r1::gentoo
sys-devel/gcc:            7.2.0-r1::gentoo
sys-devel/gcc-config:     1.9.1::gentoo
sys-devel/libtool:        2.4.6-r4::gentoo
sys-devel/make:           4.2.1-r1::gentoo
sys-kernel/linux-headers: 4.14::gentoo (virtual/os-headers)
sys-libs/glibc:           2.26-r5::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.de.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 

ACCEPT_KEYWORDS="amd64 ~amd64 ~x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core-avx2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind"
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="-march=core-avx2 -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://ftp.uni-erlangen.de/pub/mirrors/gentoo, ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo, http://ftp.halifax.rwth-aachen.de/gentoo/, rsync://ftp.halifax.rwth-aachen.de/gentoo/"
LANG="de_DE.utf8@euro.UTF8"
LC_ALL="en_US.UTF-8"
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 apache2 berkdb bindist bzip2 cli crypt cxx dri fortran gdbm gpm iconv ipv6 logrotate mmx modules multilib mysql ncurses nls nptl openmp pam pcre php readline samba seccomp sse sse2 ssl tcpd unicode vhosts 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="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_http proxy_html rewrite setenvif so speling status unique_id userdir usertrack vhost_alias authn_core authz_core socache_shmcb unixd xml2enc" APACHE2_MPMS="prefork" 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="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" 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" 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="php5-6 php7-1" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python3_6 python2_7" RUBY_TARGETS="ruby22" 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, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2018-01-20 11:55:20 UTC
Please attach the entire build log to this bug report.
Comment 2 Alexandros C. Couloumbis 2018-01-20 12:37:29 UTC
Created attachment 515352 [details]
sarg-2.3.11-build-error
Comment 3 Alexandros C. Couloumbis 2018-01-20 12:38:26 UTC
Greetings,

Linux version 4.14.14-gentoo (root@orion) (gcc version 7.2.0 (Gentoo 7.2.0-r1 p1.1)) #2 SMP Sat Jan 20 13:55:46 EET 2018

gcc (Gentoo 7.2.0-r1 p1.1) 7.2.0
Comment 4 gentoo 2018-01-20 13:07:01 UTC
Created attachment 515356 [details]
complete build log
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2018-01-20 13:19:33 UTC
Somehow I can't seem to trigger the build system to show any warnings at all, and with a configuration very similar to yours at that.
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2018-01-20 13:31:22 UTC
Created attachment 515362 [details, diff]
sarg-2.3.11-format.patch

Could you try this patch, please? I have it in 2.3.10 already, I am not sure if upstream would approve, but it does seem to be a bit smarter about the size calculation.
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2018-01-20 13:38:53 UTC
Oh wait, maybe my compiler choice settings hadn't trickled through to the right shell yet.
Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2018-01-20 13:59:15 UTC
Should be fixed now.