[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commits] r3727 - in /fsf/trunk/libc: ./ math/ nscd/ sunrpc/ sysdeps/i386/ sysdeps/ieee754/dbl-64/ sysdeps/ieee754/flt-32/ sysdeps/iee...
- To: commits@xxxxxxxxxx
- Subject: [commits] r3727 - in /fsf/trunk/libc: ./ math/ nscd/ sunrpc/ sysdeps/i386/ sysdeps/ieee754/dbl-64/ sysdeps/ieee754/flt-32/ sysdeps/iee...
- From: eglibc@xxxxxxxxxx
- Date: Sun, 07 Oct 2007 07:03:22 -0000
Author: eglibc
Date: Sun Oct 7 00:03:21 2007
New Revision: 3727
Log:
Import glibc-mainline for 2007-10-07
Modified:
fsf/trunk/libc/ChangeLog
fsf/trunk/libc/math/libm-test.inc
fsf/trunk/libc/nscd/connections.c
fsf/trunk/libc/nscd/nscd_helper.c
fsf/trunk/libc/sunrpc/svc.c
fsf/trunk/libc/sysdeps/i386/dl-trampoline.S
fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_lgamma_r.c
fsf/trunk/libc/sysdeps/ieee754/flt-32/e_lgammaf_r.c
fsf/trunk/libc/sysdeps/ieee754/ldbl-96/e_lgammal_r.c
Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sun Oct 7 00:03:21 2007
@@ -1,3 +1,26 @@
+2007-10-06 Ulrich Drepper <drepper@xxxxxxxxxx>
+
+ [BZ #3924]
+ * sysdeps/i386/dl-trampoline.S (_dl_runtime_profile): Fix a few
+ more little bugs in creating the stack frame when pltexit has to
+ be called.
+
+ * nscd/nscd_helper.c (__nscd_cache_search): Prevent endless loops.
+ * nscd/connections.c (verify_persistent_db): Recognize circular lists.
+
+ [BZ #4407]
+ * sysdeps/ieee754/dbl-64/e_lgamma_r.c: Fix *signgamp for -0.0.
+ * sysdeps/ieee754/flt-32/e_lgammaf_r.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/e_lgammal_r.c: Likewise.
+ * math/libm-test.inc: Add test for this case.
+
+ [BZ #5010]
+ * sunrpc/svc.c (struct svc_callout): Add sc_mapped element.
+ (svc_register): Initialize sc_mapped. Set to TRUE if call to
+ map service succeeded.
+ (svc_is_mapped): New function.
+ (svc_unregister): Use it before trying to unmap service.
+
2007-10-05 Ulrich Drepper <drepper@xxxxxxxxxx>
* timezone/zic.c: Update from tzcode2007h.
@@ -20,7 +43,7 @@
* string/bits/string2.h (__strdup): Cast parameters to calloc to
avoid warning with -Wconversion.
(__strndup): Likewise.
- Patch to 50% by Christian Iseli <christian.iseli@xxxxxxxx>.
+ Half the patch by Christian Iseli <christian.iseli@xxxxxxxx>.
[BZ #5112]
* nscd/connections.c (restart): Don't resync if database is
Modified: fsf/trunk/libc/math/libm-test.inc
==============================================================================
--- fsf/trunk/libc/math/libm-test.inc (original)
+++ fsf/trunk/libc/math/libm-test.inc Sun Oct 7 00:03:21 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@xxxxxxx>, 1997.
@@ -3221,6 +3221,9 @@
TEST_f_f (lgamma, plus_infty, plus_infty);
TEST_f_f (lgamma, 0, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("signgam for lgamma(0) == 1", signgam, 1, 0, 0, 0);
+ TEST_f_f (lgamma, minus_zero, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("signgam for lgamma(-0) == -1", signgam, -1, 0, 0, 0);
TEST_f_f (lgamma, nan_value, nan_value);
/* lgamma (x) == +inf plus divide by zero exception for integer x <= 0. */
Modified: fsf/trunk/libc/nscd/connections.c
==============================================================================
--- fsf/trunk/libc/nscd/connections.c (original)
+++ fsf/trunk/libc/nscd/connections.c Sun Oct 7 00:03:21 2007
@@ -378,7 +378,9 @@
nscd_ssize_t he_cnt = 0;
for (nscd_ssize_t cnt = 0; cnt < head->module; ++cnt)
{
- ref_t work = head->array[cnt];
+ ref_t trail = head->array[cnt];
+ ref_t work = trail;
+ int tick = 0;
while (work != ENDREF)
{
@@ -437,6 +439,13 @@
}
work = here->next;
+
+ if (work == trail)
+ /* A circular list, this must not happen. */
+ goto fail;
+ if (tick)
+ trail = ((struct hashentry *) (data + trail))->next;
+ tick = 1 - tick;
}
}
Modified: fsf/trunk/libc/nscd/nscd_helper.c
==============================================================================
--- fsf/trunk/libc/nscd/nscd_helper.c (original)
+++ fsf/trunk/libc/nscd/nscd_helper.c Sun Oct 7 00:03:21 2007
@@ -416,7 +416,10 @@
unsigned long int hash = __nis_hash (key, keylen) % mapped->head->module;
size_t datasize = mapped->datasize;
- ref_t work = mapped->head->array[hash];
+ ref_t trail = mapped->head->array[hash];
+ ref_t work = trail;
+ int tick = 0;
+
while (work != ENDREF && work + sizeof (struct hashentry) <= datasize)
{
struct hashentry *here = (struct hashentry *) (mapped->data + work);
@@ -454,6 +457,23 @@
}
work = here->next;
+ /* Prevent endless loops. This should never happen but perhaps
+ the database got corrupted, accidentally or deliberately. */
+ if (work == trail)
+ break;
+ if (tick)
+ {
+ struct hashentry *trailelem;
+ trailelem = (struct hashentry *) (mapped->data + trail);
+
+#ifndef _STRING_ARCH_unaligned
+ /* We have to redo the checks. Maybe the data changed. */
+ if ((uintptr_t) trailelem & (__alignof__ (*trailelem) - 1))
+ return NULL;
+#endif
+ trail = trailelem->next;
+ }
+ tick = 1 - tick;
}
return NULL;
Modified: fsf/trunk/libc/sunrpc/svc.c
==============================================================================
--- fsf/trunk/libc/sunrpc/svc.c (original)
+++ fsf/trunk/libc/sunrpc/svc.c Sun Oct 7 00:03:21 2007
@@ -61,6 +61,7 @@
rpcprog_t sc_prog;
rpcvers_t sc_vers;
void (*sc_dispatch) (struct svc_req *, SVCXPRT *);
+ bool_t sc_mapped;
};
#ifdef _RPC_THREAD_SAFE_
#define svc_head RPC_THREAD_VARIABLE(svc_head_s)
@@ -160,6 +161,17 @@
return s;
}
+
+static bool_t
+svc_is_mapped (rpcprog_t prog, rpcvers_t vers)
+{
+ struct svc_callout *prev;
+ register struct svc_callout *s;
+ s = svc_find (prog, vers, &prev);
+ return s!= NULL_SVC && s->sc_mapped;
+}
+
+
/* Add a service program to the callout list.
The dispatch routine will be called when a rpc request for this
program number comes in. */
@@ -185,12 +197,18 @@
s->sc_vers = vers;
s->sc_dispatch = dispatch;
s->sc_next = svc_head;
+ s->sc_mapped = FALSE;
svc_head = s;
pmap_it:
/* now register the information with the local binder service */
if (protocol)
- return pmap_set (prog, vers, protocol, xprt->xp_port);
+ {
+ if (! pmap_set (prog, vers, protocol, xprt->xp_port))
+ return FALSE;
+
+ s->sc_mapped = TRUE;
+ }
return TRUE;
}
@@ -214,7 +232,8 @@
s->sc_next = NULL_SVC;
mem_free ((char *) s, (u_int) sizeof (struct svc_callout));
/* now unregister the information with the local binder service */
- pmap_unset (prog, vers);
+ if (! svc_is_mapped (prog, vers))
+ pmap_unset (prog, vers);
}
libc_hidden_def (svc_unregister)
Modified: fsf/trunk/libc/sysdeps/i386/dl-trampoline.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/dl-trampoline.S (original)
+++ fsf/trunk/libc/sysdeps/i386/dl-trampoline.S Sun Oct 7 00:03:21 2007
@@ -113,6 +113,7 @@
movl %ebx, %ecx
orl $4, %ebx # Increase frame size if necessary to align
# stack for the function call
+ andl $~3, %ebx
movl %esp, %edi
subl %ebx, %edi
movl %esp, %ebx
@@ -121,9 +122,9 @@
shrl $2, %ecx
rep
movsl
- movl (%edi), %esi
+ movl (%ebx), %esi
cfi_restore (esi)
- movl 4(%edi), %edi
+ movl 4(%ebx), %edi
cfi_restore (edi)
/*
%ebx+40 return address
Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_lgamma_r.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_lgamma_r.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_lgamma_r.c Sun Oct 7 00:03:21 2007
@@ -228,7 +228,12 @@
*signgamp = 1;
ix = hx&0x7fffffff;
if(ix>=0x7ff00000) return x*x;
- if((ix|lx)==0) return one/fabs(x);
+ if((ix|lx)==0)
+ {
+ if (hx < 0)
+ *signgamp = -1;
+ return one/fabs(x);
+ }
if(ix<0x3b900000) { /* |x|<2**-70, return -log(|x|) */
if(hx<0) {
*signgamp = -1;
Modified: fsf/trunk/libc/sysdeps/ieee754/flt-32/e_lgammaf_r.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/flt-32/e_lgammaf_r.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/flt-32/e_lgammaf_r.c Sun Oct 7 00:03:21 2007
@@ -164,7 +164,12 @@
*signgamp = 1;
ix = hx&0x7fffffff;
if(ix>=0x7f800000) return x*x;
- if(ix==0) return one/fabsf(x);
+ if(ix==0)
+ {
+ if (hx < 0)
+ *signgamp = -1;
+ return one/fabsf(x);
+ }
if(ix<0x1c800000) { /* |x|<2**-70, return -log(|x|) */
if(hx<0) {
*signgamp = -1;
Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-96/e_lgammal_r.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-96/e_lgammal_r.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-96/e_lgammal_r.c Sun Oct 7 00:03:21 2007
@@ -11,9 +11,9 @@
/* Long double expansions are
Copyright (C) 2001 Stephen L. Moshier <moshier@xxxxxxxxxxxxxxx>
- and are incorporated herein by permission of the author. The author
+ and are incorporated herein by permission of the author. The author
reserves the right to distribute this material elsewhere under different
- copying permissions. These modifications are distributed here under
+ copying permissions. These modifications are distributed here under
the following terms:
This library is free software; you can redistribute it and/or
@@ -302,7 +302,11 @@
ix = se & 0x7fff;
if ((ix | i0 | i1) == 0)
- return one / fabsl (x);
+ {
+ if (se & 0x8000)
+ *signgamp = -1;
+ return one / fabsl (x);
+ }
ix = (ix << 16) | (i0 >> 16);