The kernel has supported this syscall for quite some time now,
but bionic did not. Now that there is a need for it, let's
add it to bionic.
Change-Id: Ifcef3e46f1438d79435b600c4e6063857ab16903
This patch fixes a leak that occurs when creating a new
thread-specific DNS resolver state object.
Essentially, each thread that calls gethostbyname() or getaddrinfo()
at least once will leak a small memory block. Another leak happens
anytime these functions are called after a change of the network
settings.
The leak is insignificant and hard to notice on typical programs.
However, netd tends to create one new thread for each DNS request
it processes, and quickly grows in size after a > 20 hours.
The same problem is seen in other system processes that tend to
create one thread per request too.
The leak occured becasue res_ninit() was called twice when creating
a new thread-specific DNS resolver state in _res_get_thread().
This function could not properly reset an existing thread and was
leaking a memory block.
The patch does two things:
- First, it fixes res_ninit() to prevent any leakage when resetting
the state of a given res_state instance.
- Second, it modifies the _res_get_thread() implementation to
make it more explicit, and avoid calling res_ninit() twice
in a row on first-time creation.
Fix for Bug 4089945, and Bug 4090857
Change-Id: Ie4831a8dbe82be8f07fce5ddd1d36bf95994f836
Backport I110b653a58f3
All the other property stuff is already here. Property setting was
only in libcutils previously to leverage a utility function / constant
or two.
Unfortunately in the process of fixing a race condition we would've
had to do break abstraction boundaries and put some libc-internal
details into libcutils so instead of that we'll just move this
into bionic.
Along with Iee1ca9b7, this now passes:
$ adb shell am instrument -w -e class android.os.SystemPropertiesTest \
com.android.frameworks.coretests.systemproperties/android.test.InstrumentationTestRunner
Bug: 3511230
Change-Id: I1b588db3344169621e1279ecc0b660cf4e1015d7
Convert cname lenght before use
The length of the cname is sent in big-endian
order. Thus, it has to be converted before used
in android_getaddrinfo_proxy
Change-Id: I78552d427ef6500d9121fc83423f0744ea0c3087
The length of the cname is sent in big-endian
order. Thus, it has to be converted before used
in android_getaddrinfo_proxy
Change-Id: I1a0cc12780c47f7493fcf06f690515829f88c01e
This also incorporates a bunch of changes to the previous script; this one
requires no setup, can be run from anywhere, and leaves no droppings.
Change-Id: I38f299f03e33950d2a64e9336f4ba7cb3c5cf6f0
Used the new gensyscalls.py script to update the ARM syscalls with the
BEGIN(x) and END(x) macros to give size information for the code of the
syscall. Useful for valgrind.
Change-Id: I8c481c8928401ac110fd19b087f7d67e4db39326
Add size information to gensyscalls output for ARM syscalls with new
BEGIN(x) and END(x) macros in arch-arm/include/machine/asm.h
Change-Id: I791406f8b17abcb83b70a6d15a65a527de15d3f5
Add a macro to annotate function end and start using both ENTRY and END
for each function. This allows valgrind (and presumably other debugging
tools) to use the debug symbols to trace the functions.
Change-Id: I5f09cef8e22fb356eb6f5cee952b031e567599b6
Fix the handle locking in stdio to use flockfile/funlockfile
internally when and where required. Macros in <stdio.h> are updated
to automatically call the underlying functions when the process is
threaded to obtain the necessary locking. A private mutex is added
to protect __sglue, the internal list of FILE handles, and another
to protect the one-time initialization. Some routines in libc that
use getc() change to use getc_unlocked() as they're either protected
by their own lock or aren't thread-safe routines anyway.
Based on OpenBSD change by guenther@openbsd.orghttp://www.mail-archive.com/source-changes@cvs.openbsd.org/msg01015.html
Bug: 3446659
Change-Id: Ie82116e358c541718d6709ec45ca6796be5a007b
system_server loads up 87 shared libraries upon start. Running under
valgrind pushes this just over the edge of 96. Increase SO_MAX to 128 to
give us some more headroom.
Change-Id: Iadceb14ab6d9621bdccd292570d50867828057d9