List:Internals« Previous MessageNext Message »
From:tomas Date:October 4 2005 11:27am
Subject:bk commit into 5.0 tree (tomas:1.2011) BUG#11739
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of tomas. When tomas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2011 05/10/04 11:27:14 tomas@stripped +6 -0
  Bug#11739 SendBufferMemory set to 294967039 causes core where max = 4294967039
  - added proper error message on all failed array pool mallocs

  ndb/src/kernel/vm/SafeCounter.hpp
    1.2 05/10/04 11:27:07 tomas@stripped +1 -1
    Bug#11739 SendBufferMemory set to 294967039 causes core where max = 4294967039
    - added proper error message on all failed array pool mallocs

  ndb/src/kernel/vm/SafeCounter.cpp
    1.2 05/10/04 11:27:07 tomas@stripped +2 -2
    Bug#11739 SendBufferMemory set to 294967039 causes core where max = 4294967039
    - added proper error message on all failed array pool mallocs

  ndb/src/kernel/vm/CArray.hpp
    1.2 05/10/04 11:27:07 tomas@stripped +9 -3
    Bug#11739 SendBufferMemory set to 294967039 causes core where max = 4294967039
    - added proper error message on all failed array pool mallocs

  ndb/src/kernel/vm/ArrayPool.hpp
    1.7 05/10/04 11:27:07 tomas@stripped +14 -4
    Bug#11739 SendBufferMemory set to 294967039 causes core where max = 4294967039
    - added proper error message on all failed array pool mallocs

  ndb/src/kernel/error/ErrorReporter.hpp
    1.9 05/10/04 11:27:07 tomas@stripped +2 -1
    Bug#11739 SendBufferMemory set to 294967039 causes core where max = 4294967039
    - added proper error message on all failed array pool mallocs

  ndb/src/kernel/error/ErrorReporter.cpp
    1.15 05/10/04 11:27:07 tomas@stripped +3 -3
    Bug#11739 SendBufferMemory set to 294967039 causes core where max = 4294967039
    - added proper error message on all failed array pool mallocs

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	tomas
# Host:	poseidon.ndb.mysql.com
# Root:	/home/tomas/mysql-5.0

--- 1.14/ndb/src/kernel/error/ErrorReporter.cpp	2005-10-03 20:04:26 +02:00
+++ 1.15/ndb/src/kernel/error/ErrorReporter.cpp	2005-10-04 11:27:07 +02:00
@@ -165,7 +165,7 @@
 void childReportError(int error);
 
 void
