MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:February 17 2010 3:27pm
Subject:bzr commit into mysql-5.1-telco-6.3 branch (magnus.blaudd:3093)
Bug#49219
View as plain text  
#At file:///home/msvensson/mysql/6.3-bug49219/ based on revid:jonas@strippedtohkmgpzvgezl

 3093 Magnus Blåudd	2010-02-17
      Bug#49219 ndb_mgm segfaults when receiving command after ndb_mgmd restart
       - remove the handler for SIGPIPE that disconnects the ndb_mgm 
        client in the middle of it's check of still connected.
       - don't turn off mgmapi's builtin ignore of SIGPIPE and rely
         on the return codes which is returned from the mgmapi functions.

    modified:
      storage/ndb/src/mgmclient/CommandInterpreter.cpp
      storage/ndb/src/mgmclient/main.cpp
=== modified file 'storage/ndb/src/mgmclient/CommandInterpreter.cpp'
--- a/storage/ndb/src/mgmclient/CommandInterpreter.cpp	2010-02-04 14:52:16 +0000
+++ b/storage/ndb/src/mgmclient/CommandInterpreter.cpp	2010-02-17 15:27:21 +0000
@@ -914,24 +914,13 @@ CommandInterpreter::connect(bool interac
     ndbout_c("Can't create handle to management server.");
     exit(-1);
   }
-  if (ndb_mgm_set_ignore_sigpipe(m_mgmsrv, 0)) {
-    ndbout_c("Can't set 'ignore_sigpipe', error: %d - %s",
-             ndb_mgm_get_latest_error(m_mgmsrv),
-             ndb_mgm_get_latest_error_desc(m_mgmsrv));
-    exit(-1);
-  }
+
   if (interactive) {
     m_mgmsrv2 = ndb_mgm_create_handle();
     if(m_mgmsrv2 == NULL) {
       ndbout_c("Can't create 2:nd handle to management server.");
       exit(-1);
     }
-    if (ndb_mgm_set_ignore_sigpipe(m_mgmsrv2, 0)) {
-      ndbout_c("Can't set 'ignore_sigpipe', error: %d - %s",
-               ndb_mgm_get_latest_error(m_mgmsrv2),
-               ndb_mgm_get_latest_error_desc(m_mgmsrv2));
-      exit(-1);
-    }
   }
 
   if (ndb_mgm_set_connectstring(m_mgmsrv, m_constr))

=== modified file 'storage/ndb/src/mgmclient/main.cpp'
--- a/storage/ndb/src/mgmclient/main.cpp	2010-02-03 14:53:12 +0000
+++ b/storage/ndb/src/mgmclient/main.cpp	2010-02-17 15:27:21 +0000
@@ -47,25 +47,6 @@ const char *load_default_groups[]= { "my
 
 static Ndb_mgmclient* com;
 
-extern "C"
-void 
-handler(int sig)
-{
-  DBUG_ENTER("handler");
-  switch(sig){
-  case SIGPIPE:
-    /**
-     * Will happen when connection to mgmsrv is broken
-     * Reset connected flag
-     */
-    printf("Got SIGPIPE!\n");
-    if (com)
-      com->disconnect();
-    break;
-  }
-  DBUG_VOID_RETURN;
-}
-
 NDB_STD_OPTS_VARS;
 
 static const char default_prompt[]= "ndb_mgm> ";
@@ -164,11 +145,6 @@ int main(int argc, char** argv){
     prompt= 0;
   }
 
-  // Install our own signal handler for SIGPIPE that calls
-  // 'Ndb_mgmclient' disconnect. In order to avoid that the
-  // mgmapi installs its own SIGPIPE handler, the Ndb_mgmclient will
-  // use 'ndb_mgm_set_ignore_sigpipe(handle, 0)'
-  signal(SIGPIPE, handler);
   com = new Ndb_mgmclient(opt_connect_str,opt_verbose);
   int ret= 0;
   BaseString histfile;

Attachment: [text/bzr-bundle] bzr/magnus.blaudd@sun.com-20100217152721-hne99nh75q8b3cg1.bundle
Thread
bzr commit into mysql-5.1-telco-6.3 branch (magnus.blaudd:3093)Bug#49219Magnus Blåudd17 Feb