Crash in perfmon when no subnet is assigned
The following discussion from isc-private/kea-premium!479 should be addressed:
-
@andrei started a discussion: (+5 comments) I managed to crash the server under specific conditions. It also happens on master. But since this seems radius related, and we're making significant changes to radius in this issue, should we fix it here?
Minimal conditions seem to be: host cache + perfmon + radius + high dhcp traffic.
Taking out any of the hook libraries out of the config makes the crash go away.
Putting host cache after radius in the config makes the crash go away.
Logs end in:
kea-dhcp6: /usr/include/boost/smart_ptr/shared_ptr.hpp:784: typename boost::detail::sp_member_access<T>::type boost::shared_ptr<isc::dhcp::Subnet6>::operator->() const [T = isc::dhcp::Subnet6]: Assertion `px != 0' failed. DEBUG DHCP6_HOOK_SUBNET6_SELECT_PARK duid=[00:01:00:01:2d:b4:ec:39:00:0c:01:0c:c4:a0], [no hwaddr info], tid=0x1a82ee: packet was parked DEBUG DHCP6_HOOK_SUBNET6_SELECT_PARK duid=[00:01:00:01:2d:b4:ec:39:00:0c:01:0c:c4:8b], [no hwaddr info], tid=0x1a82d9: packet was parked DEBUG HOOKS_CALLOUTS_COMPLETE completed callouts for hook subnet6_select (total callouts duration: 78.624 ms) [1] 1982663 IOT instruction (core dumped) kea-dhcp6 -c /etc/kea-dhcp6-custom.conf
gdb stops here:
#6 0x00007fffe736dfd8 in pkt6_send (handle=...) at perfmon_callouts.cc:108 108 mgr->processPktEventStack(query, response, subnet->getID()); (gdb) p subnet $1 = {px = 0x0, pn = {pi_ = 0x0}}
perfdhcp -6 -l vethclient -r 1000 -f 1000 -R 1000000 -t 1
I see other places where subnet is null checked after retrieving it from the callout handle, so maybe the fix is on the perfmon side.
Edited by Andrei Pavel