]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Updated to fedora-glibc-20060828T1903 cvs/fedora-glibc-2_4_90-26
authorJakub Jelinek <jakub@redhat.com>
Mon, 28 Aug 2006 19:19:33 +0000 (19:19 +0000)
committerJakub Jelinek <jakub@redhat.com>
Mon, 28 Aug 2006 19:19:33 +0000 (19:19 +0000)
ChangeLog
fedora/branch.mk
fedora/glibc.spec.in
inet/getnameinfo.c
locale/programs/ld-collate.c
locale/programs/ld-ctype.c
malloc/malloc.c
nptl/ChangeLog
nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c

index b95ea69c5e8e2bfa37cd8166258a7416018c6192..2f46b1e40852b79568c4493f729c3ed28fd32063 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,34 @@
+2006-08-28  Jakub Jelinek  <jakub@redhat.com>
+
+       * inet/getnameinfo.c (getnameinfo): For AF_INET, check errno
+       only if herrno is NETDB_INTERNAL.  Handle errors other than
+       ERANGE outside of the loops, handle TRY_AGAIN.
+
+       * locale/programs/ld-ctype.c (translit_flatten): Issue error
+       if other's ctype category was missing.
+       * locale/programs/ld-collate.c (collate_read): Return if
+       copy_locale's collate category is missing.
+
+2006-08-27  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #2684]
+       * malloc/malloc.c (public_rEALLOc): Try harder by using other
+       arenas if allocation failed.
+       Patch mostly by Jan Edler <jan.edler@indexengines.com>.
+
+2006-08-26  Ulrich Drepper  <drepper@redhat.com>
+
+       * malloc/malloc.c (bin_at): Rewrite to be more clear and to not
+       waste bins[0..1].
+       (malloc_state): Reduce bins size by 2.
+       (_int_malloc): Fix test for large enough buffer for early termination.
+       When no unsorted block matches perfectly and an exiting block has
+       to be split, use full list insert and not shortcut which assumes
+       the list is empty.
+
+       * locale/programs/ld-ctype.c (ctype_read): Better patch for read
+       failure.
+
 2006-08-24  Ulrich Drepper  <drepper@redhat.com>
 
        * locale/programs/ld-ctype.c (ctype_read): If CTYPE is NULL, don't
index fb723d026ce708243bee86e46703be6004ecac48..7e4461da37b817a68ddf38ac934c68743cb92c5e 100644 (file)
@@ -3,5 +3,5 @@ glibc-branch := fedora
 glibc-base := HEAD
 DIST_BRANCH := devel
 COLLECTION := dist-fc4
-fedora-sync-date := 2006-08-25 06:39 UTC
-fedora-sync-tag := fedora-glibc-20060825T0639
+fedora-sync-date := 2006-08-28 19:03 UTC
+fedora-sync-tag := fedora-glibc-20060828T1903
index 4fb0f4709b5e94dbd625a9966faa862f3800adf0..2674d2b56493702be62f28f0a9908d9ddc948f8f 100644 (file)
@@ -1,4 +1,4 @@
-%define glibcrelease 24
+%define glibcrelease 26
 %define auxarches i586 i686 athlon sparcv9 alphaev6
 %define xenarches i686 athlon
 %ifarch %{xenarches}
@@ -1448,7 +1448,13 @@ rm -f *.filelist*
 %endif
 
 %changelog
