bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: test-localename crash


From: Bruno Haible
Subject: Re: test-localename crash
Date: Thu, 31 Dec 2009 02:36:29 +0100
User-agent: KMail/1.9.9

Hi Simon,

Simon Josefsson wrote:
> The test-localename test crashes for me:
> #0  strcmp () at ../sysdeps/i386/i686/strcmp.S:39
> #1  0x08049840 in test_locale_name_thread () at test-localename.c:421
> Debugging it shows that the variables passed to strcmp are NULL.

Oops. Bad mistake of mine. This should fix it:


2009-12-30  Bruno Haible  <address@hidden>

        Fix test crash.
        * tests/test-localename.c (test_locale_name_thread): Skip unavailable
        locales.
        Reported by Simon Josefsson <address@hidden>.

--- tests/test-localename.c.orig        Thu Dec 31 02:33:24 2009
+++ tests/test-localename.c     Thu Dec 31 02:29:52 2009
@@ -419,12 +419,13 @@
       }
     /* Verify the unsaved_names are still valid.  */
     for (j = 0; j < SIZEOF (choices); j++)
-      {
-        unsigned int i;
-
-        for (i = 0; i < SIZEOF (categories); i++)
-          ASSERT (strcmp (unsaved_names[j][i], saved_names[j][i]) == 0);
-      }
+      if (available[j])
+        {
+          unsigned int i;
+
+          for (i = 0; i < SIZEOF (categories); i++)
+            ASSERT (strcmp (unsaved_names[j][i], saved_names[j][i]) == 0);
+        }
     /* Allocate many locales, without freeing them.  This is an attempt at
        overwriting as much of the previously allocated memory as possible.  */
     for (j = SIZEOF (choices); j > 0; )
@@ -447,12 +448,13 @@
       }
     /* Verify the unsaved_names are still valid.  */
     for (j = 0; j < SIZEOF (choices); j++)
-      {
-        unsigned int i;
-
-        for (i = 0; i < SIZEOF (categories); i++)
-          ASSERT (strcmp (unsaved_names[j][i], saved_names[j][i]) == 0);
-      }
+      if (available[j])
+        {
+          unsigned int i;
+
+          for (i = 0; i < SIZEOF (categories); i++)
+            ASSERT (strcmp (unsaved_names[j][i], saved_names[j][i]) == 0);
+        }
   }
 #else
   /* Check that gl_locale_name_thread always returns NULL.  */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]