kea-netconf crashes when overwriting the config from one module with another in the same edit-config
- Start
kea-dhcp4
,kea-dhcp6
,kea-netconf
subscribed to bothkea-dhcp4-server
andkea-dhcp6-server
(kea-netconf.conf). - Import one config:
sysrepocfg --import=/etc/kea-dhcp4-config.xml
. - Import the config of the other:
sysrepocfg --import=/etc/kea-dhcp6-config.xml
. This overwrites everything and deletes the first config, and this triggers the crash.
Seems like an internal sysrepo bug, but they do offer the possibility to catch exceptions and recover, but the question is what does recovering mean? Empirically, I was able to issue another edit-config after catching the exception.
The configs don't need to be complex, but they can't be very simple i.e. only the control-socket. Having at least a subnet is what triggers the crash. Here is what I used:
-
/etc/kea-dhcp4-config.xml
:
<config xmlns="urn:ietf:params:xml:ns:yang:kea-dhcp4-server">
<control-socket>
<socket-name>/tmp/kea-dhcp4-ctrl.sock</socket-name>
<socket-type>unix</socket-type>
</control-socket>
<subnet4>
<id>1</id>
<subnet>192.0.0.0/24</subnet>
</subnet4>
</config>
-
/etc/kea-dhcp6-config.xml
:
<config xmlns="urn:ietf:params:xml:ns:yang:kea-dhcp6-server">
<control-socket>
<socket-name>/tmp/kea-dhcp6-ctrl.sock</socket-name>
<socket-type>unix</socket-type>
</control-socket>
<subnet6>
<id>1</id>
<pool>
<start-address>2001:db8:1::</start-address>
<end-address>2001:db8:1::ffff</end-address>
</pool>
<subnet>2001:db8:1::/64</subnet>
</subnet6>
</config>
INFO NETCONF_CONFIG_CHANGE_EVENT Received YANG configuration change Event::Abort event
terminate called after throwing an instance of 'sysrepo::ErrorWithCode'
what(): Could not iterate to the next change: SR_ERR_INTERNAL
(gdb) bt
#0 0x00007fffedaa8e44 in ?? () from /usr/lib/libc.so.6
#1 0x00007fffeda50a30 in raise () from /usr/lib/libc.so.6
#2 0x00007fffeda384c3 in abort () from /usr/lib/libc.so.6
#3 0x00007fffedc97b0c in __gnu_cxx::__verbose_terminate_handler () at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/vterminate.cc:
95
#4 0x00007fffedcadf1a in __cxxabiv1::__terminate (handler=<optimized out>) at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_ter
minate.cc:48
#5 0x00007fffedc9750a in std::terminate () at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:58
#6 0x00007ffff634f8b6 in sysrepo::(anonymous namespace)::handleExceptionFromCb(std::exception &, std::function<void(std::exception
&)> *) (ex=..., exceptionHandler=0x50300007d260) at /home/andrei/work/github.com/sysrepo-cpp/src/Subscription.cpp:71
#7 0x00007ffff634faf3 in sysrepo::(anonymous namespace)::moduleChangeCb (session=0x514000080240, subscriptionId=10, moduleName=0x5
0300007d320 "kea-dhcp4-server", subXPath=0x0, event=SR_EV_ABORT, requestId=3, privateData=0x506000334ef0) at /home/andrei/work/gith
ub.com/sysrepo-cpp/src/Subscription.cpp:96
#8 0x00007ffff4bbbe2e in sr_shmsub_change_listen_process_module_events (change_subs=0x506000334f40, conn=0x519000004180) at /home/
andrei/work/github.com/sysrepo/src/shm_sub.c:3069
#9 0x00007ffff4b71de3 in sr_subscription_process_events (subscription=0x512000096040, session=0x0, wake_up_in=0x7fffe4dccd30) at /
home/andrei/work/github.com/sysrepo/src/sysrepo.c:4286
#10 0x00007ffff4bbfb76 in sr_shmsub_listen_thread (arg=0x512000096040) at /home/andrei/work/github.com/sysrepo/src/shm_sub.c:4512
#11 0x00005555556c56b7 in asan_thread_start(void*) ()
#12 0x00007fffedaa6ded in ?? () from /usr/lib/libc.so.6
#13 0x00007fffedb2a0dc in ?? () from /usr/lib/libc.so.6
Edited by Andrei Pavel