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

Re: Bug#489906: glibc: tst-regex fails on hppa



Hi,

For those that are not on IRC, I have made a lot of progress on this
bug. The problem comes from the patch any/cvs-strerror_r.diff. However,
this patch looks ok, actually comes from upstream and fix a bug. It
seems it only triggers a lock bug on hppa.

FYI you will find below the part of the patch that causes the problem in
case of tst-regex. It's only a change in the locks type.

Cheers,
Aurelien 


--- glibc-2.7.orig/locale/setlocale.c
+++ glibc-2.7/locale/setlocale.c
@@ -123,7 +123,7 @@
 
 
 /* Lock for protecting global data.  */
-__libc_lock_define_initialized (, __libc_setlocale_lock attribute_hidden)
+__libc_rwlock_define_initialized (, __libc_setlocale_lock attribute_hidden)
 
 /* Defined in loadmsgcat.c.  */
 extern int _nl_msg_cat_cntr;
@@ -314,7 +314,7 @@
 	}
 
       /* Protect global data.  */
-      __libc_lock_lock (__libc_setlocale_lock);
+      __libc_rwlock_wrlock (__libc_setlocale_lock);
 
       /* Load the new data for each category.  */
       while (category-- > 0)
@@ -381,7 +381,7 @@
 	    free ((char *) newnames[category]);
 
       /* Critical section left.  */
-      __libc_lock_unlock (__libc_setlocale_lock);
+      __libc_rwlock_unlock (__libc_setlocale_lock);
 
       /* Free the resources (the locale path variable).  */
       free (locale_path);
@@ -394,7 +394,7 @@
       const char *newname[1] = { locale };
 
       /* Protect global data.  */
-      __libc_lock_lock (__libc_setlocale_lock);
+      __libc_rwlock_wrlock (__libc_setlocale_lock);
 
       if (CATEGORY_USED (category))
 	{
@@ -446,7 +446,7 @@
 	}
 
       /* Critical section left.  */
-      __libc_lock_unlock (__libc_setlocale_lock);
+      __libc_rwlock_unlock (__libc_setlocale_lock);
 
       /* Free the resources (the locale path variable.  */
       free (locale_path);

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net


Reply to: