Summary: | 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) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Jeroen Roovers (RETIRED) <jer> |
Component: | Current packages | Assignee: | Markos Chandras (RETIRED) <hwoarang> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | andrewjeddeloh+gentoo, cruzki123, marduk, razamatan, sound |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.musicpd.org/view.php?id=4657 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | media-sound:mpd-0.20.4:20170217-062727.log |
Description
Jeroen Roovers (RETIRED)
2017-02-17 09:29:40 UTC
any updates on this compilation issue? 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? 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... 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 (...) { i'll propose my workaround as a solution to upstream in their bug: https://bugs.musicpd.org/view.php?id=4657 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. 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? Just renaming the ebuild to mpd-0.20.6 work for me. Fixed with 0.20.6 in the tree. |