Skip to content

invalid application of 'sizeof' to incomplete type 'boost::STATIC_ASSERTION_FAILURE<false> #6113

Closed

Description

@itoffshore

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)

Activity

  1. theuni commented on May 6, 2015

    @theuni
    Member

    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.

  2. theuni commented on May 6, 2015

    @theuni
    Member

    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?

  3. itoffshore commented on May 6, 2015

    @itoffshore
    ContributorAuthor

    Yes building with the latest master.zip without setting BOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT works without issue - many thx

    (it wasn't possible to cherry pick the patch as there is no src/wallet in 0.10 or0.10.1)

  4. theuni commented on May 6, 2015

    @theuni
    Member

    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.

  5. itoffshore commented on May 6, 2015

    @itoffshore
    ContributorAuthor

    I looked at rpcwallet.cpp but it is completely different & did not have:
    const CScriptID& hash = boost::get<const CScriptID&>(address); to patch

  6. theuni commented on May 6, 2015

    @theuni
    Member

    @itoffshore I went ahead and PR'd the backport as #6114. Thank you very much for reporting the issue and testing.

  7. itoffshore commented on May 6, 2015

    @itoffshore
    ContributorAuthor

    @theuni - yes #6114 works with 0.10.1 - many thx

  8. GameKyuubi commented on Feb 17, 2017

    @GameKyuubi

    Getting this when building on 16.04.

  9. lacksfish commented on Apr 30, 2017

    @lacksfish

    Have a look at

    rpcrawtransaction.cpp

    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.

  10. aatheus commented on May 18, 2017

    @aatheus

    Thank you lacksfish ! This is also impacting devcoin and making the change resolved my build issue as well.

  11. added a commit that references this issue on Dec 12, 2017
  12. added a commit that references this issue on Dec 17, 2017
  13. added a commit that references this issue on Jan 20, 2018
  14. added a commit that references this issue on Jul 9, 2018
  15. added a commit that references this issue on Jan 6, 2019
  16. locked as resolved and limited conversation to collaborators on Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions