Opened 6 months ago

Closed 3 weeks ago

#5450 closed defect (fixed)

flex_id tests includes the module

Reported by: fdupont Owned by: fdupont
Priority: low Milestone: Kea1.4-final
Component: Unclassified Version: git
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DHCP Feature Depending on Ticket:
Estimated Difficulty: 0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

It is incorrect and gives warnings like:

  CXXLD    flex_id_unittests

*** Warning: Linking the executable flex_id_unittests against the loadable module
*** libdhcp_flex_id.so is not portable!
*** Warning: lib libdhcp_flex_id.so is a module, not a shared library

I propose to fix the makefile and to check if tests still pass.

Subtickets

Change History (12)

comment:1 Changed 6 months ago by fdupont

  • Milestone changed from Kea-proposed to Kea1.4-final

comment:2 Changed 6 months ago by fdupont

  • Owner set to fdupont
  • Status changed from new to accepted

I have a current work on premium so I'll check if it still works when fixed.

comment:3 Changed 6 months ago by fdupont

Replacing the .so by the convenience archive (*) it continues to work and no longer raise a warning.
(*) the fact some tests use hook codes outside the hook mechanism (i.e. load DSO) is arguable but it is another issue.

Included in trac5420 in 9693e6a13a..9db57ed9d8.

comment:4 Changed 4 months ago by fdupont

  • Owner changed from fdupont to UnAssigned
  • Status changed from accepted to reviewing

Branch created for premium submodule.
Ready for review.

comment:5 follow-up: Changed 4 weeks ago by tmark

  • Owner changed from UnAssigned to fdupont

I built this on Ubuntu 16.04 and the warning is still there:

mv -f .deps/flex_id_unittests-load_unload_unittests.Tpo .deps/flex_id_unittests-load_unload_unittests.Po
/bin/bash ../../../../../../libtool --tag=CXX --mode=link g++ --std=c++11 -Wno-unused-variable -Wall -Wextra -Wnon-virtual-dtor -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -pthread -Wno-missing-field-initializers -fPIC -g -O2 -L/opt/botan/Botan-2.3.0/local/lib -Wl,-R/opt/botan/Botan-2.3.0/local/lib -lpthread -o flex_id_unittests flex_id_unittests-run_unittests.o flex_id_unittests-callout_unittests.o flex_id_unittests-load_unload_unittests.o ../../../../../../premium/src/hooks/dhcp/flex_id/libdhcp_flex_id.la ../../../../../../src/lib/eval/libkea-eval.la ../../../../../../src/lib/dhcpsrv/libkea-dhcpsrv.la ../../../../../../src/lib/dhcp/libkea-dhcp++.la ../../../../../../src/lib/asiolink/libkea-asiolink.la ../../../../../../src/lib/cc/libkea-cc.la ../../../../../../src/lib/hooks/libkea-hooks.la ../../../../../../src/lib/log/libkea-log.la ../../../../../../src/lib/util/libkea-util.la ../../../../../../src/lib/exceptions/libkea-exceptions.la -L/opt/log4cplus/log4cplus-1.2.1-rc2/local/lib -llog4cplus -L/opt/botan/Botan-2.3.0/local/lib -lbotan-2 -fstack-protector -m64 -pthread -lbotan-2 -L/opt/boost/boost_1_63_0/stage/lib -lboost_system ../../../../../../ext/gtest/libgtest.a -ldl

* Warning: Linking the executable flex_id_unittests against the loadable module
* libdhcp_flex_id.so is not portable!

comment:6 in reply to: ↑ 5 Changed 4 weeks ago by fdupont

  • Owner changed from fdupont to tmark

Replying to tmark:

I built this on Ubuntu 16.04 and the warning is still there:

mv -f .deps/flex_id_unittests-load_unload_unittests.Tpo .deps/flex_id_unittests-load_unload_unittests.Po
/bin/bash ../../../../../../libtool --tag=CXX --mode=link g++ --std=c++11 -Wno-unused-variable -Wall -Wextra -Wnon-virtual-dtor -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -pthread -Wno-missing-field-initializers -fPIC -g -O2 -L/opt/botan/Botan-2.3.0/local/lib -Wl,-R/opt/botan/Botan-2.3.0/local/lib -lpthread -o flex_id_unittests flex_id_unittests-run_unittests.o flex_id_unittests-callout_unittests.o flex_id_unittests-load_unload_unittests.o ../../../../../../premium/src/hooks/dhcp/flex_id/libdhcp_flex_id.la ../../../../../../src/lib/eval/libkea-eval.la ../../../../../../src/lib/dhcpsrv/libkea-dhcpsrv.la ../../../../../../src/lib/dhcp/libkea-dhcp++.la ../../../../../../src/lib/asiolink/libkea-asiolink.la ../../../../../../src/lib/cc/libkea-cc.la ../../../../../../src/lib/hooks/libkea-hooks.la ../../../../../../src/lib/log/libkea-log.la ../../../../../../src/lib/util/libkea-util.la ../../../../../../src/lib/exceptions/libkea-exceptions.la -L/opt/log4cplus/log4cplus-1.2.1-rc2/local/lib -llog4cplus -L/opt/botan/Botan-2.3.0/local/lib -lbotan-2 -fstack-protector -m64 -pthread -lbotan-2 -L/opt/boost/boost_1_63_0/stage/lib -lboost_system ../../../../../../ext/gtest/libgtest.a -ldl

* Warning: Linking the executable flex_id_unittests against the loadable module
* libdhcp_flex_id.so is not portable!

=> your log shows libdhcp_flex_id.la instead of libflexid.la so the trac5450 premium branch was not applied.
Note it was removed from #5420 before merge so the one line fix is not (yet!) in master.

comment:7 Changed 4 weeks ago by tmark

  • Owner changed from tmark to fdupont

Francis, I am confused. I verified that my pull of premium trac5450 is up to date and the link warning is still present (see output below).

IF premium branch trac5450 IS not the correct code to be reviewing then what is?

Output from git log in premium trac5450 branch:

tmark@wild-dog premium (trac5450) $ git log | head -n 20
commit 1a9ffcc95ed09723794b21f016d7a3c97b321245
Author: Francis Dupont <fdupont@isc.org>
Date:   Mon Feb 19 18:10:55 2018 +0100

    Reported fix (one line)

commit 16181d80e33bab062dcd22c523be3676659a38cc
Author: Francis Dupont <fdupont@isc.org>
Date:   Mon Feb 19 17:59:25 2018 +0100

    Updated git hash

commit 26ca61342282de5a2519b20dadab1ce557dbdc04
Author: Francis Dupont <fdupont@isc.org>
Date:   Mon Feb 19 17:58:33 2018 +0100

    Finishing merge of (forensic/legal logging to database)

commit 85ce566e4fb2e0cbd46d18a6190f5d68831dd280
Merge: 69d95cb 444f760

Changes for most recent commit in trac5450:

tmark@wild-dog premium (trac5450) $ git show 1a9ffcc95ed09723794b21f016d7a3c97b321245
commit 1a9ffcc95ed09723794b21f016d7a3c97b321245
Author: Francis Dupont <fdupont@isc.org>
Date:   Mon Feb 19 18:10:55 2018 +0100

    Reported fix (one line)

diff --git a/src/hooks/dhcp/flex_id/tests/Makefile.am b/src/hooks/dhcp/flex_id/tests/Makefile.am
index 50d23f2..37f35e3 100644
--- a/src/hooks/dhcp/flex_id/tests/Makefile.am
+++ b/src/hooks/dhcp/flex_id/tests/Makefile.am
@@ -35,7 +35,7 @@ flex_id_unittests_LDFLAGS  = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS) $(GTEST_LDFLAGS)
 
 flex_id_unittests_CXXFLAGS = $(AM_CXXFLAGS)
 
-flex_id_unittests_LDADD = $(top_builddir)/premium/src/hooks/dhcp/flex_id/libdhcp_flex_id.la
+flex_id_unittests_LDADD = $(top_builddir)/premium/src/hooks/dhcp/flex_id/libflexid.la
 flex_id_unittests_LDADD += $(top_builddir)/src/lib/eval/libkea-eval.la
 flex_id_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
 flex_id_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la

Link warning emitted by build:

/bin/bash ../../../../../../libtool  --tag=CXX   --mode=link g++ --std=c++11 -Wno-unused-variable -Wall -Wextra -Wnon-virtual-dtor -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -pthread -Wno-missing-field-initializers -fPIC -g -O2  -L/opt/botan/Botan-2.3.0/local/lib      -Wl,-R/opt/botan/Botan-2.3.0/local/lib       -lpthread -o flex_id_unittests flex_id_unittests-run_unittests.o flex_id_unittests-callout_unittests.o flex_id_unittests-load_unload_unittests.o ../../../../../../premium/src/hooks/dhcp/flex_id/libdhcp_flex_id.la ../../../../../../src/lib/eval/libkea-eval.la ../../../../../../src/lib/dhcpsrv/libkea-dhcpsrv.la ../../../../../../src/lib/dhcp/libkea-dhcp++.la ../../../../../../src/lib/asiolink/libkea-asiolink.la ../../../../../../src/lib/cc/libkea-cc.la ../../../../../../src/lib/hooks/libkea-hooks.la ../../../../../../src/lib/log/libkea-log.la ../../../../../../src/lib/util/libkea-util.la ../../../../../../src/lib/exceptions/libkea-exceptions.la -L/opt/log4cplus/log4cplus-1.2.1-rc2/local/lib -llog4cplus -L/opt/botan/Botan-2.3.0/local/lib -lbotan-2 -fstack-protector -m64 -pthread  -lbotan-2    -L/opt/boost/boost_1_63_0/stage/lib  -lboost_system ../../../../../../ext/gtest/libgtest.a -ldl 

*** Warning: Linking the executable flex_id_unittests against the loadable module
*** libdhcp_flex_id.so is not portable!

comment:8 Changed 4 weeks ago by fdupont

Confusing... What is the system so I can try to reproduce, understand and fix?

comment:9 Changed 4 weeks ago by fdupont

  • Owner changed from fdupont to tmark

Recheck on my macOS: apply the diff, rerun autoreconf (for automake) and configure, make clean, make: no warning.
I have a Ubuntu LTS image, I'll build a VM and try with it.
BTW can you check if Makefiles were correctly generated with the trac5450 branch (or the one line diff)?

comment:10 Changed 3 weeks ago by fdupont

Tried with success (so warning disappeared when the patch is applied) on a fresh Ubuntu 18.04 LTS VM.
Note I fixed one unused method (depending on DBs), one unused variable (left by a recent change) and the famous uninitialized value in the host cache PRNG. Even I have a Botan library it was not configured (it is a 2.4 so I think configure test rejected it. There is a ticket to fix this...).

comment:11 Changed 3 weeks ago by tmark

  • Owner changed from tmark to fdupont

I gave up on trying to build premium/trac5450. 5450 no longer builds correctly against master because of the config/build changes Tomek made. I applied your one line change to flex_id Makefile.am in a clean, fresh pull of master and premium, and that builds under Unbuntu 16.04 without the warning. So I am going to take on faith that after you merge that change it will build alright.

So go ahead and merge your change.

comment:12 Changed 3 weeks ago by fdupont

  • Resolution set to fixed
  • Status changed from reviewing to closed

Merged. Closing.

Note: See TracTickets for help on using tickets.