-ErrorReporter::handleAssert(const char* message, const char* file, int line)
+ErrorReporter::handleAssert(const char* message, const char* file, int line, int ec)
 {
   char refMessage[100];
 
@@ -179,10 +179,10 @@
   BaseString::snprintf(refMessage, 100, "%s line: %d (block: %s)",
 	   file, line, blockName);
 #endif
-  WriteMessage(NDBD_EXIT_PRGERR, message, refMessage,
+  WriteMessage(ec, message, refMessage,
 	       theEmulatedJamIndex, theEmulatedJam);
 
-  childReportError(NDBD_EXIT_PRGERR);
+  childReportError(ec);
 
   NdbShutdown(s_errorHandlerShutdownType);
 }

--- 1.8/ndb/src/kernel/error/ErrorReporter.hpp	2005-10-03 20:04:26 +02:00
+++ 1.9/ndb/src/kernel/error/ErrorReporter.hpp	2005-10-04 11:27:07 +02:00
@@ -18,6 +18,7 @@
 #define ERRORREPORTER_H
 
 #include <ndb_global.h>
+#include <ndbd_exit_codes.h>
 
 #include "TimeModule.hpp"
 #include <Emulator.hpp>
@@ -28,7 +29,7 @@
   static void setErrorHandlerShutdownType(NdbShutdownType nst = NST_ErrorHandler);
   static void handleAssert(const char* message, 
 			   const char* file, 
-			   int line);
+			   int line, int ec = NDBD_EXIT_PRGERR);
   
   static void handleError(int faultID, 
 			  const char* problemData,

--- 1.6/ndb/src/kernel/vm/ArrayPool.hpp	2004-08-05 23:39:10 +02:00
+++ 1.7/ndb/src/kernel/vm/ArrayPool.hpp	2005-10-04 11:27:07 +02:00
@@ -44,7 +44,7 @@
    *
    * Note, can currently only be called once
    */
-  bool setSize(Uint32 noOfElements);
+  bool setSize(Uint32 noOfElements, bool exit_on_error = true);
 
   inline Uint32 getNoOfFree() const {
     return noOfFree;
@@ -218,13 +218,19 @@
 template <class T>
 inline
 bool
-ArrayPool<T>::setSize(Uint32 noOfElements){
+ArrayPool<T>::setSize(Uint32 noOfElements, bool exit_on_error){
   if(size == 0){
     if(noOfElements == 0)
       return true;
     theArray = (T *)NdbMem_Allocate(noOfElements * sizeof(T));
     if(theArray == 0)
-      return false;
+    {
+      if (!exit_on_error)
+	return false;
+      ErrorReporter::handleAssert("ArrayPool<T>::setSize malloc failed",
+				  __FILE__, __LINE__, NDBD_EXIT_MEMALLOC);
+      return false; // not reached
+    }
     size = noOfElements;
     noOfFree = noOfElements;
 
@@ -247,7 +253,11 @@
     
     return true;
   }
-  return false;
+  if (!exit_on_error)
+    return false;
+
+  ErrorReporter::handleAssert("ArrayPool<T>::setSize called twice", __FILE__,
__LINE__);
+  return false; // not reached
 }
   
 template <class T>

--- 1.1/ndb/src/kernel/vm/CArray.hpp	2004-04-14 10:24:22 +02:00
+++ 1.2/ndb/src/kernel/vm/CArray.hpp	2005-10-04 11:27:07 +02:00
@@ -31,7 +31,7 @@
    *
    * Note, can currently only be called once
    */
-  bool setSize(Uint32 noOfElements);
+  bool setSize(Uint32 noOfElements, bool exit_on_error = true);
 
   /**
    * Get size
@@ -82,13 +82,19 @@
 template <class T>
 inline
 bool
-CArray<T>::setSize(Uint32 noOfElements){
+CArray<T>::setSize(Uint32 noOfElements, bool exit_on_error){
   if(size == noOfElements)
     return true;
   
   theArray = (T *)NdbMem_Allocate(noOfElements * sizeof(T));
   if(theArray == 0)
-    return false;
+  {
+    if (!exit_on_error)
+      return false;
+    ErrorReporter::handleAssert("CArray<T>::setSize malloc failed",
+				__FILE__, __LINE__, NDBD_EXIT_MEMALLOC);
+    return false; // not reached
+  }
   size = noOfElements;
   return true;
 }

--- 1.1/ndb/src/kernel/vm/SafeCounter.cpp	2004-04-14 10:24:23 +02:00
+++ 1.2/ndb/src/kernel/vm/SafeCounter.cpp	2005-10-04 11:27:07 +02:00
@@ -25,8 +25,8 @@
 {}
   
 bool
-SafeCounterManager::setSize(Uint32 maxNoOfActiveMutexes) {
-  return m_counterPool.setSize(maxNoOfActiveMutexes);
+SafeCounterManager::setSize(Uint32 maxNoOfActiveMutexes, bool exit_on_error) {
+  return m_counterPool.setSize(maxNoOfActiveMutexes, exit_on_error);
 }
 
 Uint32

--- 1.1/ndb/src/kernel/vm/SafeCounter.hpp	2004-04-14 10:24:23 +02:00
+++ 1.2/ndb/src/kernel/vm/SafeCounter.hpp	2005-10-04 11:27:07 +02:00
@@ -63,7 +63,7 @@
 public:
   SafeCounterManager(class SimulatedBlock &);
   
-  bool setSize(Uint32 maxNoOfActiveMutexes);
+  bool setSize(Uint32 maxNoOfActiveMutexes, bool exit_on_error = true);
   Uint32 getSize() const ;
 
   void execNODE_FAILREP(Signal*); 
Thread
bk commit into 5.0 tree (tomas:1.2011) BUG#11739tomas4 Oct