Commit graph

1892 commits

Author SHA1 Message Date
Elliott Hughes
40107623b0 am 778a68e1: Merge "Don\'t free anything when reporting leaks."
* commit '778a68e1e57408be04806b5bfc3150aade44bcbf':
  Don't free anything when reporting leaks.
2013-01-22 22:11:55 -08:00
Elliott Hughes
552e02fa9c am 5c8f75ef: Merge "Disable leak checking for mksh; it\'s way too leaky."
* commit '5c8f75ef8bd89498de1d1108efa54869a2784738':
  Disable leak checking for mksh; it's way too leaky.
2013-01-22 22:11:54 -08:00
Elliott Hughes
778a68e1e5 Merge "Don't free anything when reporting leaks." 2013-01-23 06:06:21 +00:00
Elliott Hughes
848247a972 Don't free anything when reporting leaks.
We don't know that they're not going to be cleaned up by a
C++ global destructor that runs after us. This is the case with
bootanimation, for example.

Bug: 7291287
Change-Id: Iba402514d1735fdc2ae4bc95b65396d816be46c0
2013-01-22 18:36:28 -08:00
Elliott Hughes
84f8b5f401 Disable leak checking for mksh; it's way too leaky.
When each shell leaks ~240 allocations, you can't see the leaks from
the program you ran with "adb shell".

Bug: 7291287
Change-Id: Ib8780db72ba0114ebdb24768537da74bbb61f354
2013-01-22 18:35:14 -08:00
Elliott Hughes
b16ec16288 am 28f82b26: Merge "Add const for first argument of sigismember for fit POSIX spec"
* commit '28f82b260c9076aae437dafb57193a174aef1eb3':
  Add const for first argument of sigismember for fit POSIX spec
2013-01-22 17:26:45 -08:00
Elliott Hughes
28f82b260c Merge "Add const for first argument of sigismember for fit POSIX spec" 2013-01-23 01:11:28 +00:00
Elliott Hughes
57edf36c5f am 8d6302cd: Merge "Our strcoll(3) is no different from NetBSD\'s, so take exactly theirs."
* commit '8d6302cdcff9c53fe3ecd36ab479fdf08318c504':
  Our strcoll(3) is no different from NetBSD's, so take exactly theirs.
2013-01-22 15:31:26 -08:00
Elliott Hughes
2b47307012 Our strcoll(3) is no different from NetBSD's, so take exactly theirs.
Change-Id: I45251047202a229f9175735ecc23c0ebcda71e8d
2013-01-22 15:10:19 -08:00
Elliott Hughes
5f7b6b8301 am 547eba0a: Merge "Avoid overflow in memccpy."
* commit '547eba0a63951d7db93c0542e1ecab891725b9a8':
  Avoid overflow in memccpy.
2013-01-22 15:05:31 -08:00
Elliott Hughes
c51cd764a2 Avoid overflow in memccpy.
Just take the upstream NetBSD code.

Bug: http://code.google.com/p/android/issues/detail?id=43078
Change-Id: Ibbbde9d00e8bc6a09c9503aab2b04b4e3d1f98b0
2013-01-22 14:41:23 -08:00
Elliott Hughes
0609c0fe8d am 7af7895e: Merge "Use the new non-allocating logging for dlmalloc failures."
* commit '7af7895eeb810ff1a1ca8b60fcda13595d551114':
  Use the new non-allocating logging for dlmalloc failures.
2013-01-22 14:32:02 -08:00
Elliott Hughes
7af7895eeb Merge "Use the new non-allocating logging for dlmalloc failures." 2013-01-22 22:26:35 +00:00
Elliott Hughes
ce4cf90d79 Use the new non-allocating logging for dlmalloc failures.
Change-Id: I88afe0201ee5766a295fc5a9e710fba9d6e0d363
2013-01-22 14:24:52 -08:00
Nick Kralevich
e652ed3051 am 244bee5b: Merge "bionic_auxv.h: fix #define conflict"
* commit '244bee5bb6e0bc12b739c57028ac8af23a18aed0':
  bionic_auxv.h: fix #define conflict
