Index: /trunk/Ohana/src/libohana/src/ohana_allocate.c
===================================================================
--- /trunk/Ohana/src/libohana/src/ohana_allocate.c	(revision 41559)
+++ /trunk/Ohana/src/libohana/src/ohana_allocate.c	(revision 41560)
@@ -61,4 +61,19 @@
 }
 
+
+/* these are the measured values, but below we round the ends up and down
+# define PS_BAD_MALLOC_RANGE_1_MIN 39637060
+# define PS_BAD_MALLOC_RANGE_1_MAX 39649156
+
+# define PS_BAD_MALLOC_RANGE_2_MIN 79288100
+# define PS_BAD_MALLOC_RANGE_2_MAX 79294312
+*/
+
+# define PS_BAD_MALLOC_RANGE_1_MIN 39636000
+# define PS_BAD_MALLOC_RANGE_1_MAX 39650000
+
+# define PS_BAD_MALLOC_RANGE_2_MIN 79288000
+# define PS_BAD_MALLOC_RANGE_2_MAX 79298000
+
 void *ohana_malloc (const char *file, int line, const char *func, size_t Nelem, size_t esize) {
 
@@ -79,4 +94,10 @@
   // if (size % 8) size += (8 - size % 8); // do NOT round to 8-byte boundary (did not fix corruption)
 
+  // for gcc 4.3.2, linux 3.7.6 (at least) there are bad malloc sizes.  if a request
+  // is made for one of these bad ranges, actually allocate a larger amount 
+  if ((fullSize > PS_BAD_MALLOC_RANGE_1_MIN) && (fullSize < PS_BAD_MALLOC_RANGE_1_MAX)) { fullSize = PS_BAD_MALLOC_RANGE_1_MAX; }
+  if ((fullSize > PS_BAD_MALLOC_RANGE_2_MIN) && (fullSize < PS_BAD_MALLOC_RANGE_2_MAX)) { fullSize = PS_BAD_MALLOC_RANGE_2_MAX; }
+
+  // this was another attempt to fix corruption problems probably due to the gcc error described above
   if (USE_MMAP_LOCAL && (fullSize > USE_MMAP_SIZE)) {
     fprintf (stderr, "** mmap %ld (%s, %d, %s)\n", fullSize, file, line, func);
@@ -169,4 +190,11 @@
   size_t fullSize = sizeof(OhanaMemblock) + size + 2*sizeof(void *);
   size_t oldFullSize = sizeof(OhanaMemblock) + oldsize + 2*sizeof(void *);
+
+  // for gcc 4.3.2, linux 3.7.6 (at least) there are bad malloc sizes.  if a request
+  // is made for one of these bad ranges, actually allocate a larger amount 
+  if ((fullSize > PS_BAD_MALLOC_RANGE_1_MIN) && (fullSize < PS_BAD_MALLOC_RANGE_1_MAX)) { fullSize = PS_BAD_MALLOC_RANGE_1_MAX; }
+  if ((fullSize > PS_BAD_MALLOC_RANGE_2_MIN) && (fullSize < PS_BAD_MALLOC_RANGE_2_MAX)) { fullSize = PS_BAD_MALLOC_RANGE_2_MAX; }
+  if ((oldFullSize > PS_BAD_MALLOC_RANGE_1_MIN) && (oldFullSize < PS_BAD_MALLOC_RANGE_1_MAX)) { oldFullSize = PS_BAD_MALLOC_RANGE_1_MAX; }
+  if ((oldFullSize > PS_BAD_MALLOC_RANGE_2_MIN) && (oldFullSize < PS_BAD_MALLOC_RANGE_2_MAX)) { oldFullSize = PS_BAD_MALLOC_RANGE_2_MAX; }
 
   pthread_mutex_lock(&memBlockListMutex);
