Summary: | media-video/smplayer-18.4.0 with GCC 8.1 - mongoose.c:8370:65: error: ‘%s’ directive output may be truncated writing up to 8191 bytes into a region of size 500 [-Werror=format-truncation=] | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Mike Lothian <mike> |
Component: | Current packages | Assignee: | Qt Bug Alias <qt> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | media-video |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | https://sourceforge.net/p/smplayer/bugs/882/ | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=654766 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
build.log
smplayer-18.4.0-build.log Turn error diagnostics into warning for false positive Remove -Werror which should not be in production code |
Description
Mike Lothian
2018-05-03 11:58:38 UTC
Created attachment 529566 [details]
build.log
I think this should also fail with GCC 7. (In reply to Jeroen Roovers from comment #2) > I think this should also fail with GCC 7. In my case it does build fine with GCC-7.3.0-r1 And, of course, it doesn't work with GCC-8.1.0 and GCC-8.1.0-r1 Portage 2.3.34 (python 3.6.5-final-0, default/linux/amd64/17.1/desktop/plasma, gcc-8.1.0, glibc-2.26-r6, 4.16.7-gentoo x86_64) ================================================================= System uname: Linux-4.16.7-gentoo-x86_64-Intel-R-_Core-TM-_i7-4930K_CPU_@_3.40GHz-with-gentoo-2.4.1 KiB Mem: 16352972 total, 2803896 free KiB Swap: 0 total, 0 free Timestamp of repository gentoo: Thu, 03 May 2018 22:30:01 +0000 Head commit of repository gentoo: df0dabac3240e22373ce1533da6b244ceba76fe2 sh bash 4.4_p19 ld GNU ld (Gentoo 2.30 p2) 2.30.0 app-shells/bash: 4.4_p19::gentoo dev-lang/perl: 5.26.2::gentoo dev-lang/python: 2.7.14-r2::gentoo, 3.6.5-r1::gentoo dev-util/cmake: 3.11.1::gentoo dev-util/pkgconfig: 0.29.2::gentoo sys-apps/baselayout: 2.4.1-r2::gentoo sys-apps/openrc: 0.35.5::gentoo sys-apps/sandbox: 2.13::gentoo sys-devel/autoconf: 2.13::gentoo, 2.69-r4::gentoo sys-devel/automake: 1.13.4-r2::gentoo, 1.16.1-r1::gentoo sys-devel/binutils: 2.30-r2::gentoo sys-devel/gcc: 7.3.0-r1::gentoo, 8.1.0-r1::gentoo sys-devel/gcc-config: 1.9.1::gentoo sys-devel/libtool: 2.4.6-r5::gentoo sys-devel/make: 4.2.1-r3::gentoo sys-kernel/linux-headers: 4.16-r1::gentoo (virtual/os-headers) sys-libs/glibc: 2.26-r6::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 sync-rsync-verify-max-age: 24 sync-rsync-verify-metamanifest: yes sync-rsync-verify-jobs: 1 sync-rsync-extra-opts: my location: /usr/local/my masters: gentoo priority: 0 deadbeef-overlay location: /var/lib/layman/deadbeef-overlay masters: gentoo priority: 50 hamper-overlay location: /var/lib/layman/hamper-overlay masters: gentoo priority: 50 linxon location: /var/lib/layman/linxon masters: gentoo priority: 50 mozilla location: /var/lib/layman/mozilla masters: gentoo priority: 50 reagentoo location: /var/lib/layman/reagentoo masters: gentoo priority: 50 scrill location: /var/lib/layman/scrill masters: gentoo priority: 50 steam-overlay location: /var/lib/layman/steam-overlay masters: gentoo priority: 50 ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="*" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -mtune=native -O2 -pipe -fomit-frame-pointer" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-march=native -mtune=native -O2 -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS="--with-bdeps=y --quiet-build=n" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync metadata-transfer 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://distfiles.gentoo.org" LANG="ru_RU.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="ru en" MAKEOPTS="-j12" 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="/tmp" USE="X a52 aac acl acpi activities aes aften alsa amd64 amr ass audio avx bash-completion branding bzip2 cairo cdda cdr clang cleartype cracklib crypt css cups cxx dbus declarative device-mapper djvu dri dts dv dvd dvdr egl elogind encode exif faac faad fam fat ffmpeg firmware-loader flac fontconfig gd gif glamor gles gpm gzip iconv icu id3tag ieee1394 imagemagick ipv6 jit jpeg kde keymap ladspa lame lash lcms libass libnotify lm_sensors lzma lzo mad matroska midi mmx mmxext mng modules mp3 mp4 mpeg mplayer mtp mudflap multilib ncurses nls nptl ntfs nvidia ogg opengl openmp opus pam pango pcre pdf phonon pie plasma png policykit popcnt ppds pppd pulseaudio qml qt5 quicktime rar raw readline scanner sdl seccomp session sse sse2 sse3 sse4_1 sse4_2 ssl ssp ssse3 startup-notification svc svg sysfs system-binutils system-boost system-cairo system-clang system-ffmpeg system-harfbuzz system-icu system-jpeg system-libevent system-libvpx system-llvm system-sql tcpd theora threads tiff toolame truetype twolame udev udisks unicode upower usb vaapi vdpau vorbis vpx wav wavpack wayland widgets win32codecs wxwidgets x264 x265 xattr xcb xcomposite xml xorg xscreensaver xulrunner xv xvfb xvid xvmc zip 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 socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon plan sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx f16c mmx mmxext pclmul 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="evdev" KERNEL="linux" L10N="ru en" 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-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby22 ruby23" USERLAND="GNU" VIDEO_CARDS="nvidia" 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, ENV_UNSET, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS Created attachment 529712 [details]
smplayer-18.4.0-build.log
Build with USE="-autoshutdown -bidi -debug -mpris"
Created attachment 530068 [details, diff]
Turn error diagnostics into warning for false positive
I suspect that the limits in gcc-8 for printing the diagnostics in the default might be stricter. Therefore, I guess to block this bug against gcc-8 might be appropriate.
I attach a patch which simply turns the diagnostics into a warning (which IMHO it should have been in the first place).
This patch might fail for gcc or clang versions which do not have the option -Wformat-truncation
I have not investigated whether there are such versions.
(In reply to Martin Väth from comment #5) > Created attachment 530068 [details, diff] [details, diff] > Turn error diagnostics into warning for false positive > Thanks, the patch you provided does the trick for me. I was able to build smplayer using gcc-8.1.0-r1 with USE="-autoshutdown -bidi -debug -mpris" It also works fine with gcc-7.3.0-r1 In the same time the patch is not suitable for llvm/clang-6.0.0-r1. It does not build with patch, but compiles and merges fine without said patch. But since this bug is related to gcc-8.1.0, I think I should not clutter it with build logs related to clang. If I should do otherwise - please let me know. Created attachment 530294 [details, diff]
Remove -Werror which should not be in production code
My comment to my fix of the patch did not appear (probably due to a local javascript blocker) so I post it again: As already indicated, the real bug is that a mere informative message is causing a stop of the compilation. I had previously falsely assumed that this was the compiler default (caused by e.g. the default -DFORTIFY_SOURCE=2 or something similar), but I simply had missed that for this particular file the option -Werror was passed. Of course, while this option is useful during development, it is always wrong to use in production code for exactly that reason: An informative message is not an error, and such informative messages are strongly compiler dependent. Therefore, the correct fix is to remove the inappropriate -Werror which is done by the new patch. (In reply to Martin Väth from comment #8) > My comment to my fix of the patch did not appear (probably due to a local > javascript blocker) so I post it again: > > As already indicated, the real bug is that a mere informative message is > causing a stop of the compilation. I had previously falsely assumed that > this was the compiler default (caused by e.g. the default -DFORTIFY_SOURCE=2 > or something similar), but I simply had missed that for this particular file > the option -Werror was passed. > > Of course, while this option is useful during development, it is always > wrong to use in production code for exactly that reason: An informative > message is not an error, and such informative messages are strongly compiler > dependent. > > Therefore, the correct fix is to remove the inappropriate -Werror which is > done by the new patch. Sorry, but I cannot see the attachment - just a comment about it. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e101ecc3740756d2b69c369791f6ecb4c264ae9d commit e101ecc3740756d2b69c369791f6ecb4c264ae9d Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2018-05-07 12:18:57 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2018-05-07 12:19:08 +0000 media-video/smplayer: drop -Werror to allow gcc-8, bug #654724 gcc-8 covers even more potential buffer overflow conditions. This causes new build failure due to blanket -Werror in smplayer. For more details see Gentoo's take on -Werror handling in devmanual: https://devmanual.gentoo.org/ebuild-writing/common-mistakes/index.html Reported-by: Mike Lothian Closes: https://bugs.gentoo.org/654724 Package-Manager: Portage-2.3.36, Repoman-2.3.9 media-video/smplayer/files/smplayer-18.3.0-disable-werror.patch | 9 +++++++++ media-video/smplayer/smplayer-18.3.0.ebuild | 1 + media-video/smplayer/smplayer-18.4.0.ebuild | 1 + 3 files changed, 11 insertions(+) |