Skip to content

Compile error with Kea 1.8.0 in lease_mgr.cc #1

@djlambert

Description

@djlambert

The module is failing compilation in lease_mgr.cc with Python 3.9 and Kea 1.8.0 under Ubuntu 21.04 on aarch64:

admin@h-tst-smbdc-01:~/src/kea_python/keamodule$ python3 setup.py install
running install
running build
running build_ext
building 'kea' extension
aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-a27J0m/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-a27J0m/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DHAVE_GETLEASES4_HOSTNAME -I/usr/include/kea -I/usr/include/python3.9 -c callout_closure.cc -o build/temp.linux-aarch64-3.9/callout_closure.o
aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-a27J0m/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-a27J0m/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DHAVE_GETLEASES4_HOSTNAME -I/usr/include/kea -I/usr/include/python3.9 -c callout_handle.cc -o build/temp.linux-aarch64-3.9/callout_handle.o
aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-a27J0m/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-a27J0m/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DHAVE_GETLEASES4_HOSTNAME -I/usr/include/kea -I/usr/include/python3.9 -c callout_manager.cc -o build/temp.linux-aarch64-3.9/callout_manager.o
aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-a27J0m/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-a27J0m/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DHAVE_GETLEASES4_HOSTNAME -I/usr/include/kea -I/usr/include/python3.9 -c callouts.cc -o build/temp.linux-aarch64-3.9/callouts.o
aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-a27J0m/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-a27J0m/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DHAVE_GETLEASES4_HOSTNAME -I/usr/include/kea -I/usr/include/python3.9 -c capsule.cc -o build/temp.linux-aarch64-3.9/capsule.o
aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-a27J0m/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-a27J0m/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DHAVE_GETLEASES4_HOSTNAME -I/usr/include/kea -I/usr/include/python3.9 -c cfg_mgr.cc -o build/temp.linux-aarch64-3.9/cfg_mgr.o
aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-a27J0m/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-a27J0m/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DHAVE_GETLEASES4_HOSTNAME -I/usr/include/kea -I/usr/include/python3.9 -c cfg_subnets4.cc -o build/temp.linux-aarch64-3.9/cfg_subnets4.o
cfg_subnets4.cc: In function ‘PyObject* CfgSubnets4_from_ptr(isc::dhcp::CfgSubnets4Ptr&)’:
cfg_subnets4.cc:181:49: warning: ‘void* memset(void*, int, size_t)’ clearing an object of type ‘isc::dhcp::CfgSubnets4Ptr’ {aka ‘class boost::shared_ptr<isc::dhcp::CfgSubnets4>’} with no trivial copy-assignment; use assignment or value-initialization instead [-Wclass-memaccess]
  181 |         memset(&self->ptr, 0 , sizeof(self->ptr));
      |                                                 ^
In file included from /usr/include/boost/shared_ptr.hpp:17,
                 from /usr/include/kea/cc/data.h:14,
                 from /usr/include/kea/hooks/library_handle.h:11,
                 from /usr/include/kea/hooks/callout_handle.h:11,
                 from /usr/include/kea/hooks/hooks.h:10,
                 from keamodule.h:3,
                 from cfg_subnets4.cc:1:
/usr/include/boost/smart_ptr/shared_ptr.hpp:335:25: note: ‘isc::dhcp::CfgSubnets4Ptr’ {aka ‘class boost::shared_ptr<isc::dhcp::CfgSubnets4>’} declared here
  335 | template<class T> class shared_ptr
      |                         ^~~~~~~~~~
aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-a27J0m/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-a27J0m/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DHAVE_GETLEASES4_HOSTNAME -I/usr/include/kea -I/usr/include/python3.9 -c constants.cc -o build/temp.linux-aarch64-3.9/constants.o
aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-a27J0m/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-a27J0m/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DHAVE_GETLEASES4_HOSTNAME -I/usr/include/kea -I/usr/include/python3.9 -c errors.cc -o build/temp.linux-aarch64-3.9/errors.o
aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-a27J0m/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-a27J0m/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DHAVE_GETLEASES4_HOSTNAME -I/usr/include/kea -I/usr/include/python3.9 -c kea.cc -o build/temp.linux-aarch64-3.9/kea.o
aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-a27J0m/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-a27J0m/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DHAVE_GETLEASES4_HOSTNAME -I/usr/include/kea -I/usr/include/python3.9 -c lease4.cc -o build/temp.linux-aarch64-3.9/lease4.o
lease4.cc: In function ‘PyObject* Lease4_from_handle(isc::dhcp::Lease4Ptr&)’:
lease4.cc:452:49: warning: ‘void* memset(void*, int, size_t)’ clearing an object of type ‘isc::dhcp::Lease4Ptr’ {aka ‘class boost::shared_ptr<isc::dhcp::Lease4>’} with no trivial copy-assignment; use assignment or value-initialization instead [-Wclass-memaccess]
  452 |         memset(&self->ptr, 0 , sizeof(self->ptr));
      |                                                 ^
In file included from /usr/include/boost/shared_ptr.hpp:17,
                 from /usr/include/kea/cc/data.h:14,
                 from /usr/include/kea/hooks/library_handle.h:11,
                 from /usr/include/kea/hooks/callout_handle.h:11,
                 from /usr/include/kea/hooks/hooks.h:10,
                 from keamodule.h:3,
                 from lease4.cc:1:
/usr/include/boost/smart_ptr/shared_ptr.hpp:335:25: note: ‘isc::dhcp::Lease4Ptr’ {aka ‘class boost::shared_ptr<isc::dhcp::Lease4>’} declared here
  335 | template<class T> class shared_ptr
      |                         ^~~~~~~~~~
aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-a27J0m/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-a27J0m/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DHAVE_GETLEASES4_HOSTNAME -I/usr/include/kea -I/usr/include/python3.9 -c lease_mgr.cc -o build/temp.linux-aarch64-3.9/lease_mgr.o
lease_mgr.cc: In function ‘PyObject* LeaseMgr_deleteLease(LeaseMgrObject*, PyObject*)’:
lease_mgr.cc:198:69: error: no matching function for call to ‘isc::dhcp::LeaseMgr::deleteLease(isc::asiolink::IOAddress)’
  198 |         bool result = self->mgr->deleteLease(IOAddress(string(addr)));
      |                                                                     ^
In file included from keamodule.h:9,
                 from lease_mgr.cc:1:
/usr/include/kea/dhcpsrv/lease_mgr.h:554:18: note: candidate: ‘virtual bool isc::dhcp::LeaseMgr::deleteLease(const Lease4Ptr&)’
  554 |     virtual bool deleteLease(const Lease4Ptr& lease) = 0;
      |                  ^~~~~~~~~~~
/usr/include/kea/dhcpsrv/lease_mgr.h:554:47: note:   no known conversion for argument 1 from ‘isc::asiolink::IOAddress’ to ‘const Lease4Ptr&’ {aka ‘const boost::shared_ptr<isc::dhcp::Lease4>&’}
  554 |     virtual bool deleteLease(const Lease4Ptr& lease) = 0;
      |                              ~~~~~~~~~~~~~~~~~^~~~~
/usr/include/kea/dhcpsrv/lease_mgr.h:564:18: note: candidate: ‘virtual bool isc::dhcp::LeaseMgr::deleteLease(const Lease6Ptr&)’
  564 |     virtual bool deleteLease(const Lease6Ptr& lease) = 0;
      |                  ^~~~~~~~~~~
/usr/include/kea/dhcpsrv/lease_mgr.h:564:47: note:   no known conversion for argument 1 from ‘isc::asiolink::IOAddress’ to ‘const Lease6Ptr&’ {aka ‘const boost::shared_ptr<isc::dhcp::Lease6>&’}
  564 |     virtual bool deleteLease(const Lease6Ptr& lease) = 0;
      |                              ~~~~~~~~~~~~~~~~~^~~~~
error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1

Very excited to get this working. My experience with C++ is close to zero, but I'm happy to provide additional information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions