Repository navigation
Closed
Description
Since 0.10 I've been seeing segfaults in Alpine Linux. I first checked the permissions were correctly set in ~/.bitcoin & set ~/.bitcoin/bitcoin.conf to chmod 0600 . This didn't make any difference, running bitcoind as a normal user still gave a segfault.
To trace the segfault with gdb I tried building with debug symbols included --enable-debug & this is the error thrown:
(with boost-1.58 & gcc-4.9.2 )
In file included from /usr/include/boost/move/detail/type_traits.hpp:34:0,
from /usr/include/boost/move/core.hpp:54,
from /usr/include/boost/move/utility_core.hpp:29,
from /usr/include/boost/move/utility.hpp:28,
from /usr/include/boost/thread/detail/move.hpp:27,
from /usr/include/boost/thread/lock_types.hpp:11,
from /usr/include/boost/thread/pthread/mutex.hpp:16,
from /usr/include/boost/thread/mutex.hpp:16,
from allocators.h:14,
from key.h:9,
from base58.h:18,
from rpcrawtransaction.cpp:7:
/usr/include/boost/variant/get.hpp: In instantiation of 'typename boost::add_reference<T>::type boost::strict_get(boost::variant<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>&) [with U = const CScriptID&; T0 = CNoDestination; T1 = CKeyID; T2 = CScriptID; T3 = boost::detail::variant::void_; T4 = boost::detail::variant::void_; T5 = boost::detail::variant::void_; T6 = boost::detail::variant::void_; T7 = boost::detail::variant::void_; T8 = boost::detail::variant::void_; T9 = boost::detail::variant::void_; T10 = boost::detail::variant::void_; T11 = boost::detail::variant::void_; T12 = boost::detail::variant::void_; T13 = boost::detail::variant::void_; T14 = boost::detail::variant::void_; T15 = boost::detail::variant::void_; T16 = boost::detail::variant::void_; T17 = boost::detail::variant::void_; T18 = boost::detail::variant::void_; T19 = boost::detail::variant::void_; typename boost::add_reference<T>::type = const CScriptID&]':
/usr/include/boost/variant/get.hpp:284:33: required from 'typename boost::add_reference<T>::type boost::get(boost::variant<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>&) [with U = const CScriptID&; T0 = CNoDestination; T1 = CKeyID; T2 = CScriptID; T3 = boost::detail::variant::void_; T4 = boost::detail::variant::void_; T5 = boost::detail::variant::void_; T6 = boost::detail::variant::void_; T7 = boost::detail::variant::void_; T8 = boost::detail::variant::void_; T9 = boost::detail::variant::void_; T10 = boost::detail::variant::void_; T11 = boost::detail::variant::void_; T12 = boost::detail::variant::void_; T13 = boost::detail::variant::void_; T14 = boost::detail::variant::void_; T15 = boost::detail::variant::void_; T16 = boost::detail::variant::void_; T17 = boost::detail::variant::void_; T18 = boost::detail::variant::void_; T19 = boost::detail::variant::void_; typename boost::add_reference<T>::type = const CScriptID&]'
rpcrawtransaction.cpp:291:77: required from here
/usr/include/boost/variant/get.hpp:178:5: error: invalid application of 'sizeof' to incomplete type 'boost::STATIC_ASSERTION_FAILURE<false>'
BOOST_STATIC_ASSERT_MSG(
^
Makefile:3654: recipe for target 'libbitcoin_server_a-rpcrawtransaction.o' failed
make[2]: *** [libbitcoin_server_a-rpcrawtransaction.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/home/stuart/aports/testing/bitcoin/src/bitcoin-0.10.1/src'
Makefile:6247: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/stuart/aports/testing/bitcoin/src/bitcoin-0.10.1/src'
Makefile:568: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
>>> ERROR: bitcoin: all failed
>>> bitcoin: Uninstalling dependencies...
Bitcoin builds successfully if I don't --enable-debug & set CXXFLAGS="$CXXFLAGS -DBOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT=1" (but still segfaults)
Metadata
Metadata
Assignees
Labels
No labels
Activity
theuni commentedon May 6, 2015
Ugh. Looks like #6076 has runtime implications as well. This is fixed in master.
@laanwj If we're going to do a quick follow-up release for #6093, It'd make sense to include this fix too.
theuni commentedon May 6, 2015
Mmm, I might've read a bit too quickly. @itoffshore could you please try cherry-picking 8b08d95 into 0.10, building without BOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT, and seeing if that fixes the crash?
itoffshore commentedon May 6, 2015
Yes building with the latest
master.zipwithout settingBOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULTworks without issue - many thx(it wasn't possible to cherry pick the patch as there is no
src/walletin0.10or0.10.1)theuni commentedon May 6, 2015
Thanks for testing. In 0.10, it's just src/rpcwallet.cpp. The change is trivial if you'd like to apply it by hand.
Probably safe to conclude that 8b08d95 is enough to fix the problem, though.
itoffshore commentedon May 6, 2015
I looked at
rpcwallet.cppbut it is completely different & did not have:const CScriptID& hash = boost::get<const CScriptID&>(address);to patchtheuni commentedon May 6, 2015
@itoffshore I went ahead and PR'd the backport as #6114. Thank you very much for reporting the issue and testing.
itoffshore commentedon May 6, 2015
@theuni - yes #6114 works with 0.10.1 - many thx
wallet: fix boost::get usage with boost 1.58
Fix boost 1.58 compilation
Fix boost 1.58 compilation
GameKyuubi commentedon Feb 17, 2017
Getting this when building on 16.04.
lacksfish commentedon Apr 30, 2017
Have a look at
and search for this line
const CScriptID& hash = boost::get<const CScriptID&>(address);It should work after changed to
const CScriptID& hash = boost::get<CScriptID>(address);as seen in 8b08d95.
aatheus commentedon May 18, 2017
Thank you lacksfish ! This is also impacting devcoin and making the change resolved my build issue as well.
wallet: fix boost::get usage with boost 1.58
Fix boost::get build error on Ubuntu 16.04
Merge pull request #4 from recklessop/ubuntufix
Update rpcrawtransaction.cpp
Fix build on Ubuntu 16.04 (boost > 1.57)
Update rpcrawtransaction.cpp
Update rpcrawtransaction.cpp (#24)
Update rpcrawtransaction.cpp (primecoin#24)