This is the mail archive of the glibc-cvs@sourceware.org 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]
Other format: [Raw text]

GNU C Library master sources branch release/2.23/master updated. glibc-2.23-76-ga69d261


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, release/2.23/master has been updated
       via  a69d26143b80cb1927481509279577c57bc22ba4 (commit)
      from  23446cad92195d8c50092410b4f72ca7f6d1d2f1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a69d26143b80cb1927481509279577c57bc22ba4

commit a69d26143b80cb1927481509279577c57bc22ba4
Author: Florian Weimer <fweimer@redhat.com>
Date:   Tue Jun 21 21:29:21 2016 +0200

    malloc: Avoid premature fallback to mmap [BZ #20284]
    
    Before this change, the while loop in reused_arena which avoids
    returning a corrupt arena would never execute its body if the selected
    arena were not corrupt.  As a result, result == begin after the loop,
    and the function returns NULL, triggering fallback to mmap.
    
    (cherry picked from commit a3b473373ee43a292f5ec68a7fda6b9cfb26a9b0)

diff --git a/ChangeLog b/ChangeLog
index 178aab2..39a262a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-06-21  Florian Weimer  <fweimer@redhat.com>
+
+	[BZ #20284]
+	* malloc/arena.c (reused_arena): Do not return NULL if we start
+	out with a non-corrupted arena.
+
 2016-08-15  Andreas Schwab  <schwab@suse.de>
 
 	[BZ #20435]
diff --git a/malloc/arena.c b/malloc/arena.c
index 0e5cc0f..232b6a2 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -795,14 +795,12 @@ reused_arena (mstate avoid_arena)
     {
       result = result->next;
       if (result == begin)
-	break;
+	/* We looped around the arena list.  We could not find any
+	   arena that was either not corrupted or not the one we
+	   wanted to avoid.  */
+	return NULL;
     }
 
-  /* We could not find any arena that was either not corrupted or not the one
-     we wanted to avoid.  */
-  if (result == begin || result == avoid_arena)
-    return NULL;
-
   /* No arena available without contention.  Wait for the next in line.  */
   LIBC_PROBE (memory_arena_reuse_wait, 3, &result->mutex, result, avoid_arena);
   (void) mutex_lock (&result->mutex);

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog      |    6 ++++++
 malloc/arena.c |   10 ++++------
 2 files changed, 10 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


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