Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On pagecache.cc, boost::addressof() fails to compile on gcc 5.1.1 #632

Closed
syuu1228 opened this issue May 26, 2015 · 6 comments
Closed

On pagecache.cc, boost::addressof() fails to compile on gcc 5.1.1 #632

syuu1228 opened this issue May 26, 2015 · 6 comments

Comments

@syuu1228
Copy link
Contributor

It seems boost library bug.
ticket: https://svn.boost.org/trac/boost/ticket/5487
commit: boostorg/core@779e2b3
patch: https://github.com/boostorg/core/commit/779e2b30def02f414906a02f0b6c12ff97ca5efb.patch

I confirmed that it able to compile with the patch.
The commit seems included on boost 1.56 or later, so we probably should update boost version.
Or we also can apply the patch on misc.bin repository (that's what I tested).

Console output attached.

In file included from external/x64/misc.bin/usr/include/boost/variant/get.hpp:21:0,
                 from external/x64/misc.bin/usr/include/boost/variant.hpp:22,
                 from core/pagecache.cc:13:
external/x64/misc.bin/usr/include/boost/utility/addressof.hpp: In instantiation of 'T* boost::addressof(T&) [with T = std::nullptr_t]':
external/x64/misc.bin/usr/include/boost/variant/get.hpp:85:32:   required from 'boost::detail::variant::get_visitor<T>::pointer boost::detail::variant::get_visitor<T>::operator()(boost::detail::variant::get_visitor<T>::reference) const [with T = std::nullptr_t; boost::detail::variant::get_visitor<T>::pointer = std::nullptr_t*; boost::detail::variant::get_visitor<T>::reference = std::nullptr_t&]'
external/x64/misc.bin/usr/include/boost/variant/variant.hpp:1048:24:   required from 'boost::detail::variant::invoke_visitor<Visitor>::result_type boost::detail::variant::invoke_visitor<Visitor>::internal_visit(T&, int) [with T = std::nullptr_t; Visitor = boost::detail::variant::get_visitor<std::nullptr_t>; boost::detail::variant::invoke_visitor<Visitor>::result_type = std::nullptr_t*]'
external/x64/misc.bin/usr/include/boost/variant/detail/visitation_impl.hpp:130:9:   required from 'typename Visitor::result_type boost::detail::variant::visitation_impl_invoke_impl(int, Visitor&, VoidPtrCV, T*, mpl_::true_) [with Visitor = boost::detail::variant::invoke_visitor<boost::detail::variant::get_visitor<std::nullptr_t> >; VoidPtrCV = void*; T = std::nullptr_t; typename Visitor::result_type = std::nullptr_t*; mpl_::true_ = mpl_::bool_<true>]'
external/x64/misc.bin/usr/include/boost/variant/detail/visitation_impl.hpp:170:41:   required from 'typename Visitor::result_type boost::detail::variant::visitation_impl_invoke(int, Visitor&, VoidPtrCV, T*, NoBackupFlag, int) [with Visitor = boost::detail::variant::invoke_visitor<boost::detail::variant::get_visitor<std::nullptr_t> >; VoidPtrCV = void*; T = std::nullptr_t; NoBackupFlag = boost::variant<std::nullptr_t, mmu::hw_ptep<0>, std::unique_ptr<std::unordered_set<mmu::hw_ptep<0> > > >::has_fallback_type_; typename Visitor::result_type = std::nullptr_t*]'
external/x64/misc.bin/usr/include/boost/variant/detail/visitation_impl.hpp:256:63:   required from 'typename Visitor::result_type boost::detail::variant::visitation_impl(int, int, Visitor&, VoidPtrCV, mpl_::false_, NoBackupFlag, Which*, step0*) [with Which = mpl_::int_<0>; step0 = boost::detail::variant::visitation_impl_step<boost::mpl::l_iter<boost::mpl::l_item<mpl_::long_<3l>, std::nullptr_t, boost::mpl::l_item<mpl_::long_<2l>, mmu::hw_ptep<0>, boost::mpl::l_item<mpl_::long_<1l>, std::unique_ptr<std::unordered_set<mmu::hw_ptep<0> > >, boost::mpl::l_end> > > >, boost::mpl::l_iter<boost::mpl::l_end> >; Visitor = boost::detail::variant::invoke_visitor<boost::detail::variant::get_visitor<std::nullptr_t> >; VoidPtrCV = void*; NoBackupFlag = boost::variant<std::nullptr_t, mmu::hw_ptep<0>, std::unique_ptr<std::unordered_set<mmu::hw_ptep<0> > > >::has_fallback_type_; typename Visitor::result_type = std::nullptr_t*; mpl_::false_ = mpl_::bool_<false>]'
external/x64/misc.bin/usr/include/boost/variant/variant.hpp:2362:48:   required from 'static typename Visitor::result_type boost::variant<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>::internal_apply_visitor_impl(int, int, Visitor&, VoidPtrCV) [with Visitor = boost::detail::variant::invoke_visitor<boost::detail::variant::get_visitor<std::nullptr_t> >; VoidPtrCV = void*; T0_ = std::nullptr_t; T1 = mmu::hw_ptep<0>; T2 = std::unique_ptr<std::unordered_set<mmu::hw_ptep<0> > >; 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 Visitor::result_type = std::nullptr_t*]'
external/x64/misc.bin/usr/include/boost/variant/variant.hpp:2376:43:   required from 'typename Visitor::result_type boost::variant<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>::internal_apply_visitor(Visitor&) [with Visitor = boost::detail::variant::invoke_visitor<boost::detail::variant::get_visitor<std::nullptr_t> >; T0_ = std::nullptr_t; T1 = mmu::hw_ptep<0>; T2 = std::unique_ptr<std::unordered_set<mmu::hw_ptep<0> > >; 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 Visitor::result_type = std::nullptr_t*]'
external/x64/misc.bin/usr/include/boost/variant/variant.hpp:2401:52:   required from 'typename Visitor::result_type boost::variant<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>::apply_visitor(Visitor&) [with Visitor = boost::detail::variant::get_visitor<std::nullptr_t>; T0_ = std::nullptr_t; T1 = mmu::hw_ptep<0>; T2 = std::unique_ptr<std::unordered_set<mmu::hw_ptep<0> > >; 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 Visitor::result_type = std::nullptr_t*]'
external/x64/misc.bin/usr/include/boost/variant/get.hpp:151:36:   required from 'typename boost::add_pointer<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 = std::nullptr_t; T0 = std::nullptr_t; T1 = mmu::hw_ptep<0>; T2 = std::unique_ptr<std::unordered_set<mmu::hw_ptep<0> > >; 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_pointer<T>::type = std::nullptr_t*]'
external/x64/misc.bin/usr/include/boost/variant/get.hpp:178:26:   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 = std::nullptr_t; T0 = std::nullptr_t; T1 = mmu::hw_ptep<0>; T2 = std::unique_ptr<std::unordered_set<mmu::hw_ptep<0> > >; 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 = std::nullptr_t&]'
core/pagecache.cc:225:40:   required from here
external/x64/misc.bin/usr/include/boost/utility/addressof.hpp:59:47: error: call of overloaded 'f(boost::detail::addr_impl_ref<std::nullptr_t>, int)' is ambiguous
     return boost::detail::addressof_impl<T>::f( boost::detail::addr_impl_ref<T>( v ), 0 );
                                               ^
