Ulrich Drepper [Sun, 1 Nov 2009 15:27:00 +0000 (07:27 -0800)]
Restore locking in free_check.
This code is only used when MALLOC_CHECK_ is used. Then some bogus
crashes and/or assert could result from the locking changes. The code
ain't fast.
(cherry picked from commit cc49a5a8837be1f9307b167d9bf4399798a847c9)
Andreas Schwab [Fri, 6 Nov 2009 17:29:24 +0000 (09:29 -0800)]
Correct readahead syscall wrapper on powerpc32.
Due to alignment of 64bit parameters there is a dummy second argument.
But other than that the syscall arguments are directly mapped to the
function arguments.
(cherry picked from commit 5b55d23611e939340d658f42212c474c8188053e)
Jakub Jelinek [Fri, 6 Nov 2009 17:26:31 +0000 (09:26 -0800)]
Fix preadv, pwritev and fallocate for -D_FILE_OFFSET_BITS=64.
As reported in http://bugzilla.redhat.com/533063 , preadv/pwritev prototypes
are wrong on 32-bit arches with -D_FILE_OFFSET_BITS=64 and as I've just
found, fallocate is wrong too.
The problem is that only off_t is remapped to the 64-bit type transparently,
__off_t is not.
(cherry picked from commit 34df851b3364e14133b865574dbc5f2a8b88874e)
localedef got into an endless loop in case order_start was used for
the unnamed_section twice and the first use didn't actually result
into any definition.
(cherry picked from commit 7a7e49c020125d444fec7fded51bd5f82bfc8c49)
Andreas Schwab [Tue, 1 Sep 2009 22:36:22 +0000 (15:36 -0700)]
Cleanup _IO_wfile_seekoff.
This reformulates the in-buffer optimisation check to match the code in
_IO_new_file_seekoff. No functional changes, but easier to understand.
(cherry picked from commit d840539e1271020600edba752e6ee908c00f66eb)
Ulrich Drepper [Mon, 31 Aug 2009 11:56:07 +0000 (04:56 -0700)]
Fix problems with memory allocation in assert.
In case the allocator is corrupted and an assert triggers, we shouldn't
allocate any more memory. Use a private assert definition which doesn't
use malloc.
Jakub Jelinek [Fri, 31 Jul 2009 14:26:36 +0000 (07:26 -0700)]
Fix obstack* on i?86
obstack calls several callbacks, so on i?86 it'd better be compiled
without -mpreferred-stack-boundary=2, otherwise the callbacks are called
with misaligned stack.
(cherry picked from commit 1877ea16ca0714abd715d6ce0aa1b840c3850241)
Handle missing NSS modules and those without callbacks.
getaddrinfo didn't update the status variable in that round of the
loop if no callback was used.
(cherry picked from commit 657317537c09b82a2feb1194fda045f63e3a1222)
Ulrich Drepper [Tue, 16 Jun 2009 22:58:07 +0000 (15:58 -0700)]
Extend pt_chown to drop privileges.
If libcap is available, use it to drop privileges in pt_chown before
starting the work to change the permissions and ownership of the
slave device.
(cherry picked from commit f793b62438a3cfdbcc5ba453eebee1db3f315bea)
Jakub Jelinek [Fri, 22 May 2009 15:25:34 +0000 (08:25 -0700)]
Implement accept4 for more archs using socketcall.
So far accept4 was only supported on archs using socketcall for x86.
This patch adds support for the remaining archs.
(cherry picked from commit 1e1dc4e82dd4f31b87440388614c3e4bccdd5f3c)
Andreas Schwab [Thu, 16 Jul 2009 16:57:32 +0000 (09:57 -0700)]
Use correct release semantic in list update.
nscd uses lockfree lists and we need to ensure the correct release
semantics is used when adding to the list.
(cherry picked from commit 50158f95525ca59459a90f2a7bc65ceb892a0807)
With atomic fastbins the checks performed can race with concurrent
modifications of the arena. If we detect a problem re-do the test
after getting the lock.
(cherry picked from commit bec466d922ee22b94ac0d00415fb605e136efe6e)
Jakub Jelinek [Thu, 16 Jul 2009 14:24:50 +0000 (07:24 -0700)]
Use rel semantics of cas instead of acq semantics with full barrier before it in _int_free
The following patch fixes catomic_compare_and_exchange_*_rel definitions
(which were never used and weren't correct) and uses
catomic_compare_and_exchange_val_rel in _int_free. Comparing to the
pre-2009-07-02 --enable-experimental-malloc state the generated code should
be identical on all arches other than ppc/ppc64 and on ppc/ppc64 should use
lwsync instead of isync barrier.
Fix getent networks lookup and resulting incorrect NSS change.
I changed the files NSS backend for networks because I thought the
getent use of getnetbyaddr is correct. But it isn't. Undo parts
of the last change and fix getent.
(cherry picked from commit 5cd1f906c34256abdccc92052fbbde51fd70a565)
There were two problems in the getnetbyaddr implementation. The type
argument is pretty much useless since (almost) no input file contains
this information and the NSS backends make up the value they fill in
for the n_addrtype field. Therefore we now declare that passing AF_UNSPEC
is always recognized. Secondly, the files backend didn't compare the network
numbers with the correct endianess.
Also change getent to take advantage of the type parameter change.
Ryan S. Arnold [Tue, 16 Jun 2009 15:29:04 +0000 (08:29 -0700)]
Fix incorrect use of cmpldi in 32-bit PPC code.
The 32-bit PowerPC POWER6 memcpy uses the cmpldi insn when it should use a cmplwi.
BZ #10107
(cherry picked from commit 25bfbb9e0e610afaf6b67e5ee1a1a5338018c42e)
Ulrich Drepper [Tue, 16 Jun 2009 05:56:51 +0000 (22:56 -0700)]
Fix permission of slave device on devpts if necessary.
If devptr is misconfigured the slave device permission after grantpt
might not be 0620. BZ #10166
(cherry picked from commit 292e3abebff9f94ca47c1a725a691cb6ed6cff5f)
Ulrich Drepper [Mon, 15 Jun 2009 18:00:08 +0000 (11:00 -0700)]
Fix computation of tzspec_len.
Without this it should never have worked that we can use the
embedded envvar in the timezone data files for dates after the last
matching rule.
(cherry picked from commit 6355c99740c91ed5a7fa14e378f74950e09f5f48)
Ulrich Drepper [Thu, 11 Jun 2009 17:07:33 +0000 (10:07 -0700)]
Remember we switched to single-request mode.
This change prevents repetition in most later calls of the resolver
in case the DNS server or the network connection is broken.
(cherry picked from commit 310647e9809986986650994d036af18ca9b17fb2)
Ulrich Drepper [Fri, 29 May 2009 19:00:22 +0000 (12:00 -0700)]
Fix errno for boundary conditions in 128-bit long double.
Similar to the changes which went already in for the other formats,
follow POSIX rules for errno.
(cherry picked from commit 7f3394bdf34e28b374e5569a7a74ddac734fb172)
Aurelien Jarno [Wed, 27 May 2009 23:41:00 +0000 (16:41 -0700)]
[BZ #10200]
* db-symbols.awk: Use the last field for the symbol name instead
of the 8th one.
(cherry picked from commit 8ee84bd01f85b5ab1430750270b7e51a967d03eb)
Ulrich Drepper [Fri, 22 May 2009 01:47:59 +0000 (18:47 -0700)]
Fix IA-64 memchr read-ahead.
The latest stratcliff extension exposed a bug in the IA-64 memchr which
uses non-speculative loads to prefetch data. Change the code to use
speculative loads with appropriate fixup. Fixes BZ 10162.
(cherry picked from commit fa64b7f76b97930cd2aaf7bfd305cac3d925cd8f)
Jakub Jelinek [Fri, 22 May 2009 01:16:59 +0000 (18:16 -0700)]
Remove __NR_accept4 definition.
This definition was meant to be removed before the checkin. It was
used in the development.
(cherry picked from commit d14eda9310125ddf8fe66df01bbe46ab7d226a5e)
Jakub Jelinek [Mon, 18 May 2009 17:19:50 +0000 (10:19 -0700)]
Fix forced loop termination in nscd database lookup.
There are two issues with the forced loop exit in the nscd lookup:
1. the estimate of the entry size isn't pessimistic enough for all
databases, resulting potentially is too early exits
2. the combination of 64-bit process and 32-bit nscd would lead to
rejecting valid records in the database.
(cherry picked from commit 5078fff6c4bc1c71c5d558ff7ec4775aa48b0c11)
Ulrich Drepper [Sat, 16 May 2009 17:29:43 +0000 (10:29 -0700)]
Move BLOCK_ALIGN* macros back.
The move to nscd-client.h was only needed for some interim version
of the patch. The final version doesn't need it. Undo the change.
(cherry picked from commit fa546abe9d0346d5d87b8fe19884993408476d77)
Ulrich Drepper [Sat, 16 May 2009 04:33:43 +0000 (21:33 -0700)]
Further robustify nscd database lookup.
We can compute an absolute maximum for the number of elements which
can fit into the currently mapped database. Stop after that many
iterations.
(cherry picked from commit 831a40494d44045c0caaf8085ab1d35c0da23140)
Jakub Jelinek [Sat, 16 May 2009 04:17:08 +0000 (21:17 -0700)]
Robustify libc-side nscd database reader.
The nscd database mapped in processes can change at any time. We
have to be more vigilant when it comes to using that memory. Test
the data entries are valid in their entire size, don't read data
again from memory once we verified it, and make sure the trailing
pointer is not going off the deep end.
(cherry picked from commit cfe1fc1013d0e7e4863c974fa0e78891cc0a2ed2)
Jakub Jelinek [Sat, 16 May 2009 03:48:08 +0000 (20:48 -0700)]
Don't try to cleanup libselinux and libaudit.
Because we are not shutting down the other threads first another
thread might work on a query before the process shuts down. In this
case the now uninitialized libselinux and libaudit might be used.
Just don't free the resources. It's not necessary anyway because
the process is about to terminate.
(cherry picked from commit 9e471dad8e173806cbbfb704875d5ae40e36fa34)
(fixed ChangeLog entry by pasky)
Ulrich Drepper [Sat, 16 May 2009 03:42:36 +0000 (20:42 -0700)]
Fix change to prevent cancel signal in unsafe places.
The bits tested to decide when to delay the return when switching
off async cancel mode were wrong. Fix that. Also close a race
condition in pthread_cancel where the bit indicating the cancellation
is unconditionally set even if the cancel type might have changed.
(cherry picked from commit 9437b427cec6266abd303983848549a5c4ba0d0a)
Ulrich Drepper [Fri, 15 May 2009 17:12:35 +0000 (10:12 -0700)]
No cancel signal in unsafe places.
When disabling async cancellation we cannot return from the function
call if the thread is canceled. This happens when the cancel bits
have been set before async cancel is disabled but the signal hasn't
been sent/received yet. Delay for as long as necessary since
otherwise the signal might be received in an unsafe context.
(cherry picked from commit 1a7f254b4b0590bfab1baa1400705265b1b23b97)