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.12-229-gfb88ac7
- From: drepper at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 9 Dec 2010 17:13:18 -0000
- Subject: GNU C Library master sources branch, master, updated. glibc-2.12-229-gfb88ac7
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 fb88ac72c2dcbbd979c8798e4ea497818bb3e171 (commit)
from 42acbb92c861e97a6e1293ea853db88342a1bf53 (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://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=fb88ac72c2dcbbd979c8798e4ea497818bb3e171
commit fb88ac72c2dcbbd979c8798e4ea497818bb3e171
Author: Ulrich Drepper <drepper@gmail.com>
Date: Thu Dec 9 12:12:58 2010 -0500
Fix race in qsort_r initialization.
diff --git a/ChangeLog b/ChangeLog
index 1d5801a..66ed415 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-12-09 Ulrich Drepper <drepper@gmail.com>
+
+ [BZ #11655]
+ * stdlib/msort.c (qsort_r): Make sure both phys_pages and pagesize
+ are initialized.
+
2010-12-09 Jakub Jelinek <jakub@redhat.com>
* string/bits/string3.h (memmove, bcopy): Remove __restrict.
diff --git a/stdlib/msort.c b/stdlib/msort.c
index 35cd4d0..fc58f0d 100644
--- a/stdlib/msort.c
+++ b/stdlib/msort.c
@@ -25,6 +25,7 @@
#include <unistd.h>
#include <memcopy.h>
#include <errno.h>
+#include <atomic.h>
struct msort_param
{
@@ -182,7 +183,7 @@ qsort_r (void *b, size_t n, size_t s, __compar_d_fn_t cmp, void *arg)
static long int phys_pages;
static int pagesize;
- if (phys_pages == 0)
+ if (pagesize == 0)
{
phys_pages = __sysconf (_SC_PHYS_PAGES);
@@ -197,6 +198,9 @@ qsort_r (void *b, size_t n, size_t s, __compar_d_fn_t cmp, void *arg)
a quarter of the physical memory. */
phys_pages /= 4;
+ /* Make sure phys_pages is written to memory. */
+ atomic_write_barrier ();
+
pagesize = __sysconf (_SC_PAGESIZE);
}
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 ++++++
stdlib/msort.c | 6 +++++-
2 files changed, 11 insertions(+), 1 deletions(-)
hooks/post-receive
--
GNU C Library master sources