Unlock mutex before going back to waiting for PI mutexes
[BZ #14417]
A futex call with FUTEX_WAIT_REQUEUE_PI returns with the mutex locked
on success. If such a successful thread is pipped to the cond_lock by
another spuriously woken waiter, it could be sent back to wait on the
futex with the mutex lock held, thus causing a deadlock. So it is
necessary that the thread relinquishes the mutex before going back to
sleep.
Dmitry V. Levin [Thu, 23 Aug 2012 14:29:43 +0000 (14:29 +0000)]
nscd: fix compilation flags
Commit 61653dfb81b776bb72ce4304175b861d77c357a8 added support for
compilers predefining _FORTIFY_SOURCE by adding -U_FORTIFY_SOURCE to
CPPFLAGS for these compilers, but that change doesn't work quite well in
case of nscd: its Makefile sets _FORTIFY_SOURCE using CFLAGS instead of
CPPFLAGS and, thanks to compilation rules defined in Makerules, CPPFLAGS
are passed to compiler after CFLAGS, resulting to a build with
_FORTIFY_SOURCE turned off.
This change implements a more safe method of passing preprocessor and
compiler flags so that no nscd modules could be accidentally forgotten.
Jeff Law [Mon, 1 Oct 2012 21:32:39 +0000 (15:32 -0600)]
2012-10-01 Patsy Franklin <pfrankli@redhat.com>
Honza Horak <hhorak@redhat.com>
* nis/yp_xdr.c (xdr_domainname): Use YPMAXDOMAIN as maxsize.
(xdr_mapname): Use YPMAXMAP as maxsize.
(xdr_peername): Use YPMAXPEER as maxsize.
(xdr_keydat): Use YPAXRECORD as maxsize.
(xdr_valdat): Use YPMAXRECORD as maxsize.
[BZ #14477]
Add an additional entry in the exception table to jump to
__condvar_w_cleanup2 instead of __condvar_w_cleanup for PI mutexes
when %ebx contains the address of the futex instead of the condition
variable.
David S. Miller [Fri, 28 Sep 2012 20:02:42 +0000 (13:02 -0700)]
Add Niagara-4 optimized memcpy and mempcpy.
* sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S: New file.
* sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-niagara4.S: New
file.
* sysdeps/sparc/sparc64/multiarch/Makefile: Add to
sysdep_routines.
* sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile: Likewise.
* sysdeps/sparc/sparc64/multiarch/memcpy.S: Use Niagara-4 memcpy
and mempcpy when HWCAP_SPARC_CRYPTO is set.
* stdio-common/Makefile (tst-sprintf-ENV): Set environment
for testcase.
* stdio-common/tst-sprintf.c: Include <locale.h>
(main): Test sprintf's handling of incomplete multibyte
characters.
Jeff Law [Fri, 28 Sep 2012 16:15:05 +0000 (10:15 -0600)]
[BZ #11438]
* sysdeps/posix/getaddrinfo.c (default_scopes): Map RFC 1918
* addresses
to global scope.
* posix/tst-rfc3484.c: Verify 10/8, 172.16/12 and 196.128/16
addresses are in the same scope as 192.0.2/24.
* posix/gai.conf: Document new scope table defaults.
Adjust wide data buffer pointers during fseek and ftell
[BZ #14543]
Set the internal buffer state correctly whenever the external buffer
state is modified by fseek by either computing the current
_IO_read_ptr/end for the internal buffer based on the new _IO_read_ptr
in the external buffer or converting the content read into the
external buffer, up to the extent of the requested fseek offset.
David S. Miller [Fri, 28 Sep 2012 04:33:54 +0000 (21:33 -0700)]
Fix sparc64 crashes with LD_BIND_NOW and --enable-bind-now.
[BZ #14376]
* sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela): Do not
pass reloc->r_addend in as the 'high' argument to
sparc64_fixup_plt when handling R_SPARC_JMP_IREL relocations.
Steve Ellcey [Thu, 27 Sep 2012 21:07:15 +0000 (14:07 -0700)]
Remove sysdeps/ieee754/ldbl-128/bits/huge_vall.h and let builds use
bits/huge_vall.h instead. There is no longer any need for the special
huge_vall.h file.
Steve Ellcey [Thu, 27 Sep 2012 21:06:11 +0000 (14:06 -0700)]
Remove sysdeps/ieee754/ldbl-128/bits/huge_vall.h and let builds
use bits/huge_vall.h instead. There is no longer any need for
the special huge_vall.h file.
Release barriers are needed to ensure that any memory written by
init_routine is seen by other threads before *once_control changes.
In the case of clear_once_control we need to flush any partially
written state.
Using madvise with MADV_DONTNEED to release memory back to the kernel
is not sufficient to change the commit charge accounted against the
process on Linux. It is OK however, when overcommit is enabled or is
heuristic. However, when overcommit is restricted to a percentage of
memory setting the contents of /proc/sys/vm/overcommit_memory as 2, it
makes a difference since memory requests will fail. Hence, we do what
we do with secure exec binaries, which is to call mmap on the region
to be dropped with MAP_FIXED. This internally unmaps the pages in
question and reduces the amount of memory accounted against the
process.
Carlos O'Donell [Thu, 20 Sep 2012 14:39:27 +0000 (10:39 -0400)]
hppa: Use __prlimit64 as the internal name.
Fix a build failure by using __prlimit64 as the internal
function name for the versioned symbol prlimit64. Without
this patch the build system attempts to alias prlimit64
to itself and that is invalid.
Dmitry V. Levin [Wed, 22 Aug 2012 00:43:21 +0000 (00:43 +0000)]
rtld: limit self loading check to normal mode only
Commit glibc-2.14~10 disallowed rtld self loading to avoid a segfault
that used to happen when rtld was loading itself in normal mode.
Unfortunately, that commit disallowed all modes of self loading,
including those that used to work before. This change limits the check
for self loading to normal mode only, so that instruments like ldd could
handle rtld properly.