Skip to content

1.2.1: Compilation error #400

@0-wiz-0

Description

@0-wiz-0

When building the wheel on NetBSD/amd64 with gcc 12.4.0, Python 3.12.4, pybind11-2.13.1, and numpy 1.26.4, I see

In file included from /usr/include/g++/bits/forward_list.h:38,
                 from /usr/include/g++/forward_list:38,
                 from /scratch/graphics/py-contourpy/work/.buildlink/lib/python3.12/site-packages/pybind11/include/pybind11/detail/../detail/common.h:317,
                 from /scratch/graphics/py-contourpy/work/.buildlink/lib/python3.12/site-packages/pybind11/include/pybind11/detail/../attr.h:13,
                 from /scratch/graphics/py-contourpy/work/.buildlink/lib/python3.12/site-packages/pybind11/include/pybind11/detail/class.h:12,
                 from /scratch/graphics/py-contourpy/work/.buildlink/lib/python3.12/site-packages/pybind11/include/pybind11/pybind11.h:13,
                 from ../src/common.h:4,
                 from ../src/output_array.h:4,
                 from ../src/chunk_local.h:4,
                 from ../src/base.h:13,
                 from ../src/base_impl.h:4,
                 from ../src/wrap.cpp:1:
In static member function 'static _Up* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(_Tp*, _Tp*, _Up*) [with _Tp = pybind11::detail::type_info* const; _Up = pybind11::detail::type_info*; bool _IsMove = false]',
    inlined from '_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = pybind11::detail::type_info* const*; _OI = pybind11::detail::type_info**]' at /usr/include/g++/bits/stl_algobase.h:501:30,
    inlined from '_OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = pybind11::detail::type_info* const*; _OI = pybind11::detail::type_info**]' at /usr/include/g++/bits/stl_algobase.h:528:42,
    inlined from '_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = pybind11::detail::type_info* const*; _OI = pybind11::detail::type_info**]' at /usr/include/g++/bits/stl_algobase.h:535:31,
    inlined from '_OI std::copy(_II, _II, _OI) [with _II = pybind11::detail::type_info* const*; _OI = pybind11::detail::type_info**]' at /usr/include/g++/bits/stl_algobase.h:626:7,
    inlined from 'static _ForwardIterator std::__uninitialized_copy<true>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = pybind11::detail::type_info* const*; _ForwardIterator = pybind11::detail::type_info**]' at /usr/include/g++/bits/stl_uninitialized.h:147:27,
    inlined from '_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = pybind11::detail::type_info* const*; _ForwardIterator = pybind11::detail::type_info**]' at /usr/include/g++/bits/stl_uninitialized.h:185:15,
    inlined from '_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, allocator<_Tp>&) [with _InputIterator = pybind11::detail::type_info* const*; _ForwardIterator = pybind11::detail::type_info**; _Tp = pybind11::detail::type_info*]' at /usr/include/g++/bits/stl_uninitialized.h:372:37,
    inlined from 'void std::vector<_Tp, _Alloc>::_M_assign_aux(_ForwardIterator, _ForwardIterator, std::forward_iterator_tag) [with _ForwardIterator = pybind11::detail::type_info* const*; _Tp = pybind11::detail::type_info*; _Alloc = std::allocator<pybind11::detail::type_info*>]' at /usr/include/g++/bits/vector.tcc:339:35,
    inlined from 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = pybind11::detail::type_info*; _Alloc = std::allocator<pybind11::detail::type_info*>]' at /usr/include/g++/bits/stl_vector.h:787:21,
    inlined from 'pybind11::detail::generic_type::initialize(const pybind11::detail::type_record&)::<lambda(pybind11::detail::internals&)>' at /scratch/graphics/py-contourpy/work/.buildlink/lib/python3.12/site-packages/pybind11/include/pybind11/pybind11.h:1434:75,
    inlined from 'decltype (cb(pybind11::detail::get_internals())) pybind11::detail::with_internals(const F&) [with F = generic_type::initialize(const pybind11::detail::type_record&)::<lambda(internals&)>]' at /scratch/graphics/py-contourpy/work/.buildlink/lib/python3.12/site-packages/pybind11/include/pybind11/detail/../detail/internals.h:626:14,
    inlined from 'void pybind11::detail::generic_type::initialize(const pybind11::detail::type_record&)' at /scratch/graphics/py-contourpy/work/.buildlink/lib/python3.12/site-packages/pybind11/include/pybind11/pybind11.h:1426:23:
/usr/include/g++/bits/stl_algobase.h:434:30: error: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' forming offset 8 is out of the bounds [0, 8] of object '<anonymous>' with type 'pybind11::detail::type_info* const [1]' [-Werror=array-bounds]
  434 |             __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
      |             ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/scratch/graphics/py-contourpy/work/.buildlink/lib/python3.12/site-packages/pybind11/include/pybind11/pybind11.h: In member function 'void pybind11::detail::generic_type::initialize(const pybind11::detail::type_record&)':
/scratch/graphics/py-contourpy/work/.buildlink/lib/python3.12/site-packages/pybind11/include/pybind11/pybind11.h:1434:75: note: '<anonymous>' declared here
 1434 |             internals.registered_types_py[(PyTypeObject *) m_ptr] = {tinfo};
      |                                                                           ^
cc1plus: all warnings being treated as errors
ninja: build stopped: subcommand failed.

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