2013-01-22 13:38:53 -08:00
Nick Kralevich
abc21c8056 bionic_auxv.h: fix #define conflict
Both libc/include/sys/auxv.h and libc/private/bionic_auxv.h
use _SYS_AUXV_H_ to see if a header file has already been included.
This prevents both of these files from being included at the same
time.

Fix this name conflict.

Change-Id: Ifaec88aa9779d784b95f8e75145117acf3d5cfc5
2013-01-22 13:09:04 -08:00
Elliott Hughes
8ef83bc46e am 02f96b9d: Merge "Add missing extern "C"."
* commit '02f96b9db0242711fe1dfe0713c0c4e698561da5':
  Add missing extern "C".
2013-01-22 11:32:16 -08:00
Elliott Hughes
f90b95ea1a Add missing extern "C".
Change-Id: Idbf24ce8482ff03f24caa89bafb08677b1c5cec3
2013-01-22 11:20:45 -08:00
Elliott Hughes
75b64a1b64 am ca483765: Merge "Fix the duplication in the debugging code."
* commit 'ca483765bd0dc16294b9e67dd0de5c6d53b1bfa3':
  Fix the duplication in the debugging code.
2013-01-22 09:59:44 -08:00
Elliott Hughes
ca483765bd Merge "Fix the duplication in the debugging code." 2013-01-22 17:44:15 +00:00
Kito Cheng
f373b11f9f Add const for first argument of sigismember for fit POSIX spec
Change-Id: Icbc67375282f2a22dce02e4bacab15ddae846057
2013-01-20 00:15:23 +08:00
Elliott Hughes
1e980b6bc8 Fix the duplication in the debugging code.
We had two copies of the backtrace code, and two copies of the
libcorkscrew /proc/pid/maps code. This patch gets us down to one.

We also had hacks so we could log in the malloc debugging code.
This patch pulls the non-allocating "printf" code out of the
dynamic linker so everyone can share.

This patch also makes the leak diagnostics easier to read, and
makes it possible to paste them directly into the 'stack' tool (by
using relative PCs).

This patch also fixes the stdio standard stream leak that was
causing a leak warning every time tf_daemon ran.

Bug: 7291287
Change-Id: I66e4083ac2c5606c8d2737cb45c8ac8a32c7cfe8
2013-01-18 22:20:06 -08:00
Nick Kralevich
0a0c232167 am 4bfaf1e5: Merge "FORTIFY_SOURCE: optimize"
* commit '4bfaf1e5f62748b305406ff4ceebd5f4b750038c':
  FORTIFY_SOURCE: optimize
2013-01-17 17:04:33 -08:00
Nick Kralevich
4bfaf1e5f6 Merge "FORTIFY_SOURCE: optimize" 2013-01-18 00:49:36 +00:00
Elliott Hughes
261e9d08db am e4ca88d9: Merge "Add functionlity to the scripts to replace tokens in kernel headers based on architecture."
* commit 'e4ca88d9fa8757e4fb4056fcafa5bc15b406a2fd':
  Add functionlity to the scripts to replace tokens in kernel headers based on architecture.
2013-01-17 16:48:45 -08:00
Nick Kralevich
a44e9afdd1 FORTIFY_SOURCE: optimize
Don't do the fortify_source checks if we can determine, at
compile time, that the provided operation is safe.

This avoids silliness like calling fortify source on things like:

  size_t len = strlen("asdf");
  printf("%d\n", len);

and allows the compiler to optimize this code to:

  printf("%d\n", 4);

Defer to gcc's builtin functions instead of pointing our code
to the libc implementation.

Change-Id: I5e1dcb61946461c4afaaaa983e39f07c7a0df0ae
2013-01-17 15:41:33 -08:00
Raghu Gandham
a864c2c234 Add functionlity to the scripts to replace tokens in kernel headers
based on architecture.
2013-01-17 14:39:09 -08:00
Nick Kralevich
8d01c0557b am 1271cdc1: Merge "Revert "stack protector: use AT_RANDOM""
* commit '1271cdc1c91c6ae688917bc8f4ae59d2a97b3e99':
  Revert "stack protector: use AT_RANDOM"
