Open araujorm opened 2 years ago
I have been able to reproduce this segfault, and can merge a patch that will stop this particular problem. However, what I haven't been able to get working yet is SNMP enabled
-> SNMP disabled
-> SNMP enabled
. The problem is that once SNMP has been enabled, when going from SNMP disabled to SNMP enabled, although net-snmp forwards the SNMP requests to keepalived, nothing seems to happen.
With the current code (plus patch to stop segfault), net-snmp complains, when re-enabling SNMP, that the mibs are already registered. I have added unregister_mib()
calls in function snmp_unregister_mib()
, but those calls fail with MIN_NO_SUCH_REGISTRATION (-1). I have also tried calling shutdown_agent()
when SNMP is disabled, but then when SNMP is re-enabled, net-snmp doesn't seem to reinitialise properly.
If anyone has any ideas about what needs to be done, then any help would be gratefully received.
Describe the bug Keepalived 2.2.7 (and at least some previous versions) segfaults when reloading from a config without enable_snmp_vrrp to one with it.
To Reproduce
enable_snmp_vrrrp
enable_snmp_vrrrp
pid X exited due to segmentation fault (SIGSEGV)
) Note that what dies is the VRRP child process; keepalived's main process reports that and starts it again, but the consequences aren't nice when it happens on a master node (causes the backup node to go to master, then eventually the cluster recovers but meanwhile there is some downtime)Expected behavior No segfaults while reloading keepalived.
Keepalived version
Distro (please complete the following information):
Details of any containerisation or hosted service (e.g. AWS) N/A
Configuration file:
Notify and track scripts N/A
System Log entries
When SIGHUP is sent after uncommenting
enable_snmp_vrrp
:Did keepalived coredump? Yes, coredumpctl debug bt follows:
Additional context N/A