Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 609618 - media-sound/mpd-0.20.4 - src/command/CommandError.cxx:21: error: cannot dynamic_cast ‘& __ex’ (of type ‘const class std::__exception_ptr::exception_ptr*’) to type ‘const class std::nested_exception*’ (source type is not polymorphic)
Summary: media-sound/mpd-0.20.4 - src/command/CommandError.cxx:21: error: cannot dynam...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Markos Chandras (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-17 09:29 UTC by Jeroen Roovers (RETIRED)
Modified: 2017-04-26 05:34 UTC (History)
5 users (show)

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


Attachments
media-sound:mpd-0.20.4:20170217-062727.log (media-sound:mpd-0.20.4:20170217-062727.log,45.26 KB, text/plain)
2017-02-17 09:29 UTC, Jeroen Roovers (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeroen Roovers (RETIRED) gentoo-dev 2017-02-17 09:29:40 UTC
Created attachment 464092 [details]
media-sound:mpd-0.20.4:20170217-062727.log

x86_64-pc-linux-gnu-g++ -std=c++14 -DHAVE_CONFIG_H -I.  -DNDEBUG -I./src -I/usr/include -DSYSTEM_CONFIG_FILE_LOCATION='"/etc/mpd.conf"'     -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -pthread -frecord-gcc-switches -g -pipe -O2 -Wall -Wformat=2 -march=amdfam10 -mmmx -m3dnow -msse -msse2 -msse3 -mno-ssse3 -msse4a -mcx16 -msahf -mno-movbe -mno-aes -mno-sha -mno-pclmul -mpopcnt -mabm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -mno-sse4.1 -mlzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mprfchw -mno-adx -mfxsr -mno-xsave
-mno-xsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=amdfam10 -fvisibility=hidden -fno-threadsafe-statics -fmerge-all-constants -ffast-math -ftree-vectorize -ffunction-sections -fdata-sections -Wextra -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wwrite-strings -Wsign-compare -c -o src/command/libmpd_a-CommandError.o `test -f 'src/command/CommandError.cxx' || echo './'`src/command/CommandError.cxx
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4/include/g++-v4/exception:163:0,
                 from src/command/CommandError.hxx:25,
                 from src/command/CommandError.cxx:21:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4/include/g++-v4/bits/nested_exception.h: In instantiation of ‘static const std::nested_exception* std::__get_nested_helper<_Ex>::_S_get(const _Ex&) [with _Ex = std::__exception_ptr::exception_ptr]’:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4/include/g++-v4/bits/nested_exception.h:104:51:   required from ‘const std::nested_exception* std::__get_nested_exception(const _Ex&) [with _Ex = std::__exception_ptr::exception_ptr]’
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4/include/g++-v4/bits/nested_exception.h:148:73:   required from ‘void std::rethrow_if_nested(const _Ex&) [with _Ex = std::__exception_ptr::exception_ptr]’
src/command/CommandError.cxx:114:29:   required from here
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4/include/g++-v4/bits/nested_exception.h:90:59: error: cannot dynamic_cast ‘& __ex’ (of type ‘const class std::__exception_ptr::exception_ptr*’) to type ‘const class std::nested_exception*’ (source type is not polymorphic)
       { return dynamic_cast<const nested_exception*>(&__ex); }
                                                           ^
make[1]: *** [Makefile:9970: src/command/libmpd_a-CommandError.o] Error 1
make[1]: Leaving directory '/home/portage/media-sound/mpd-0.20.4/work/mpd-0.20.4'
make: *** [Makefile:4680: all] Error 2

[ebuild     U ~] media-sound/mpd-0.20.4::gentoo [0.19.21-r1::gentoo] USE="alsa audiofile bzip2 eventfd faad ffmpeg flac glib icu id3tag inotify ipv6 jack lame libsamplerate mad mikmod modplug mpg123 musepack network ogg opus samba signalfd sndfile twolame unicode vorbis wavpack wildmidi zlib -adplug -ao -cdio -curl -debug -expat -fifo -fluidsynth -gme -libav -libmpdclient -libsoxr -mms -nfs -openal -oss -pipe (-pulseaudio) -recorder -selinux -sid -soundcloud -sqlite (-systemd) -tcpd -upnp -zeroconf -zip" 0 KiB

Fri 17 Feb 10:29:05 CET 2017
emerge --info media-sound/mpd
Portage 2.3.3 (python 3.4.5-final-0, default/linux/amd64/13.0, gcc-4.9.4, glibc-2.23-r3, 4.9.9-gentoo-JeR x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.9.9-gentoo-JeR-x86_64-AMD_Athlon-tm-_II_X3_455_Processor-with-gentoo-2.3
KiB Mem:    16434032 total,    486340 free
KiB Swap:    2097148 total,   2097148 free
Timestamp of repository gentoo: Fri, 17 Feb 2017 04:00:01 +0000
sh dash 0.5.8.2
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
ccache version 3.2.4 [disabled]
app-shells/bash:          4.3_p48-r1::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.22.3_rc4::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo, 3.5.2::gentoo
dev-util/ccache:          3.2.4::gentoo
dev-util/cmake:           3.7.2::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.22.4::gentoo
sys-apps/sandbox:         2.10-r3::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.4_p6-r2::gentoo, 1.8.5-r5::gentoo, 1.9.6-r4::gentoo, 1.11.6-r1::gentoo, 1.12.6::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.22-r1::gentoo, 2.23.1::gentoo, 2.23.2::gentoo, 2.24-r3::gentoo, 2.25.1-r1::gentoo
sys-devel/gcc:            4.7.3-r1::gentoo, 4.8.4::gentoo, 4.9.3::gentoo, 4.9.4::gentoo, 5.2.0::gentoo, 5.3.0::gentoo, 5.4.0::gentoo, 6.2.0-r1::gentoo, 6.3.0::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r3::gentoo
Repositories:

gentoo
    location: /aches/gentoo/portage
    sync-type: rsync
    sync-uri: rsync://rsync.nl.gentoo.org/gentoo-portage
    priority: 0

qt
    location: /aches/gentoo/layman/qt
    masters: gentoo
    priority: 50

steam-overlay
    location: /aches/gentoo/layman/steam
    masters: gentoo
    priority: 50

JeR
    location: /aches/gentoo/local
    masters: gentoo
    priority: 10000

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-frecord-gcc-switches -g -pipe -O2 -Wall -Wformat=2 -march=amdfam10 -mmmx -m3dnow -msse -msse2 -msse3 -mno-ssse3 -msse4a -mcx16 -msahf -mno-movbe -mno-aes -mno-sha -mno-pclmul -mpopcnt -mabm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -mno-sse4.1 -mlzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mprfchw -mno-adx -mfxsr -mno-xsave -mno-xsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=amdfam10 -Wno-comment"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib/ccache/bin /usr/lib/distcc/bin /usr/share/config /usr/share/gnupg/qualified.txt /var/lib/hsqldb /var/yp/Makefile"
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/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-frecord-gcc-switches -g -pipe -O2 -Wall -Wformat=2 -march=amdfam10 -mmmx -m3dnow -msse -msse2 -msse3 -mno-ssse3 -msse4a -mcx16 -msahf -mno-movbe -mno-aes -mno-sha -mno-pclmul -mpopcnt -mabm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -mno-sse4.1 -mlzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mprfchw -mno-adx -mfxsr -mno-xsave -mno-xsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=amdfam10"
DISTDIR="/aches/gentoo/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask=n --keep-going"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg cgroup compressdebug config-protect-if-modified distlocks fakeroot fixlafiles merge-sync metadata-transfer multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms sign splitdebug strict test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS=" http://mirror.netcologne.de/gentoo/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://gentoo.tiscali.nl/ http://mirror.leaseweb.com/gentoo/ "
LANG="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed"
MAKEOPTS="-j1"
PKGDIR="/aches/gentoo/packages/wim"
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="/home"
USE="256-color X a52 aac acl acpi alsa amd64 apng bash-completion berkdb bluetooth bzip2 cairo cli consolekit cracklib crypt cups cxx dbus distinct-l dri drm egl ffmpeg flac fortran gdbm gif glamor gles2 graphite gtk gudev hwdb i3 iconv idn introspection ipv6 ithreads jack jpeg kmod lame lzma minizip mmx mmxext mng modules mtp multilib multislot multitarget musepack ncat ncurses netlink nfs nls nonblockdialogs nptl offensive ogg opencv opengl openmp openrc opus pam pcre perl png policykit python qml qt3support qt5 quesoglc readline samba savedconfig sbc seccomp sensord session sloppy smp socks5 sse sse2 sse3 sse4 sse4_1 ssl ssse3 system-libCg tcpd test theora threads tiff tinfo truetype unicode unwind upower uvm vdpau vim-syntax vorbis wavpack wayland webkit2 x264 xa xattr xcb xft xinerama zlib" ABI_X86="64 32" 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="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="rrdtool rrdcached" CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext popcnt sse sse2 sse3 sse4a" CURL_SSL="gnutls" 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 libinput" KERNEL="linux" L10N="en-GB en nl" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_GB en nl" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" QEMU_SOFTMMU_TARGETS="i386" QEMU_USER_TARGETS="i386" RUBY_TARGETS="ruby21" 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, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

media-sound/mpd-0.19.21-r1::gentoo was built with the following:
USE="alsa audiofile bzip2 eventfd faad ffmpeg flac glib icu id3tag inotify ipv6 jack lame libsamplerate mad mikmod modplug mpg123 musepack network ogg opus samba signalfd sndfile twolame unicode vorbis wavpack wildmidi zlib -adplug -ao -cdio -curl -debug -expat -fifo -fluidsynth -gme -libav -libmpdclient -libsoxr -mms -nfs -openal -oss -pipe (-pulseaudio) -recorder -selinux -sid -soundcloud -sqlite (-systemd) -tcpd -upnp -zeroconf -zip" ABI_X86="64"
LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -L/usr/lib64/sidplay/builders"
Comment 1 razamatan 2017-02-21 18:21:56 UTC
any updates on this compilation issue?
Comment 2 razamatan 2017-02-28 06:41:57 UTC
bah... i got tired of waiting and i looked into this a bit.

the error is not coming from mpd's source, but from gcc.  specifically, /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4/include/g++-v4/bits/nested_exception.h

i have gcc-4.9.4, as does the original reporter.

this was a known upstream bug awhile back:

http://stackoverflow.com/questions/25324262/stdthrow-with-nested-expects-polymorphic-type-in-c11
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62154

i dunno what's going on at this point.. :|  it should be fixed by 4.9.4.

is there a way to get some gcc experts who knows the state of this class in here?
Comment 3 razamatan 2017-02-28 07:29:48 UTC
in CommandError.cxx:144, the issue is ep is an exception_ptr, and gcc's rethrow_if_nested call needs an exception by reference (afaict).

based on my reading of the c++11 docs, i think a quick workaround is to change L144's rethrow_if_nested(ep) to simply rethrow_exception(ep) to be safe (if you wanted to fly blind, just comment out the throw).

ymmv.  this is my understanding debugging this thing for the last 50m...
Comment 4 razamatan 2017-02-28 07:45:22 UTC
for those of you following along at home.  i compiled and things seem fine... :)

# mpd-0.20.4 $ diff -u src/command/CommandError.cxx.bak src/command/CommandError.cxx
--- src/command/CommandError.cxx.bak    2017-02-27 22:31:34.034062016 -0800
+++ src/command/CommandError.cxx        2017-02-27 23:25:45.508485479 -0800
@@ -111,7 +111,7 @@
                           rethrow_exception(exception_ptr) */
                        std::rethrow_if_nested(e);
 #else
-                       std::rethrow_if_nested(ep);
+                       std::rethrow_exception(ep);
 #endif
                        return ACK_ERROR_UNKNOWN;
                } catch (...) {
Comment 5 razamatan 2017-02-28 07:47:29 UTC
i'll propose my workaround as a solution to upstream in their bug:

https://bugs.musicpd.org/view.php?id=4657
Comment 6 razamatan 2017-02-28 08:48:09 UTC
DO NOT USE THE PATCH I SUGGESTED!!!

from upstream bug:

cirrus	(administrator)
2017-02-28 09:17
This patch compiles, build will lead to an endless loop at runtime, if this code path ever gets executed!

DO NOT USE THIS PATCH!

Thanks for pointing to this - if I ever get a freeze bug report from a Gentoo user, I'll know why.
Comment 7 razamatan 2017-03-01 18:39:03 UTC
upstream bug is fixed at head (will come out at 0.20.6).  for now, here's the commit/patch:

http://git.musicpd.org/cgit/master/mpd.git/commit/?id=e22a4fdba4fe06e3595145d75b31a81c3ce22a23

can we put this as a patch for 0.20.4 and 0.20.5?
Comment 8 cruzki 2017-04-15 14:49:24 UTC
Just renaming the ebuild to mpd-0.20.6 work for me.
Comment 9 Tim Harder gentoo-dev 2017-04-26 05:34:01 UTC
Fixed with 0.20.6 in the tree.