2013-01-16 13:53:25 -08:00
Nick Kralevich
36bd371e26 Revert "stack protector: use AT_RANDOM"
The AT_RANDOM changes broke setuid / setgid executables
such as "ping". When the linker executes a setuid program,
it cleans the environment, removing any invalid environment
entries, and adding "NULL"s to the end of the environment
array for each removed variable. Later on, we try to determine
the location of the aux environment variable, and get tripped
up by these extra NULLs.

Reverting this patch will get setuid executables working again,
but getauxval() is still broken for setuid programs because of
this bug.

This reverts commit e3a49a8661.

Change-Id: I05c58a896b1fe32cfb5d95d43b096045cda0aa4a
2013-01-16 13:16:42 -08:00
Nick Kralevich
de666485b8 am ba117e41: Merge "stack protector: use AT_RANDOM"
* commit 'ba117e4172fe6f160bf5f4d58b37e12c08c34245':
  stack protector: use AT_RANDOM
2013-01-16 11:31:00 -08:00
Nick Kralevich
e3a49a8661 stack protector: use AT_RANDOM
Populate the stack canaries from the kernel supplied
AT_RANDOM value, which doesn't involve any system calls.
This is slightly faster (6 fewer syscalls) and avoids
unnecessarily reading /dev/urandom, which depletes entropy.

Bug: 7959813

Change-Id: If2b43100a2a9929666df3de56b6139fed969e0f1
2013-01-16 10:09:52 -08:00
Elliott Hughes
e611fad0d0 am 14e1975e: Merge "Fix signalfd for MIPS."
* commit '14e1975e13c197180ed0481f305f83a362b16a24':
  Fix signalfd for MIPS.
2013-01-16 09:45:57 -08:00
Elliott Hughes
f193b9fc21 Fix signalfd for MIPS.
Also mark signalfd's sigset_t* argument as non-nullable.

Change-Id: I466e09cdf3fb92480744c496da92274a97f99dd1
2013-01-16 09:40:25 -08:00
Elliott Hughes
acb907fb0d Revert "DO NOT MERGE Revert "Add the libcutils localtime_tz and mktime_t extensions to bionic.""
This reverts commit f4b34b6c39.

The revert was only meant to apply to the jb-mr1 branch, but accidentally
leaked out into AOSP. This revert-revert gets AOSP master and internal
master back in sync.
2013-01-15 11:12:18 -08:00
Ben Cheng
4130af46bf am b09d7d86: Merge "Add __aeabi_idiv to the dummy reference list."
* commit 'b09d7d86004ab75b774358454d8ee261987af96b':
  Add __aeabi_idiv to the dummy reference list.
2013-01-14 15:44:01 -08:00
Ben Cheng
35f5385aa5 Add __aeabi_idiv to the dummy reference list.
If the platform code is compiled with -mcpu=cortex-a15, then without this
change prebuilt libraries built against -march=armv7 cannot resolve the
dependency on __aeabi_idiv (provided by libgcc.a).

Bug: 7961327

cherry-picked from internal master.

Change-Id: I8fe59a98eb53d641518b882523c1d6a724fb7e55
2013-01-14 15:33:40 -08:00
Nick Kralevich
1519690cfb am 29fe857e: Merge "headers: update auxvec.h from Linux kernel"
* commit '29fe857ec80e59347e28458a5396eb68d1cba0e4':
  headers: update auxvec.h from Linux kernel
2013-01-14 14:31:28 -08:00
Nick Kralevich
a67e4de662 headers: update auxvec.h from Linux kernel
Pull a new version of auxvec.h from the upstream Linux
kernel at commit b719f43059903820c31edb30f4663a2818836e7f

These files were generated using the following commands:

