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

issue itoffshore opened this issue on May 6, 2015
  1. itoffshore commented at 4:27 PM on May 6, 2015: contributor

    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)

  2. theuni commented at 4:34 PM on May 6, 2015: 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.

  3. theuni commented at 4:37 PM on May 6, 2015: member

    Mmm, I might've read a bit too quickly. @itoffshore could you please try cherry-picking 8b08d9530b93c7a98e7387167ecd2cd5b0563bfb into 0.10, building without BOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT, and seeing if that fixes the crash?

  4. itoffshore commented at 8:01 PM on May 6, 2015: contributor

    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)

  5. theuni commented at 8:07 PM on May 6, 2015: 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 https://github.com/bitcoin/bitcoin/commit/8b08d9530b93c7a98e7387167ecd2cd5b0563bfb is enough to fix the problem, though.

  6. itoffshore commented at 8:47 PM on May 6, 2015: contributor

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

  7. theuni cross-referenced this on May 6, 2015 from issue wallet: fix boost::get usage with boost 1.58 by theuni
  8. theuni commented at 8:57 PM on May 6, 2015: member

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

  9. itoffshore commented at 9:56 PM on May 6, 2015: contributor

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

  10. itoffshore cross-referenced this on May 6, 2015 from issue Locale should default to C / Posix Environment by itoffshore
  11. UdjinM6 cross-referenced this on May 8, 2015 from issue Fix boost::get build error on ArchLinux by UdjinM6
  12. laanwj closed this on May 10, 2015

  13. bitspill referenced this in commit 5450b7fbeb on Nov 1, 2015
  14. icook referenced this in commit 40ddb16a05 on Jan 5, 2016
  15. icook referenced this in commit 2d64d30daa on Jan 5, 2016
  16. icook cross-referenced this on Jan 5, 2016 from issue Fix boost 1.58 compilation by icook
  17. tigusoft-vm referenced this in commit 1e72f7eaa0 on Jan 13, 2016
  18. tigusoft-vm referenced this in commit cc80513f0f on Jan 13, 2016
  19. felixbrucker cross-referenced this on Nov 16, 2016 from issue [BUG] make fails with boost 1.58 by felixbrucker
  20. GameKyuubi commented at 1:06 PM on February 17, 2017: none

    Getting this when building on 16.04.

  21. lacksfish commented at 2:06 PM on April 30, 2017: none

    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.

  22. aatheus commented at 10:54 PM on May 18, 2017: none

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

  23. iamunick referenced this in commit e4ad4ec902 on Aug 11, 2017
  24. iamunick cross-referenced this on Aug 11, 2017 from issue wallet: fix boost::get usage with boost 1.58 by iamunick
  25. Jumballaya cross-referenced this on Oct 20, 2017 from issue Boost error while building by Jumballaya
  26. unknown cross-referenced this on Nov 23, 2017 from issue Fix boost 1.58 compilation by ghost
  27. JokerCatz cross-referenced this on Nov 24, 2017 from issue invalid application of 'sizeof' to incomplete type 'boost::STATIC_ASSERTION_FAILURE<false> by JokerCatz
  28. ik11235 referenced this in commit 7bc7b9fb6b on Dec 10, 2017
  29. ik11235 cross-referenced this on Dec 10, 2017 from issue Fix boost::get build error on Ubuntu 16.04 by ik11235
  30. recklessop cross-referenced this on Dec 12, 2017 from issue Updated rpcrawtransactions.cpp by recklessop
  31. campuscoindev referenced this in commit 97bcf200e2 on Dec 12, 2017
  32. nuggetbram referenced this in commit 81719b0714 on Dec 17, 2017
  33. nuggetbram cross-referenced this on Dec 17, 2017 from issue Update rpcrawtransaction.cpp by nuggetbram
  34. pelletiermaxime referenced this in commit c68d98eb06 on Jan 4, 2018
  35. pelletiermaxime cross-referenced this on Jan 4, 2018 from issue Fix build on Ubuntu 16.04 (boost > 1.57) by pelletiermaxime
  36. OracolXor referenced this in commit 148c80a843 on Jan 20, 2018
  37. jegb cross-referenced this on Jan 21, 2018 from issue rock64 update by jegb
  38. unknown cross-referenced this on Jan 23, 2018 from issue Fixed the constant pointer, resolves build error: /usr/include/boost/… by ghost
  39. sunnyking referenced this in commit 474dd8c712 on Jul 9, 2018
  40. mhirki referenced this in commit c2a47c3849 on Jan 6, 2019
  41. bitcoin locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:55 UTC