Bug 12511 - ctdb_takeover_helper crashes with SEGV
Summary: ctdb_takeover_helper crashes with SEGV
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: CTDB (show other bugs)
Version: 4.6.0rc1
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
Depends on:
Reported: 2017-01-11 06:59 UTC by Amitay Isaacs
Modified: 2017-01-27 05:14 UTC (History)
3 users (show)

See Also:

Patches for v4-6 (5.91 KB, patch)
2017-01-12 23:19 UTC, Amitay Isaacs
martins: review+

Note You need to log in before you can comment on or make changes to this bug.
Description Amitay Isaacs 2017-01-11 06:59:22 UTC
In populate_bitmap(),  if there are no available IP addresses, then the loop should be skipped. 

		for (i = 0; i < ipalloc_state->num; i++) {
			struct ctdb_public_ip_list *avail =

			/* Check to see if "ip" is available on node "i" */
			for (j = 0; j < avail->num; j++) {
				if (ctdb_sock_addr_same_ip(
					    &ip->addr, &avail->ip[j].addr)) {
					ip->available_on[i] = true;
Comment 1 Amitay Isaacs 2017-01-11 23:57:58 UTC
The calculation of known and available IPs in ctdb_takeover_helper is wrong.  Both the ip lists should be the same size as the nodemap.
Comment 2 Amitay Isaacs 2017-01-12 23:19:46 UTC
Created attachment 12825 [details]
Patches for v4-6
Comment 3 Martin Schwenke 2017-01-15 04:27:02 UTC
Hi Karolin,

This is ready for 4.6.

Comment 4 Karolin Seeger 2017-01-24 20:07:35 UTC
Pushed to autobuild-v4-6-test.
Comment 5 Karolin Seeger 2017-01-27 05:14:23 UTC
(In reply to Karolin Seeger from comment #4)
Pushed to v4-6-test.
Closing out bug report.