-* Fri Aug 25 2006 Jakub Jelinek <jakub@redhat.com> 2.4.90-24
+* Mon Aug 28 2006 Jakub Jelinek <jakub@redhat.com> 2.4.90-26
+- real fix for the doubly linked list corruption problem
+- try harder in realloc to allocate memory (BZ#2684)
+- fix getnameinfo error reporting (#204122)
+- make localedef more robust on invalid input (#203728)
+
+* Fri Aug 25 2006 Jakub Jelinek <jakub@redhat.com> 2.4.90-25
 - temporarily back out code to limit number of unsorted block
   sort iterations (#203735, #204027)
 - handle PLT symbols in dladdr properly (BZ#2683)
index 5057fd221a98762ba93edef696a71764621d8149..b7b2b151b216c312fd062baa6eff34b9813ade01 100644 (file)
@@ -203,48 +203,40 @@ getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,
        if (!(flags & NI_NUMERICHOST))
          {
            struct hostent *h = NULL;
+           if (sa->sa_family == AF_INET6)
+             {
+               while (__gethostbyaddr_r ((const void *) &(((const struct sockaddr_in6 *) sa)->sin6_addr),
+                                         sizeof(struct in6_addr),
+                                         AF_INET6, &th, tmpbuf, tmpbuflen,
+                                         &h, &herrno))
+                 if (herrno == NETDB_INTERNAL && errno == ERANGE)
+                   tmpbuf = extend_alloca (tmpbuf, tmpbuflen, 2 * tmpbuflen);
+                 else
+                   break;
+             }
+           else
+             {
+               while (__gethostbyaddr_r ((const void *) &(((const struct sockaddr_in *)sa)->sin_addr),
+                                         sizeof(struct in_addr), AF_INET,
+                                         &th, tmpbuf, tmpbuflen,
+                                         &h, &herrno))
+                 if (herrno == NETDB_INTERNAL && errno == ERANGE)
+                   tmpbuf = extend_alloca (tmpbuf, tmpbuflen, 2 * tmpbuflen);
+                 else
+                   break;
+             }
+
            if (h == NULL)
              {
-               if (sa->sa_family == AF_INET6)
+               if (herrno == NETDB_INTERNAL)
                  {
-                   while (__gethostbyaddr_r ((const void *) &(((const struct sockaddr_in6 *) sa)->sin6_addr),
-                                             sizeof(struct in6_addr),
-                                             AF_INET6, &th, tmpbuf, tmpbuflen,
-                                             &h, &herrno))
-                     {
-                       if (herrno == NETDB_INTERNAL)
-                         {
-                           if (errno == ERANGE)
-                             tmpbuf = extend_alloca (tmpbuf, tmpbuflen,
-                                                     2 * tmpbuflen);
-                           else
-                             {
-                               __set_h_errno (herrno);
-                               __set_errno (serrno);
-                               return EAI_SYSTEM;
-                             }
-                         }
-                       else
-                         {
-                           break;
-                         }
-                     }
+                   __set_h_errno (herrno);
+                   return EAI_SYSTEM;
                  }
-               else
+               if (herrno == TRY_AGAIN)
                  {
-                   while (__gethostbyaddr_r ((const void *) &(((const struct sockaddr_in *)sa)->sin_addr),
-                                             sizeof(struct in_addr), AF_INET,
-                                             &th, tmpbuf, tmpbuflen,
-                                             &h, &herrno))
-                     {
-                       if (errno == ERANGE)
-                         tmpbuf = extend_alloca (tmpbuf, tmpbuflen,
-                                                 2 * tmpbuflen);
-                       else
-                         {
-                           break;
-                         }
-                     }
+                   __set_h_errno (herrno);
+                   return EAI_AGAIN;
                  }
              }
 
@@ -361,10 +353,7 @@ getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,
                                 (const void *) &(((const struct sockaddr_in *) sa)->sin_addr),
                                 host, hostlen);
                if (c == NULL)
-                 {
-                   __set_errno (serrno);
-                   return EAI_SYSTEM;
-                 }
+                 return EAI_SYSTEM;
              }
            ok = 1;
          }
index 66638d50c838fbc3685d79b91737dd948bcd58c6..e69ac85a9570d10f06bfd095556518f85101f294 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2002, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2002, 2003, 2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gnu.org>, 1995.
 
@@ -2671,6 +2671,9 @@ collate_read (struct linereader *ldfile, struct localedef_t *result,
              if (locfile_read (copy_locale, charmap) != 0)
                goto skip_category;
            }
+
+         if (copy_locale->categories[LC_COLLATE].collate == NULL)
+           return;
        }
 
       lr_ignore_rest (ldfile, 1);
index 0ffda62e2977ad72e6b3fd9cd99e986d3188ccb9..b1a28b92804c325c3e065fbcdc3daa804bab40ea 100644 (file)
@@ -2245,6 +2245,9 @@ ctype_read (struct linereader *ldfile, struct localedef_t *result,
              if (locfile_read (copy_locale, charmap) != 0)
                goto skip_category;
            }
+
+         if (copy_locale->categories[LC_CTYPE].ctype == NULL)
+           return;
        }
 
       lr_ignore_rest (ldfile, 1);
@@ -2256,8 +2259,6 @@ ctype_read (struct linereader *ldfile, struct localedef_t *result,
   /* Prepare the data structures.  */
   ctype_startup (ldfile, result, charmap, copy_locale, ignore_content);
   ctype = result->categories[LC_CTYPE].ctype;
-  if (ctype == NULL)
-    return;
 
   /* Remember the repertoire we use.  */
   if (!ignore_content)
@@ -3768,7 +3769,7 @@ translit_flatten (struct locale_ctype_t *ctype,
 
       other = find_locale (LC_CTYPE, copy_locale, copy_repertoire, charmap);
 
-      if (other == NULL)
+      if (other == NULL || other->categories[LC_CTYPE].ctype == NULL)
        {
          WITH_CUR_LOCALE (error (0, 0, _("\
 %s: transliteration data from locale `%s' not available"),
index 64d898a61bcb995cdd6b9babfb065198c39acc1e..d37e5213671079d51e4dd439911cadffb5682863 100644 (file)
@@ -2061,7 +2061,9 @@ nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 typedef struct malloc_chunk* mbinptr;
 
 /* addressing -- note that bin_at(0) does not exist */
-#define bin_at(m, i) ((mbinptr)((char*)&((m)->bins[(i)<<1]) - (SIZE_SZ<<1)))
+#define bin_at(m, i) \
+  (mbinptr) (((char *) &((m)->bins[((i) - 1) * 2]))                          \
+            - offsetof (struct malloc_chunk, fd))
 
 /* analog of ++bin */
 #define next_bin(b)  ((mbinptr)((char*)(b) + (sizeof(mchunkptr)<<1)))
@@ -2301,7 +2303,7 @@ struct malloc_state {
   mchunkptr        last_remainder;
 
   /* Normal bins packed as described above */
-  mchunkptr        bins[NBINS * 2];
+  mchunkptr        bins[NBINS * 2 - 2];
 
   /* Bitmap of bins */
   unsigned int     binmap[BINMAPSIZE];
@@ -3623,6 +3625,29 @@ public_rEALLOc(Void_t* oldmem, size_t bytes)
   (void)mutex_unlock(&ar_ptr->mutex);
   assert(!newp || chunk_is_mmapped(mem2chunk(newp)) ||
         ar_ptr == arena_for_chunk(mem2chunk(newp)));
+
+  if (newp == NULL)
+    {
+      /* Try harder to allocate memory in other arenas.  */
+      newp = public_mALLOc(bytes);
+      if (newp != NULL)
+       {
+         MALLOC_COPY (newp, oldmem, oldsize - 2 * SIZE_SZ);
+#if THREAD_STATS
+         if(!mutex_trylock(&ar_ptr->mutex))
+           ++(ar_ptr->stat_lock_direct);
+         else {
+           (void)mutex_lock(&ar_ptr->mutex);
+           ++(ar_ptr->stat_lock_wait);
+         }
+#else
+         (void)mutex_lock(&ar_ptr->mutex);
+#endif
+         _int_free(ar_ptr, oldmem);
+         (void)mutex_unlock(&ar_ptr->mutex);
+       }
+    }
+
   return newp;
 }
 #ifdef libc_hidden_def
@@ -4069,10 +4094,9 @@ _int_malloc(mstate av, size_t bytes)
   */
 
   for(;;) {
-#if 0
+
     int iters = 0;
     bool any_larger = false;
-#endif    
     while ( (victim = unsorted_chunks(av)->bk) != unsorted_chunks(av)) {
       bck = victim->bk;
       if (__builtin_expect (victim->size <= 2 * SIZE_SZ, 0)
@@ -4169,13 +4193,11 @@ _int_malloc(mstate av, size_t bytes)
       fwd->bk = victim;
       bck->fd = victim;
 
-#if 0
-      if (size >= nb)
+      if (size >= nb + MINSIZE)
        any_larger = true;
 #define MAX_ITERS      10000
       if (++iters >= MAX_ITERS)
        break;
-#endif
     }
 
     /*
@@ -4294,8 +4316,15 @@ _int_malloc(mstate av, size_t bytes)
         else {
           remainder = chunk_at_offset(victim, nb);
 
-          unsorted_chunks(av)->bk = unsorted_chunks(av)->fd = remainder;
-          remainder->bk = remainder->fd = unsorted_chunks(av);
+         /* We cannot assume the unsorted list is empty and therefore
+            have to perform a complete insert here.  */
+         bck = unsorted_chunks(av);
+         fwd = bck->fd;
+         remainder->bk = bck;
+         remainder->fd = fwd;
+         bck->fd = remainder;
+         fwd->bk = remainder;
+
           /* advertise as last remainder */
           if (in_smallbin_range(nb))
             av->last_remainder = remainder;
index 07a1d2f7a735b7a77944494089fa53648f5545e2..eb4680d15908cf00529c70893547947f8dfb0127 100644 (file)
@@ -1,3 +1,8 @@
+2006-08-25  Jakub Jelinek  <jakub@redhat.com>
+
+       * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libpthread):
+       Only define ifdef SHARED.
+
 2006-08-23  Ulrich Drepper  <drepper@redhat.com>
 
        * allocatestack.c (queue_stack): Move freeing of surplus stacks to...
index 4e0001af91bc7d629fcaeb2443d2457e93181e57..714ad49428dd29e44b0939e8b4427c47fd5d338d 100644 (file)
@@ -58,9 +58,10 @@ __libc_pthread_init (ptr, reclaim, functions)
 #endif
 }
 
-
+#ifdef SHARED
 libc_freeres_fn (freeres_libptread)
 {
   if (__libc_pthread_functions.ptr_freeres != NULL)
     __libc_pthread_functions.ptr_freeres ();
 }
+#endif