external/x64/misc.bin/usr/include/boost/utility/addressof.hpp:37:23: note: candidate: static T* boost::detail::addressof_impl<T>::f(T&, long int) [with T = std::nullptr_t]
     static inline T * f( T & v, long )
                       ^
external/x64/misc.bin/usr/include/boost/utility/addressof.hpp:43:23: note: candidate: static T* boost::detail::addressof_impl<T>::f(T*, int) [with T = std::nullptr_t]
     static inline T * f( T * v, int )
                       ^
Makefile:323: recipe for target 'build/release.x64/core/pagecache.o' failed
make: *** [build/release.x64/core/pagecache.o] Error 1
@giannivh
Copy link

I can confirm this. The build fails with the exact same message stated above.

Patching it manually seems to fix the issue. Maybe it's time for a version bump of boost in misc.bin?

@nyh
Copy link
Contributor

nyh commented May 27, 2015

Itaru Kitayama reported the same problem back in April, and Gleb discovered it was probably solved by updating to Boost 1.56: see discussion in https://groups.google.com/forum/#!topic/osv-dev/ZegZnCBtZTY

I don't know what to suggest... Updating external/ to Boost 1.56 means updating the basis of our "external" directory to Fedora 22, which just came out a few days ago, and likely to only work correctly with the gcc in that distro (gcc 5.1). I doubt this is a good idea.

One solution I think we need to seriously consider not to use external/, which was a good idea ("make builds repeatable") but has proven to be unmaintainable, as more and more stuff (more importantly - the compiler itself) is taken from the host and doesn't work together with what we put in external/.
Not using external/ is already more-or-less our default, and if we have bugs in that (see issue #633) we need to fix those.

Another option that doesn't make me happy at all, but is possible, is to have multiple versions in external/: We'll have boost 1.55 from Fedora 21 for hosts with gcc 4.9, and boost 1.56 from Fedora 22 for hosts with gcc 5.1.

@nyh
Copy link
Contributor

nyh commented May 27, 2015

I just posted to the OSv mailing list a patch for issue #633. After this patch, the OSv build should by default (boost_env=host is the default) take the Boost headers installed on the build machine, not from the "external/" directory. On systems which have gcc 5.1, the installed boost will surely be >= 1.56, so this bug should no longer occur.

Can someone who can reproduce this bug please check if my patch for issue #633 also fixes this bug (when boost_env=external is not used)?

@nyh
Copy link
Contributor

nyh commented May 28, 2015

This issue was fixed by the fix to #633, when boost_env=host (the default) is used.
So perhaps we should close this issue.
We can perhaps move its discussion to #619 (which talks about the sad state that "make build_env=external" is in).

@nyh
Copy link
Contributor

nyh commented Jun 2, 2015

Takuya, should we close this issue?

@nyh
Copy link
Contributor

nyh commented Sep 29, 2015

Ping on the question if we can close this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants