ConfD User Community

DEBUG Library MAXDEPTH/MAXKEYLEN 20/9 for confd_hkeypath_t are too small, ConfD needs 28/4


#1

I have imported the ietf-isis@2018-12-04.fxs in the 6-c_config. When make start, it raised the following error

zhaohongji@ubuntu:~/confd-6.4.3/examples.confd/intro/6-c_config$ make start 
*### Killing any confd daemon and HOSTS confd agents
/home/zhaohongji/confd-6.4.3/bin/confd --stop || true
killall hosts || true
hosts: no process found
/home/zhaohongji/confd-6.4.3/bin/confd  -c confd.conf --addloadpath /home/zhaohongji/confd-6.4.3/etc/confd
*### * In one terminal window, run: tail -f ./confd.log
*### * In another terminal window, run queries
*###   (try 'make query' for an example)
*### * In this window, the HOSTS confd daemon now starts:
./hosts 
Starting with empty DB
DEBUG Library MAXDEPTH/MAXKEYLEN 20/9 for confd_hkeypath_t are too small, ConfD needs 28/4
Failed to load schemas from confd
Makefile:59: recipe for target 'start' failed
make: *** [start] Error 1

The confd userguide suggests that tuning the size of confd_hkeypath_t. I recompiled the libconfd source code by the following commands and generated libconfd.a and libconfd.so.
make EXTRA_CFLAGS="-DMAXDEPTH=28 -DMAXKEYLEN=4"

I used the latest libconfd.a and libconfd.so to replace the old ones.

zhaohongji@ubuntu:~/confd-6.4.3/lib$ pwd
/home/zhaohongji/confd-6.4.3/lib
zhaohongji@ubuntu:~/confd-6.4.3/lib$ ll *libconfd*
-rw-r--r-- 1 zhaohongji zhaohongji 4463082 Dec 12 23:40 libconfd.a
-rwxr-xr-x 1 zhaohongji zhaohongji 1918344 Dec 12 23:40 libconfd.so*

At last it still raised the error. Who knows how to deal with it? Thanks a lot!


#2

After you replaced the static libconfd.a library, did you link the new library with the 6-c_config example application?

E.g.
cc -o hosts hosts.o dlist.o $(CONFD_DIR)/lib/libconfd.a -lpthread -lm -L/opt/local/lib


#3

It couldn’t link the new library automatically, could it?


#4

Probably not, unless you are developing an AGI application that relinks it self to a static library after it rebuilt the statically linked libconfd.a.
If your application link dynamically with libconfd.so, then yes.

Google selected this for me after a search:
http://www.yolinux.com/TUTORIALS/LibraryArchives-StaticAndDynamic.html


#5

Actually, as the User Guide explains, it is not sufficient to relink (or use dynamic linking), since the applications also need to be compiled with the changed values for MAXDEPTH/MAXKEYLEN - otherwise they would be using a different definition of confd_hkeypath_t than the library is using, and e.g. data provider callbacks receiving a hkeypath built by the library as a parameter would not be able to interpret it correctly. Such a mismatch between applcation and library will actually be detected by the confd_init() call, which will terminate the application with an error message.

As for “automatic”, Makefiles in e.g. the examples could of course have more dependencies, but depending on how the change is done - the User Guide discusses some alternatives - this may not be sufficient. E.g. a dependency on $CONFD_DIR/include/confd_lib.h will only help if that file is actually modified, which may be undesirable.