This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.22-124-gc3b9ef8
- From: siddhesh at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 24 Aug 2015 09:07:06 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.22-124-gc3b9ef8
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, master has been updated
via c3b9ef8dfc83e9d17da5adc73709d2f7dfbbaf13 (commit)
via 92a9b22d70b85b7edd0484db8bf2465a969fb09e (commit)
from be481652f272acc117907ac30157cdac46aa1973 (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=c3b9ef8dfc83e9d17da5adc73709d2f7dfbbaf13
commit c3b9ef8dfc83e9d17da5adc73709d2f7dfbbaf13
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date: Mon Aug 24 14:33:07 2015 +0530
Don't use the main arena in retry path if it is corrupt
If allocation on a non-main arena fails, the main arena is used
without checking to see if it is corrupt. Add a check that avoids the
main arena if it is corrupt.
* malloc/arena.c (arena_get_retry): Don't use main_arena if it is
corrupt.
diff --git a/ChangeLog b/ChangeLog
index 1b5b03e..dae71ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2015-08-24 Siddhesh Poyarekar <siddhesh@redhat.com>
+ * malloc/arena.c (arena_get_retry): Don't use main_arena if it
+ is corrupt.
+
* malloc/arena.c (arena_get2): Drop unused argument.
(arena_lock): Adjust.
(arena_get_retry): Likewise.
diff --git a/malloc/arena.c b/malloc/arena.c
index cfec94d..b44e307 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -909,6 +909,10 @@ arena_get_retry (mstate ar_ptr, size_t bytes)
if (ar_ptr != &main_arena)
{
(void) mutex_unlock (&ar_ptr->mutex);
+ /* Don't touch the main arena if it is corrupt. */
+ if (arena_is_corrupt (&main_arena))
+ return NULL;
+
ar_ptr = &main_arena;
(void) mutex_lock (&ar_ptr->mutex);
}
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=92a9b22d70b85b7edd0484db8bf2465a969fb09e
commit 92a9b22d70b85b7edd0484db8bf2465a969fb09e
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date: Mon Aug 24 14:32:07 2015 +0530
Drop unused first argument from arena_get2
The arena pointer in the first argument to arena_get2 was used in the
old days before per-thread arenas. They're unused now and hence can
be dropped.
ChangeLog:
* malloc/arena.c (arena_get2): Drop unused argument.
(arena_lock): Adjust.
(arena_get_retry): Likewise.
diff --git a/ChangeLog b/ChangeLog
index 2797de4..1b5b03e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-08-24 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * malloc/arena.c (arena_get2): Drop unused argument.
+ (arena_lock): Adjust.
+ (arena_get_retry): Likewise.
+
2015-08-24 Andreas Schwab <schwab@suse.de>
* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_IPC64):
diff --git a/malloc/arena.c b/malloc/arena.c
index 21ecc5a..cfec94d 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -102,7 +102,7 @@ int __malloc_initialized = -1;
if (ptr && !arena_is_corrupt (ptr)) \
(void) mutex_lock (&ptr->mutex); \
else \
- ptr = arena_get2 (ptr, (size), NULL); \
+ ptr = arena_get2 ((size), NULL); \
} while (0)
/* find the heap and corresponding arena for a given ptr */
@@ -849,7 +849,7 @@ out:
static mstate
internal_function
-arena_get2 (mstate a_tsd, size_t size, mstate avoid_arena)
+arena_get2 (size_t size, mstate avoid_arena)
{
mstate a;
@@ -914,10 +914,8 @@ arena_get_retry (mstate ar_ptr, size_t bytes)
}
else
{
- /* Grab ar_ptr->next prior to releasing its lock. */
- mstate prev = ar_ptr->next ? ar_ptr : 0;
(void) mutex_unlock (&ar_ptr->mutex);
- ar_ptr = arena_get2 (prev, bytes, ar_ptr);
+ ar_ptr = arena_get2 (bytes, ar_ptr);
}
return ar_ptr;
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 9 +++++++++
malloc/arena.c | 12 +++++++-----
2 files changed, 16 insertions(+), 5 deletions(-)
hooks/post-receive
--
GNU C Library master sources