-
-
Notifications
You must be signed in to change notification settings - Fork 734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
keepalived coredump #2502
Comments
Thank you very much for looking into this. |
@swimlessbird Cancel my earlier request - I didn't see that you have already shown at vrrp->sockets == NULL. |
I have reproduced this problem with keepalived v2.2.4. The problem is that that version did not handle properly the unicast_src_ip being deleted, and didn't put the VRRP instance into fault state when the address is deleted. When keepalived reloads its configuration it opens the outbound socket and attempts to bind it to the unicast_src_ip which of course fails. It then closes the socket and vrrp->sock is not set. This problem has been resolved by v2.3.2 (the latest version) although I have not tracked down the specific commit which resolved it. keepalived now puts the VRRP instance into fault state if the unicast_src_ip is deleted, and brings the vrrp instance out of fault state when the IP addresses is added back (provided that everything else is OK). I suggest you upgrade keepalived to v2.3.2 to resolve this issue. You will find many improvements and bug fixes since v2.2.4 was released over 3 years ago. |
I have reproduced this problem with keepalived v2.3.2.
conf:
The interface conf
The reproduce script:
|
@pqarmitage This problem can reproduce this problem with keepalived v2.3.2. vrrp_send_pkt(vrrp_t * vrrp, unicast_peer_t *peer)
check_tx_checksum(vrrp, peer);
#endif
+ if (!vrrp->sockets)
+ return -1;
+
/* Send the packet */
return sendmsg(vrrp->sockets->fd_out, &msg, (peer) ? 0 : MSG_DONTROUTE);
} |
@swimlessbird I was testing something very similar to this yesterday and was not getting a segfault, although the behaviour I was seeing was not quite as I expected. I think the check for Was the segfault in the I will have a look at this this evening and I hope to have a patch for tomorrow. |
@swimlessbird Having looked at your keepalived config and the ifcfg-eth2 and reproduce scripts I am a bit confused. The vrrp instance is configured to use eth1, but the 55.55.55.0/23 subnet and the ifdown/up in the script are using eth2. Is the way you are wanting to work that the VRRP packets are sent over eth2, but the virtual_ipaddresses are configured on eth1? If so, then I think that might be something that we hadn't anticipated in the code. |
Yes, I want to work that the VRRP packets are sent over eth2, but the virtual_ipaddresses are configured on eth1. |
Yes,the segfault is because vrrp->sockets is NULL . And the gdb output:
|
The configuration you have listed above doesn't do what you want. Since you have specified The minimal actions necessary to cause this problem are: The basic problem is that we do not track unicast_src_ip addresses being deleted. On the face of it, everything still looks OK after the unicast_src_ip is deleted, since keepalived keeps sending adverts. Unfortunately, since the address has been deleted, it cannot receive any adverts sent to the (deleted) address, and so the vrrp instance(s) will transition to master if they were in backup state, potentially causing multiple masters (split brain situation). I am going to have to change the code so that deleting the unicast_src_ip address from an interface (actually, deleting the last one configured) puts the VRRP instance into fault state, and when the first such address is added, it ups the instance (and if necessary opens the sockets). There is also a socket option that can help - IP_FREEBIND. Having set this option, we can then bind to the unicast_src_ip even if it is not currently configured. |
Describe the bug
Triggering a network interface down while reloading keepalived causes a coredump.
To Reproduce
Mabay ip link set dev xxx down and reload keepalived.
The interface have unicast_src_ip.
Expected behavior
no coredump
Keepalived version
Distro (please complete the following information):
Details of any containerisation or hosted service (e.g. AWS)
no
Configuration file:
Notify and track scripts
System Log entries
Did keepalived coredump?
Additional context
NA
The text was updated successfully, but these errors were encountered: