This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: `make check' failure in 2.1.93


Ulrich Drepper <drepper@redhat.com> writes in libc-alpha@sourceware.cygnus.com:

> SL Baur <steve@turbolinux.co.jp> writes:
>> #6  0x2000003c78c in __gconv_open (toset=0x11ffe6328 "UTF-8//", 
>> fromset=0x11ffe6318 "ISO-8859-4//", handle=0x11ffe6370, flags=0)
>> at gconv_open.c:263

> This doesn't match line 263 in my sources.

Sorry.  I've been adding abort()s since I can't run in the debugger
and set breakpoints.  Here's a diff against cvs.

--- /usr/local/src/libc/iconv/gconv_open.c	Fri Sep  1 16:52:59 2000
+++ ./gconv_open.c	Fri Sep  1 22:30:13 2000
@@ -40,6 +40,8 @@
   const char *ignore;
   struct trans_struct *trans = NULL;
 
+  if (!fromset || !toset) abort();
+
   /* Find out whether any error handling method is specified.  */
   errhand = strchr (toset, '/');
   if (errhand != NULL)
@@ -143,6 +145,8 @@
     {
       char *newfromset = (char *) alloca (ignore - fromset + 1);
 
+      if (!newfromset) abort();
+
       newfromset[ignore - fromset] = '\0';
       fromset = memcpy (newfromset, fromset, ignore - fromset);
     }
@@ -168,9 +172,10 @@
       result = (__gconv_t) malloc (sizeof (struct __gconv_info)
 				   + (nsteps
 				      * sizeof (struct __gconv_step_data)));
-      if (result == NULL)
+      if (result == NULL) {
+	abort();
 	res = __GCONV_NOMEM;
-      else
+      } else
 	{
 	  size_t n;
 
@@ -203,7 +208,8 @@
 
 	      /* Now see whether we can use any of the transliteration
 		 modules for this step.  */
-	      for (runp = trans; runp != NULL; runp = runp->next)
+	      for (runp = trans; runp != NULL; runp = runp->next) {
+		if (!fromset || !toset) abort();
 		for (n = 0; n < runp->ncsnames; ++n)
 		  if (__strcasecmp (steps[cnt].__from_name,
 				    runp->csnames[n]) == 0)
@@ -224,6 +230,7 @@
 			    malloc (sizeof (struct __gconv_trans_data));
 			  if (newp == NULL)
 			    {
+				abort();
 			      res = __GCONV_NOMEM;
 			      goto bail;
 			    }
@@ -242,6 +249,7 @@
 			}
 		      break;
 		    }
+	      }
 
 	      /* If this is the last step we must not allocate an
 		 output buffer.  */
@@ -255,6 +263,8 @@
 		  result->__data[cnt].__outbuf = (char *) malloc (size);
 		  if (result->__data[cnt].__outbuf == NULL)
 		    {
+			malloc_stats();
+			abort();
 		      res = __GCONV_NOMEM;
 		      goto bail;
 		    }
--- /usr/local/src/libc/malloc/malloc.c	Fri Sep  1 12:08:25 2000
+++ ./malloc.c	Fri Sep  1 23:22:32 2000
@@ -1524,7 +1524,7 @@
 
 /* Thread specific data */
 
-static tsd_key_t arena_key;
+static tsd_key_t arena_key[1];
 static mutex_t list_lock = MUTEX_INITIALIZER;
 
 #if THREAD_STATS
@@ -2692,15 +2692,18 @@
 #else
     result = (*__malloc_hook)(bytes, NULL);
 #endif
+    if (!result) abort();
     return result;
   }
 #endif
 
-  if(request2size(bytes, nb))
-    return 0;
+  if(request2size(bytes, nb)) {
+    abort();
+    return 0; }
   arena_get(ar_ptr, nb);
-  if(!ar_ptr)
-    return 0;
+  if(!ar_ptr) {
+    abort();
+    return 0;}
   victim = chunk_alloc(ar_ptr, nb);
   if(!victim) {
     /* Maybe the failure is due to running out of mmapped areas. */
@@ -2720,7 +2723,7 @@
       }
 #endif
     }
-    if(!victim) return 0;
+    if(!victim) { abort(); return 0; }
   } else
     (void)mutex_unlock(&ar_ptr->mutex);
   return BOUNDED_N(chunk2mem(victim), bytes);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]