cd bionic/libc/kernel
./tools/clean_header.py -u ../../../external/kernel-headers/original/uapi/linux/auxvec.h
./tools/clean_header.py -u ../../../external/kernel-headers/original/linux/auxvec.h
./tools/clean_header.py -u ../../../external/kernel-headers/original/asm-x86/auxvec.h

This change is needed to get AT_RANDOM defined.

Change-Id: Ib064649684b17af6ff4b1a31d501a05f78bb81d0
2013-01-14 11:49:59 -08:00
Ian Rogers
763d4bb345 am 68fa57f0: Merge "Name anonymous mmap mallocs."
* commit '68fa57f000285af20100c00db3d2bc143ad32294':
  Name anonymous mmap mallocs.
2013-01-14 11:19:00 -08:00
Ian Rogers
68fa57f000 Merge "Name anonymous mmap mallocs." 2013-01-14 10:54:44 -08:00
Nick Kralevich
13bd37160e am bb897fa9: Merge "libc_init_static: apply relro earlier."
* commit 'bb897fa9f79d25e4445fe3ab46b86657d6660c10':
  libc_init_static: apply relro earlier.
2013-01-14 10:25:16 -08:00
Nick Kralevich
9fb48ac257 libc_init_static: apply relro earlier.
The dynamic linker applies relro before the preinit and init
arrays are executed, so we should be consistent for statically
linked executables.

Change-Id: Ia0a49d0e981a6e8791f74eed00280edf576ba139
2013-01-11 18:38:26 -08:00
Ian Rogers
8921060253 Name anonymous mmap mallocs.
Change-Id: Icc53ba1eecb8445210623826d8e99a611d686f7f
2013-01-11 17:42:17 -08:00
Nick Kralevich
fdd6dfa863 am 2c5153b0: libc: add getauxval()
* commit '2c5153b043b44e9935a334ae9b2d5a4bc5258b40':
  libc: add getauxval()
2013-01-11 16:59:57 -08:00
Nick Kralevich
2c5153b043 libc: add getauxval()
Add support for getauxval().  This method allows a program an easy way
to retrieve information from the kernel auxiliary vector, and will
hopefully replace other clumsy ways of accessing this same information.

This particular function was also added to glibc in glibc 2.16.
See the following URLs for more details.

  * http://lwn.net/Articles/519085/
  * http://www.gnu.org/software/libc/manual/html_node/Auxiliary-Vector.html

This change is a prerequisite for bug 7959813.

Bug: http://code.google.com/p/android/issues/detail?id=38441
Change-Id: Iba19d899df334bddc6f4899077ece2fc87564ea8
2013-01-11 16:44:15 -08:00
Wink Saville
801aeefe2d am a12c5445: Fix unused warnings in pthread.c
* commit 'a12c54454f3a6132988b68873903f6e9eed7f384':
  Fix unused warnings in pthread.c
2013-01-11 10:12:12 -08:00
Wink Saville
a12c54454f Fix unused warnings in pthread.c
Change-Id: I0287aadb825fd8cda29dc976bce55d75a1279fc5
2013-01-10 16:30:22 -08:00
Elliott Hughes
0f9be1eaee am bfde0b6f: Merge "glibc 2.15 treats errno as signed in strerror(3)."
* commit 'bfde0b6fd9e5de545746ab963d3a05ed2a8014f6':
  glibc 2.15 treats errno as signed in strerror(3).
2013-01-10 16:27:26 -08:00
Elliott Hughes
e6e60065ff glibc 2.15 treats errno as signed in strerror(3).
And the only reason I hadn't done that in bionic is because I wanted to behave
the same as glibc.

Change-Id: I2cf1bf0aac82a748cd6305a2cabbac0790058570
2013-01-10 16:01:59 -08:00
Elliott Hughes
34c7a3c2b0 am 0d3700d9: Merge "Only have one copy of the kernel_sigset_t hack, and add more tests."
* commit '0d3700d957debe841c385f66a8026ca8b3755815':
  Only have one copy of the kernel_sigset_t hack, and add more tests.
2013-01-10 15:28:46 -08:00