Bug #7152 ndb_mgmd segfaults on incorrect HostName in configuration
Submitted: 10 Dec 2004 3:03 Modified: 10 Dec 2004 3:05
Reporter: Stewart Smith Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:4.1 OS:Linux (Linux)
Assigned to: Stewart Smith CPU Architecture:Any

[10 Dec 2004 3:03] Stewart Smith
Description:
Starting ndb_mgmd on a host which isn't in the configuration file as the ndb_mgmd 
  (e.g. the ip address is different) would have ndb_mgmd segfault.
  
  There was a check in the code, but it was (potentially) trying to dereference null

How to repeat:
Have something like this:
[NDB_MGMD]
HostName = 192.168.0.56

in your config.ini and start ndb_mgmd when you're IP address isn't 192.168.0.56.

Suggested fix:
This fix was pushed to mysql-4.1-ndb. See original checkin in mail "bk commit - 4.1 tree (stewart:1.2128)"

--- 1.51/ndb/src/mgmsrv/MgmtSrvr.cpp    2004-11-30 02:14:40 +11:00
+++ 1.52/ndb/src/mgmsrv/MgmtSrvr.cpp    2004-12-07 15:49:49 +11:00
@@ -2292,8 +2292,9 @@
       if (found_matching_type)
        if (found_free_node)
          error_string.appfmt("Connection done from wrong host ip %s.",
-                             inet_ntoa(((struct sockaddr_in *)
-                                        (client_addr))->sin_addr));
+                             (client_addr)?
+                               inet_ntoa(((struct sockaddr_in *)
+                                        (client_addr))->sin_addr):"");
        else
          error_string.appfmt("No free node id found for %s.",
                              type_string.c_str());
[10 Dec 2004 3:05] Stewart Smith
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html