OSDN Git Service

android-x86/bionic.git
8 years agoMerge "Add hasmntopt(3)"
Greg Hackmann [Fri, 25 Mar 2016 22:50:04 +0000 (22:50 +0000)]
Merge "Add hasmntopt(3)"
am: d132099

* commit 'd132099e0597276dea1faa30d674256309c99736':
  Add hasmntopt(3)

8 years agoMerge "Add hasmntopt(3)"
Greg Hackmann [Fri, 25 Mar 2016 22:43:00 +0000 (22:43 +0000)]
Merge "Add hasmntopt(3)"

8 years agoMerge "libc: implement kernel vdso syscalls for i386"
Mingwei Shi [Fri, 25 Mar 2016 22:29:02 +0000 (22:29 +0000)]
Merge "libc: implement kernel vdso syscalls for i386"
am: d81143d

* commit 'd81143df7196509596ede621d635f90421ad152b':
  libc: implement kernel vdso syscalls for i386

8 years agoMerge "libc: implement kernel vdso syscalls for i386"
Elliott Hughes [Fri, 25 Mar 2016 22:20:42 +0000 (22:20 +0000)]
Merge "libc: implement kernel vdso syscalls for i386"

8 years agoMerge "Add {get,set}domainname(2)"
Greg Hackmann [Fri, 25 Mar 2016 22:12:53 +0000 (22:12 +0000)]
Merge "Add {get,set}domainname(2)"
am: 76640d5

* commit '76640d5555a7c79d8025f5f0934afbf9f539e6a7':
  Add {get,set}domainname(2)

8 years agoMerge "Add {get,set}domainname(2)"
Greg Hackmann [Fri, 25 Mar 2016 22:02:06 +0000 (22:02 +0000)]
Merge "Add {get,set}domainname(2)"

8 years agoAdd hasmntopt(3)
Greg Hackmann [Fri, 4 Mar 2016 18:07:35 +0000 (10:07 -0800)]
Add hasmntopt(3)

bionic has the Linux-specific mntent.h but is missing hasmntopt().

Change-Id: I0ab7b83626c969704add4e64b37a6fc715d4a723
Signed-off-by: Greg Hackmann <ghackmann@google.com>
8 years agoAdd {get,set}domainname(2)
Greg Hackmann [Thu, 3 Mar 2016 16:37:53 +0000 (08:37 -0800)]
Add {get,set}domainname(2)

{get,set}domainname aren't in POSIX but are widely-implemented
extensions.

The Linux kernel provides a setdomainname syscall but not a symmetric
getdomainname syscall, since it expects userspace to get the domain name
from uname(2).

Change-Id: I96726c242f4bb646c130b361688328b0b97269a0
Signed-off-by: Greg Hackmann <ghackmann@google.com>
8 years agolibc: implement kernel vdso syscalls for i386
Mingwei Shi [Thu, 12 Nov 2015 07:02:14 +0000 (07:02 +0000)]
libc: implement kernel vdso syscalls for i386

This patch uses __kernel_vsyscall instead of "int 0x80"
as the syscall entry point. AT_SYSINFO points to
an adapter to mask the arch specific difference and gives a
performance boost on i386 architecture.

Change-ID: Ib340c604d02c6c25714a95793737e3cfdc3fc5d7
Signed-off-by: Mingwei Shi <mingwei.shi@intel.com>
8 years agoMerge "epoll_create: reject size <= 0"
Greg Hackmann [Fri, 25 Mar 2016 20:07:30 +0000 (20:07 +0000)]
Merge "epoll_create: reject size <= 0"
am: 2846ae7

* commit '2846ae70fb967269e8fcd2d854d04c9aeb5d01d3':
  epoll_create: reject size <= 0

8 years agoMerge "clone: check for NULL child stack"
Greg Hackmann [Fri, 25 Mar 2016 20:07:30 +0000 (20:07 +0000)]
Merge "clone: check for NULL child stack"
am: 61cb584

* commit '61cb584f9fdcbe96c6130ee5dc402fce296bc635':
  clone: check for NULL child stack

8 years agoMerge "Update Android.bp to match Android.mk" into nyc-dev
Colin Cross [Fri, 25 Mar 2016 19:58:52 +0000 (19:58 +0000)]
Merge "Update Android.bp to match Android.mk" into nyc-dev
am: 3b012b0

* commit '3b012b0cf34b5a9c3d062a6b23ba91460662e816':
  Update Android.bp to match Android.mk

8 years agoMerge "Update Android.bp to match Android.mk" into nyc-dev
Colin Cross [Fri, 25 Mar 2016 19:54:27 +0000 (19:54 +0000)]
Merge "Update Android.bp to match Android.mk" into nyc-dev

8 years agoMerge "epoll_create: reject size <= 0"
Greg Hackmann [Fri, 25 Mar 2016 19:35:01 +0000 (19:35 +0000)]
Merge "epoll_create: reject size <= 0"

8 years agoMerge "clone: check for NULL child stack"
Greg Hackmann [Fri, 25 Mar 2016 19:34:44 +0000 (19:34 +0000)]
Merge "clone: check for NULL child stack"

8 years agoFix the AT_HWCAP2 test.
Elliott Hughes [Fri, 25 Mar 2016 19:12:26 +0000 (19:12 +0000)]
Fix the AT_HWCAP2 test.
am: 2c7fdeb

* commit '2c7fdeb61cca97fb40df006354a6f5c81361faee':
  Fix the AT_HWCAP2 test.

8 years agoMerge "Fix x86 __memset_chk."
Elliott Hughes [Fri, 25 Mar 2016 18:48:05 +0000 (18:48 +0000)]
Merge "Fix x86 __memset_chk."
am: ef27637

* commit 'ef276377933e5e406f5e34dd8f45af1c98f89706':
  Fix x86 __memset_chk.

8 years agoMerge "Fix the AT_HWCAP2 test."
Elliott Hughes [Fri, 25 Mar 2016 18:08:47 +0000 (18:08 +0000)]
Merge "Fix the AT_HWCAP2 test."
am: fc501cc

* commit 'fc501cc54622939cc51499b9af57539f48cbba1a':
  Fix the AT_HWCAP2 test.

8 years agoMerge "Fix x86 __memset_chk."
Elliott Hughes [Fri, 25 Mar 2016 18:02:42 +0000 (18:02 +0000)]
Merge "Fix x86 __memset_chk."

8 years agoFix the AT_HWCAP2 test.
Elliott Hughes [Fri, 25 Mar 2016 15:29:05 +0000 (08:29 -0700)]
Fix the AT_HWCAP2 test.

"I have none of these capabilities" is a legitimate response, and
distinct from "I don't know what my capabilities are". It's the latter
I meant to test for.

Bug: http://b/27810985

(cherry picked from commit d4c91124906b6d73a2be336bbd305cd2678e04b2)

Change-Id: I4093948039a658e926e9b5e28d19b1344c70bd0e

8 years agoMerge "Fix the AT_HWCAP2 test."
Elliott Hughes [Fri, 25 Mar 2016 17:31:54 +0000 (17:31 +0000)]
Merge "Fix the AT_HWCAP2 test."

8 years agoFix the AT_HWCAP2 test.
Elliott Hughes [Fri, 25 Mar 2016 15:29:05 +0000 (08:29 -0700)]
Fix the AT_HWCAP2 test.

"I have none of these capabilities" is a legitimate response, and
distinct from "I don't know what my capabilities are". It's the latter
I meant to test for.

Bug: http://b/27810985
Change-Id: Id165423e62390051cbf23fdda54f28d94566cbe7

8 years agoFix x86 __memset_chk.
Elliott Hughes [Fri, 25 Mar 2016 05:34:47 +0000 (22:34 -0700)]
Fix x86 __memset_chk.

The stack offsets assumed we'd pushed %ebx. Unlike x86-64 we can't fall
through, but we can avoid repeating work we've already done.

Change-Id: I7e5f9be50983ed6178dd0c0534042da7ea30ad0c

8 years agoAdjust test to let it pass on libhoudini.
Yabin Cui [Fri, 25 Mar 2016 03:00:20 +0000 (03:00 +0000)]
Adjust test to let it pass on libhoudini.
am: ec9b56e

* commit 'ec9b56ee2e3ddd5b475e9804f42f65e8b71486bd':
  Adjust test to let it pass on libhoudini.

8 years agoepoll_create: reject size <= 0
Greg Hackmann [Thu, 24 Mar 2016 20:41:17 +0000 (13:41 -0700)]
epoll_create: reject size <= 0

Even though the size parameter to epoll_create(2) is (otherwise) unused,
passing in size <= 0 is explicitly documented as an error.

This change fixes the LTP epoll01 testcase.

Change-Id: I044a38be823c2fa956b57e77cc66571dfae8a4bb
Signed-off-by: Greg Hackmann <ghackmann@google.com>
8 years agoclone: check for NULL child stack
Greg Hackmann [Thu, 24 Mar 2016 00:15:02 +0000 (17:15 -0700)]
clone: check for NULL child stack

The clone syscall accepts NULL child stacks, interpreting this to mean
the child gets a copy of the parent's stack with copy-on-write
semantics.  However clone(2) is explicitly documented to treat this an
an error.

"Fortunately" every architecture's __bionic_clone implementation pushes
something onto the child stack before making the clone syscall.  So we
know fixing this won't break legacy apps, because any app that tried
using a NULL child stack would have died with SIGSEGV.

This change fixes the LTP clone04 testcase.

Change-Id: I663b34f34bc8dad2aa405c46e4eed4418cccca0d
Signed-off-by: Greg Hackmann <ghackmann@google.com>
8 years agoAdjust test to let it pass on libhoudini.
Yabin Cui [Tue, 8 Mar 2016 01:44:58 +0000 (17:44 -0800)]
Adjust test to let it pass on libhoudini.

When using libhoudini to run arm code on x86 platforms, we can't
assume the main thread allocates local variables at the stack
declared by kernel.

(cherry picked from commit 61e4d461e5c1c5108fdfe2a9f1edec6717e7461e)

Bug: http://b/27815309
Change-Id: Ic714a8e633a0bb6e85b38ee0e01e3439d0a0cea5

8 years agoUpdate Android.bp to match Android.mk
Colin Cross [Thu, 24 Mar 2016 20:41:30 +0000 (13:41 -0700)]
Update Android.bp to match Android.mk

Change-Id: Ib5bbe66a398734b6db9a40d51f2849d1531853ef

8 years agoRevert "Update timezone data to 2016b"
Neil Fuller [Thu, 24 Mar 2016 15:29:23 +0000 (15:29 +0000)]
Revert "Update timezone data to 2016b"
am: 11c7930

* commit '11c79304886155209fc2af9bd7b4096515588584':
  Revert "Update timezone data to 2016b"

8 years agoRevert "Update timezone data to 2016b"
Neil Fuller [Thu, 24 Mar 2016 15:22:09 +0000 (15:22 +0000)]
Revert "Update timezone data to 2016b"

The bionic change merged down from upstream but the
external/icu one didn't.
A replacement change will be submitted along with one for
external/icu.

This reverts commit 7bcee86edcc8cb0f969c719fed9bc3bd04de142f.

Change-Id: I0dd28e02231e6ebba5b61131b22889a1268a0675

8 years agoMerge "Remove the __USE_GNU guard from pthread_setname_np again."
Elliott Hughes [Thu, 24 Mar 2016 03:39:02 +0000 (03:39 +0000)]
Merge "Remove the __USE_GNU guard from pthread_setname_np again."
am: e725dc1

* commit 'e725dc164015d873b64639f0fee9ba5c30175f4c':
  Remove the __USE_GNU guard from pthread_setname_np again.

8 years agoMerge "Remove the __USE_GNU guard from pthread_setname_np again."
Elliott Hughes [Thu, 24 Mar 2016 03:28:30 +0000 (03:28 +0000)]
Merge "Remove the __USE_GNU guard from pthread_setname_np again."

8 years agoRemove the __USE_GNU guard from pthread_setname_np again.
Elliott Hughes [Thu, 24 Mar 2016 03:26:35 +0000 (20:26 -0700)]
Remove the __USE_GNU guard from pthread_setname_np again.

Caused build breakage, but not spotted by TreeHugger:

  external/libnfc-nxp/Linux_x86/phDal4Nfc.c:737:5: error: implicit declaration of function 'pthread_setname_np' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    pthread_setname_np(pthread_self(), "reader");
    ^

Nice file name.

Change-Id: I102e55718babf4e4f2f2c64066c6a83ed3ac86d3

8 years agoMerge "Add pthread_getname_np."
Elliott Hughes [Thu, 24 Mar 2016 02:53:02 +0000 (02:53 +0000)]
Merge "Add pthread_getname_np."
am: 63322aa

* commit '63322aa555d06bc961bfe419ba69471cdab2927b':
  Add pthread_getname_np.

8 years agoMerge "Add pthread_getname_np."
Elliott Hughes [Thu, 24 Mar 2016 02:47:10 +0000 (02:47 +0000)]
Merge "Add pthread_getname_np."

8 years agoAdd pthread_getname_np.
Elliott Hughes [Wed, 23 Mar 2016 18:20:47 +0000 (11:20 -0700)]
Add pthread_getname_np.

Also guard both these GNU extensions with _GNU_SOURCE.

Also improve the tests to test each case on both the current thread and
another thread, since the code paths are totally different.

Bug: http://b/27810459
Change-Id: I72b05bca5c5b6ca8ba4585b8edfb716a1c252f92

8 years agoMerge "genversion-scripts: fix script name in autogenerated comment"
Greg Hackmann [Thu, 24 Mar 2016 00:40:02 +0000 (00:40 +0000)]
Merge "genversion-scripts: fix script name in autogenerated comment"
am: 3c410c8

* commit '3c410c855c902f3fe99b4bf24ea8af1b289f120f':
  genversion-scripts: fix script name in autogenerated comment

8 years agoMerge "genversion-scripts: fix script name in autogenerated comment"
Greg Hackmann [Thu, 24 Mar 2016 00:32:35 +0000 (00:32 +0000)]
Merge "genversion-scripts: fix script name in autogenerated comment"

8 years agogenversion-scripts: fix script name in autogenerated comment
Greg Hackmann [Thu, 3 Mar 2016 21:10:23 +0000 (13:10 -0800)]
genversion-scripts: fix script name in autogenerated comment

Change-Id: I2a304818cfc54d08a08d2e621e4cf74e7ce465dd
Signed-off-by: Greg Hackmann <ghackmann@google.com>
8 years agoMerge "Move relocation_packer off libnativehelper."
Elliott Hughes [Wed, 23 Mar 2016 18:38:52 +0000 (18:38 +0000)]
Merge "Move relocation_packer off libnativehelper."
am: 506456c

* commit '506456c5d1ba281cb01c224679fc86d7a4c99ade':
  Move relocation_packer off libnativehelper.

8 years agoMerge "Move relocation_packer off libnativehelper."
Elliott Hughes [Wed, 23 Mar 2016 18:22:16 +0000 (18:22 +0000)]
Merge "Move relocation_packer off libnativehelper."

8 years agoMove relocation_packer off libnativehelper.
Elliott Hughes [Wed, 23 Mar 2016 03:27:39 +0000 (20:27 -0700)]
Move relocation_packer off libnativehelper.

Also remove other bits of makefile cruft.

Change-Id: I8b69822200959368003a8af9d1595bea9182d6d8

8 years agoMerge "Fix pthread.pthread_barrier_smoke test."
Yabin Cui [Wed, 23 Mar 2016 03:00:58 +0000 (03:00 +0000)]
Merge "Fix pthread.pthread_barrier_smoke test."
am: 68a2f12

* commit '68a2f12304e960f2045f3819c48311e7bf4d3126':
  Fix pthread.pthread_barrier_smoke test.

8 years agoMerge "CloseArchive() to free memory when OpenArchive fails."
Yabin Cui [Wed, 23 Mar 2016 03:00:58 +0000 (03:00 +0000)]
Merge "CloseArchive() to free memory when OpenArchive fails."
am: 6d1665c

* commit '6d1665c207666112fd712097e389e9a323aafd96':
  CloseArchive() to free memory when OpenArchive fails.

8 years agoMerge "Fix pthread.pthread_barrier_smoke test."
Yabin Cui [Wed, 23 Mar 2016 02:32:41 +0000 (02:32 +0000)]
Merge "Fix pthread.pthread_barrier_smoke test."

8 years agoMerge "CloseArchive() to free memory when OpenArchive fails."
Yabin Cui [Wed, 23 Mar 2016 02:32:30 +0000 (02:32 +0000)]
Merge "CloseArchive() to free memory when OpenArchive fails."

8 years agoCloseArchive() to free memory when OpenArchive fails.
Yabin Cui [Tue, 22 Mar 2016 00:10:12 +0000 (17:10 -0700)]
CloseArchive() to free memory when OpenArchive fails.

Bug: 26962895
Change-Id: I42418eee320ddae857b42572690316c53f638e85

8 years agoFix pthread.pthread_barrier_smoke test.
Yabin Cui [Tue, 22 Mar 2016 20:45:55 +0000 (13:45 -0700)]
Fix pthread.pthread_barrier_smoke test.

pthread_barrier_smoke test uses WaitUntilThreadSleep() to wait until
BarrierTestHelper threads sleep in pthread_barrier_wait(). But this
is flaky as there a two futex_wait places in pthread_barrier_wait.
This patch modifies this test to avoid using WaitUntilThreadSleep().

Bug: 27780937
Change-Id: I4c36b82cce9345d5088f8854b289dc5bf7a08e8c

8 years agoUpdate timezone data to 2016b am: 7bcee86
Neil Fuller [Tue, 22 Mar 2016 17:34:18 +0000 (17:34 +0000)]
Update timezone data to 2016b am: 7bcee86
am: 3be39d1

* commit '3be39d1db781b3e9fab2dfb96b6555455c8645bf':
  Update timezone data to 2016b

8 years agoUpdate timezone data to 2016b
Neil Fuller [Tue, 22 Mar 2016 17:30:35 +0000 (17:30 +0000)]
Update timezone data to 2016b
am: 7bcee86

* commit '7bcee86edcc8cb0f969c719fed9bc3bd04de142f':
  Update timezone data to 2016b

8 years agoUpdate timezone data to 2016b
Neil Fuller [Tue, 22 Mar 2016 11:30:36 +0000 (11:30 +0000)]
Update timezone data to 2016b

  Changes affecting future time stamps

    New zones Europe/Astrakhan and Europe/Ulyanovsk for Astrakhan and
    Ulyanovsk Oblasts, Russia, both of which will switch from +03 to +04 on
    2016-03-27 at 02:00 local time.  They need distinct zones since their
    post-1970 histories disagree.  New zone Asia/Barnaul for Altai Krai and
    Altai Republic, Russia, which will switch from +06 to +07 on the same date
    and local time.  Also, Asia/Sakhalin moves from +10 to +11 on 2016-03-27
    at 02:00.  (Thanks to Alexander Krivenyshev for the heads-up, and to
    Matt Johnson and Stepan Golosunov for followup.)

    As a trial of a new system that needs less information to be made up,
    the new zones use numeric time zone abbreviations like "+04"
    instead of invented abbreviations like "ASTT".

    Haiti will not observe DST in 2016.  (Thanks to Jean Antoine via
    Steffen Thorsen.)

    Palestine's spring-forward transition on 2016-03-26 is at 01:00, not 00:00.
    (Thanks to Hannah Kreitem.) Guess future transitions will be March's last
    Saturday at 01:00, not March's last Friday at 24:00.

  Changes affecting past time stamps

    Europe/Chisinau observed DST during 1990, and switched from +04 to
    +03 at 1990-05-06 02:00, instead of switching from +03 to +02.
    (Thanks to Stepan Golosunov.)

    1991 abbreviations in Europe/Samara should be SAMT/SAMST, not
    KUYT/KUYST.  (Thanks to Stepan Golosunov.)

The update produced (apparently benign) warnings from zic as suggested here:
http://mm.icann.org/pipermail/tz-announce/2016-March/000036.html

Bug: 27656428
Change-Id: Ibbf7237344c21d22a0f781f547fbc95b46623ece

8 years agoAdd a CTS test to ensure AT_HWCAP2 is reported.
Elliott Hughes [Mon, 21 Mar 2016 20:47:35 +0000 (20:47 +0000)]
Add a CTS test to ensure AT_HWCAP2 is reported.
am: a65a3ad

* commit 'a65a3ad837618c5bf5c0b798bf9217a509ab5c61':
  Add a CTS test to ensure AT_HWCAP2 is reported.

8 years agoMerge "Add a CTS test to ensure AT_HWCAP2 is reported."
Elliott Hughes [Mon, 21 Mar 2016 18:34:22 +0000 (18:34 +0000)]
Merge "Add a CTS test to ensure AT_HWCAP2 is reported."
am: 6212e5d

* commit '6212e5dfada2ce1cd8b4915389452cba09e75b69':
  Add a CTS test to ensure AT_HWCAP2 is reported.

8 years agoAdd a CTS test to ensure AT_HWCAP2 is reported.
Elliott Hughes [Sat, 19 Mar 2016 01:36:04 +0000 (18:36 -0700)]
Add a CTS test to ensure AT_HWCAP2 is reported.

This is important for performance of 32-bit ARM crypto code in apps.

Bug: http://b/27750752

(cherry picked from commit ebb4895c68f08bad682f90e66b041f1585d7bafa)

Change-Id: Iec69fe57b93da0480ef3bbd4c9e7882c8aa55011

8 years agoMerge "Add a CTS test to ensure AT_HWCAP2 is reported."
Elliott Hughes [Mon, 21 Mar 2016 18:20:02 +0000 (18:20 +0000)]
Merge "Add a CTS test to ensure AT_HWCAP2 is reported."

8 years agoAdd a CTS test to ensure AT_HWCAP2 is reported.
Elliott Hughes [Sat, 19 Mar 2016 01:36:04 +0000 (18:36 -0700)]
Add a CTS test to ensure AT_HWCAP2 is reported.

This is important for performance of 32-bit ARM crypto code in apps.

Bug: http://b/27750752
Change-Id: If1cebc4d562aeb2ae0cc2834135af16e9bd0f79a

8 years agoFix race in malloc debug option free_track.
Christopher Ferris [Thu, 17 Mar 2016 21:49:16 +0000 (21:49 +0000)]
Fix race in malloc debug option free_track.
am: 97fce67

* commit '97fce67302a80bf282bff118cfa96936c5ad9e81':
  Fix race in malloc debug option free_track.

8 years agoFix race in malloc debug option free_track.
Christopher Ferris [Wed, 16 Mar 2016 05:39:39 +0000 (22:39 -0700)]
Fix race in malloc debug option free_track.

The free track mechanism could fail if, at the same time a free occurs,
another thread is trying to free and verify the same allocation. This
doesn't work if the freed allocation is added to the list and we still
do work on it. The fix is to only add to the free list when we are done
with the allocation.

Also fix a problem where the usable size is computed incorrectly because
two of the arguments where reversed.

In addition, add a check that the allocation being verified has the correct
tag before trying to check the body of the allocation.

Add a test to catch the original failure.

Add a test for the tag being different.

Bug: 27601650

(cherry picked from commit d0919623a2ef56107590eca9a9522a250fb8bd4a)

Change-Id: Ie1aa4d9a829da9a96de9b8bd1cc8fc681e9cab15

8 years agoMerge "Fix race in malloc debug option free_track."
Christopher Ferris [Thu, 17 Mar 2016 18:05:47 +0000 (18:05 +0000)]
Merge "Fix race in malloc debug option free_track."
am: 5f1de52

* commit '5f1de52eca7d3892cec864d2dc46b1dfdecba891':
  Fix race in malloc debug option free_track.

8 years agoMerge "Fix race in malloc debug option free_track."
Christopher Ferris [Thu, 17 Mar 2016 17:52:54 +0000 (17:52 +0000)]
Merge "Fix race in malloc debug option free_track."

8 years agoMerge "Fix bug where t9 is not correct when __memset_chk_fail is called. t9 is used...
Douglas Leung [Thu, 17 Mar 2016 01:09:08 +0000 (01:09 +0000)]
Merge "Fix bug where t9 is not correct when __memset_chk_fail is called. t9 is used to calculate gp at the start of __memset_chk_fail."
am: d057f44

* commit 'd057f449a0a3ad2f574d11ffce060d69db9fc019':
  Fix bug where t9 is not correct when __memset_chk_fail is called. t9 is used to calculate gp at the start of __memset_chk_fail.

8 years agoMerge "Fix bug where t9 is not correct when __memset_chk_fail is called. t9 is used...
Christopher Ferris [Thu, 17 Mar 2016 01:01:26 +0000 (01:01 +0000)]
Merge "Fix bug where t9 is not correct when __memset_chk_fail is called. t9 is used to calculate gp at the start of __memset_chk_fail."

8 years agoFix race in malloc debug option free_track.
Christopher Ferris [Wed, 16 Mar 2016 05:39:39 +0000 (22:39 -0700)]
Fix race in malloc debug option free_track.

The free track mechanism could fail if, at the same time a free occurs,
another thread is trying to free and verify the same allocation. This
doesn't work if the freed allocation is added to the list and we still
do work on it. The fix is to only add to the free list when we are done
with the allocation.

Also fix a problem where the usable size is computed incorrectly because
two of the arguments where reversed.

In addition, add a check that the allocation being verified has the correct
tag before trying to check the body of the allocation.

Add a test to catch the original failure.

Add a test for the tag being different.

Bug: 27601650
Change-Id: Ie9200677d066255b8e668a48422f23f909f4ddee

8 years agoFix bug where t9 is not correct when __memset_chk_fail is called.
Douglas Leung [Wed, 16 Mar 2016 23:59:23 +0000 (16:59 -0700)]
Fix bug where t9 is not correct when __memset_chk_fail is called.
t9 is used to calculate gp at the start of __memset_chk_fail.

Change-Id: Ief5018699e060afa691bfc1d861abd5e463ab80c

8 years agoMerge "Android.bp: Add missing <complex.h> functions."
Dan Willemsen [Wed, 16 Mar 2016 23:03:04 +0000 (23:03 +0000)]
Merge "Android.bp: Add missing <complex.h> functions."
am: 18576fe

* commit '18576fea6917f7ff2affa06aa01dcbcb7228778d':
  Android.bp: Add missing <complex.h> functions.

8 years agoMerge "Android.bp: Add missing <complex.h> functions."
Dan Willemsen [Wed, 16 Mar 2016 22:52:57 +0000 (22:52 +0000)]
Merge "Android.bp: Add missing <complex.h> functions."

8 years agoAndroid.bp: Add missing <complex.h> functions.
Dan Willemsen [Wed, 16 Mar 2016 22:46:35 +0000 (15:46 -0700)]
Android.bp: Add missing <complex.h> functions.

Android.bp port of https://android-review.googlesource.com/207658

Change-Id: I4bedd193a20f7dfb97d0a8bbb67c8472e727be87

8 years agoMerge "Add missing <complex.h> functions."
Elliott Hughes [Wed, 16 Mar 2016 18:55:02 +0000 (18:55 +0000)]
Merge "Add missing <complex.h> functions."
am: 8d0af0b

* commit '8d0af0bf8004c65f13b985643004a915d7e382eb':
  Add missing <complex.h> functions.

8 years agoMerge "Fix PTHREAD_THREADS_MAX."
Elliott Hughes [Wed, 16 Mar 2016 18:55:01 +0000 (18:55 +0000)]
Merge "Fix PTHREAD_THREADS_MAX."
am: b31d270

* commit 'b31d2705d564058f2ecb2434ea73bc7c35e1debf':
  Fix PTHREAD_THREADS_MAX.

8 years agoMerge "Add missing <complex.h> functions."
Elliott Hughes [Wed, 16 Mar 2016 18:12:33 +0000 (18:12 +0000)]
Merge "Add missing <complex.h> functions."

8 years agoMerge "Fix PTHREAD_THREADS_MAX."
Elliott Hughes [Wed, 16 Mar 2016 17:07:49 +0000 (17:07 +0000)]
Merge "Fix PTHREAD_THREADS_MAX."

8 years agoFix PTHREAD_THREADS_MAX.
Elliott Hughes [Wed, 16 Mar 2016 00:11:56 +0000 (17:11 -0700)]
Fix PTHREAD_THREADS_MAX.

We don't have a compile-time limit on the number of threads,
and we don't have a definite run-time limit either.

Bug: http://b/27617302
Change-Id: I6a6fe083e7b655d24eb9e7ef7f3e0280d483080b

8 years agoFix problem where unknown option is not an error.
Christopher Ferris [Tue, 15 Mar 2016 19:29:40 +0000 (19:29 +0000)]
Fix problem where unknown option is not an error.
am: 4451b53c37

* commit '4451b53c3761b46fa33a3e47bfb0c62ca47e5fbb':
  Fix problem where unknown option is not an error.

8 years agoFix problem where unknown option is not an error.
Christopher Ferris [Mon, 14 Mar 2016 22:29:46 +0000 (15:29 -0700)]
Fix problem where unknown option is not an error.

If the first option is found, then any unknown options are simply
ignored, but do not produce an error. Fixed this so that each
option found is actually verified to exist.

Bug: 27620263

(cherry picked from commit a4b14252752d14454afb48feb3272e8689e3a66d)

Change-Id: I709774456283879e2a8aa5ce375899eaa79f6bc3

8 years agoMerge "Fix problem where unknown option is not an error."
Christopher Ferris [Tue, 15 Mar 2016 17:55:07 +0000 (17:55 +0000)]
Merge "Fix problem where unknown option is not an error."
am: bca25411b8

* commit 'bca25411b882abc6ab0bf07d25266ba9f8e4d398':
  Fix problem where unknown option is not an error.

8 years agoMerge "Fix problem where unknown option is not an error."
Christopher Ferris [Tue, 15 Mar 2016 17:47:02 +0000 (17:47 +0000)]
Merge "Fix problem where unknown option is not an error."

8 years agoRemove missing DT_SONAME warning from the toast
Dimitry Ivanov [Tue, 15 Mar 2016 17:36:59 +0000 (17:36 +0000)]
Remove missing DT_SONAME warning from the toast
am: 19930d5f6e

* commit '19930d5f6ef39e660d0cdab5e17445a7d3ed1310':
  Remove missing DT_SONAME warning from the toast

8 years agoRemove missing DT_SONAME warning from the toast
Dimitry Ivanov [Tue, 15 Mar 2016 05:14:23 +0000 (22:14 -0700)]
Remove missing DT_SONAME warning from the toast

Bug: http://b/27613086
Change-Id: I9410f07dbde002d936319516313b27f9794dd597

8 years agoMerge "Silence false positive warnings on GCC."
Josh Gao [Tue, 15 Mar 2016 02:54:34 +0000 (02:54 +0000)]
Merge "Silence false positive warnings on GCC."
am: 3f36834fe8

* commit '3f36834fe863ec525df6c7f206b23ea76728431e':
  Silence false positive warnings on GCC.

8 years agoSilence false positive warnings on GCC.
Josh Gao [Tue, 15 Mar 2016 02:51:49 +0000 (02:51 +0000)]
Silence false positive warnings on GCC.
am: f6756b50b1

* commit 'f6756b50b11e15876ee49e01a64110e39f7e6e76':
  Silence false positive warnings on GCC.

8 years agoSilence false positive warnings on GCC.
Josh Gao [Tue, 15 Mar 2016 01:15:15 +0000 (18:15 -0700)]
Silence false positive warnings on GCC.

We still use GCC to build the bionic unit tests into CTS, and it emits a
false positive -Wmissing-field-initializers warning for the C++11 aggregate
initialization syntax `Foo foo = {}`.

Bug: http://b/27656293
Change-Id: I016d8dae6d6cd28afe4bc19250c2a8fba908f8e6
(cherry picked from commit d7878529b80295625df610bd32dadf11d507e8c0)

8 years agoMerge "Silence false positive warnings on GCC."
Josh Gao [Tue, 15 Mar 2016 02:43:10 +0000 (02:43 +0000)]
Merge "Silence false positive warnings on GCC."

8 years agoSilence false positive warnings on GCC.
Josh Gao [Tue, 15 Mar 2016 01:15:15 +0000 (18:15 -0700)]
Silence false positive warnings on GCC.

We still use GCC to build the bionic unit tests into CTS, and it emits a
false positive -Wmissing-field-initializers warning for the C++11 aggregate
initialization syntax `Foo foo = {}`.

Bug: http://b/27656293
Change-Id: I016d8dae6d6cd28afe4bc19250c2a8fba908f8e6

8 years agoFix problem where unknown option is not an error.
Christopher Ferris [Mon, 14 Mar 2016 22:29:46 +0000 (15:29 -0700)]
Fix problem where unknown option is not an error.

If the first option is found, then any unknown options are simply
ignored, but do not produce an error. Fixed this so that each
option found is actually verified to exist.

Bug: 27620263
Change-Id: If58732df3285eeae72188162c505e0e202fada8c

8 years agoInit functions after debug malloc succeeds.
Christopher Ferris [Sat, 12 Mar 2016 22:34:24 +0000 (22:34 +0000)]
Init functions after debug malloc succeeds.
am: c1f1828949

* commit 'c1f182894990ea76f3f3c0ab41cc104637532e71':
  Init functions after debug malloc succeeds.

8 years agoMerge "Init functions after debug malloc succeeds."
Christopher Ferris [Sat, 12 Mar 2016 21:23:32 +0000 (21:23 +0000)]
Merge "Init functions after debug malloc succeeds."
am: 0e00c168ce

* commit '0e00c168cea9c951df5ce47d25d8f042b9cc566a':
  Init functions after debug malloc succeeds.

8 years agoInit functions after debug malloc succeeds.
Christopher Ferris [Fri, 11 Mar 2016 20:27:02 +0000 (12:27 -0800)]
Init functions after debug malloc succeeds.

Do not initialize all of the global function pointers associated with
debug malloc until the initialization has completed correctly.

Bug: 27600760

(cherry picked from commit 20f2c1ebd5b5860e69772b228ccda756eafc1398)

Change-Id: Ibc45213f55be9c8e95fb838b583353cd090c8b88

8 years agoMerge "Init functions after debug malloc succeeds."
Christopher Ferris [Sat, 12 Mar 2016 21:15:34 +0000 (21:15 +0000)]
Merge "Init functions after debug malloc succeeds."

8 years agoAdd missing <complex.h> functions.
Elliott Hughes [Fri, 11 Mar 2016 22:49:13 +0000 (14:49 -0800)]
Add missing <complex.h> functions.

FreeBSD doesn't seem interested in having low-quality implementations of
these functions:

  cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
  clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.

And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.

Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc

8 years agoMerge "Update Android.bp with x86 rint optimizations"
Dan Willemsen [Fri, 11 Mar 2016 21:15:13 +0000 (21:15 +0000)]
Merge "Update Android.bp with x86 rint optimizations"
am: 470de8f4d7

* commit '470de8f4d7b8e2e4a926f645870ab0419706fa78':
  Update Android.bp with x86 rint optimizations

8 years agoMerge "Update Android.bp with x86 rint optimizations"
Dan Willemsen [Fri, 11 Mar 2016 21:07:49 +0000 (21:07 +0000)]
Merge "Update Android.bp with x86 rint optimizations"

8 years agoUpdate Android.bp with x86 rint optimizations
Dan Willemsen [Fri, 11 Mar 2016 21:01:20 +0000 (13:01 -0800)]
Update Android.bp with x86 rint optimizations

Change-Id: Ie14a40301d6dd601b34b3f2341947daf6294e2cb

8 years agoInit functions after debug malloc succeeds.
Christopher Ferris [Fri, 11 Mar 2016 20:27:02 +0000 (12:27 -0800)]
Init functions after debug malloc succeeds.

Do not initialize all of the global function pointers associated with
debug malloc until the initialization has completed correctly.

Bug: 27600760
Change-Id: I0621b54bc2d9fab63805d7992d384e550d6fed2a

8 years agoMerge changes I3f1c1310,Ia8dc3481,I6b19fd63
Colin Cross [Fri, 11 Mar 2016 01:26:08 +0000 (01:26 +0000)]
Merge changes I3f1c1310,Ia8dc3481,I6b19fd63
am: 6a20add813

* commit '6a20add8136864b858955f6721fd3c0665f99036':
  malloc_debug: fix multiplication overflow in debug_calloc
  malloc_debug: round 0 byte allocations up to 1 byte
  malloc_debug: iterate: use usable_size

8 years agoMerge changes I3f1c1310,Ia8dc3481,I6b19fd63
Colin Cross [Fri, 11 Mar 2016 01:13:52 +0000 (01:13 +0000)]
Merge changes I3f1c1310,Ia8dc3481,I6b19fd63

* changes:
  malloc_debug: fix multiplication overflow in debug_calloc
  malloc_debug: round 0 byte allocations up to 1 byte
  malloc_debug: iterate: use usable_size

8 years agoMerge "Adjust test to let it pass on libhoudini."
Yabin Cui [Fri, 11 Mar 2016 00:06:53 +0000 (00:06 +0000)]
Merge "Adjust test to let it pass on libhoudini."
am: 7c66b17547

* commit '7c66b1754731450c288f39dae5b67b60482dab5e':
  Adjust test to let it pass on libhoudini.

8 years agoMerge "Adjust test to let it pass on libhoudini."
Yabin Cui [Thu, 10 Mar 2016 23:58:32 +0000 (23:58 +0000)]
Merge "Adjust test to let it pass on libhoudini."

8 years agoMerge changes I3f1c1310,Ia8dc3481,I6b19fd63 into nyc-dev
Colin Cross [Thu, 10 Mar 2016 22:55:50 +0000 (22:55 +0000)]
Merge changes I3f1c1310,Ia8dc3481,I6b19fd63 into nyc-dev
am: a2fa9c53e6

* commit 'a2fa9c53e688eef2d4343df7e5ab03f6765397c4':
  malloc_debug: fix multiplication overflow in debug_calloc
  malloc_debug: round 0 byte allocations up to 1 byte
  malloc_debug: iterate: use usable_size

8 years agomalloc_debug: fix multiplication overflow in debug_calloc
Colin Cross [Thu, 10 Mar 2016 21:01:27 +0000 (13:01 -0800)]
malloc_debug: fix multiplication overflow in debug_calloc

The over flow check for nmemb * bytes in debug_calloc is incorrect,
use the builtin overflow functions to check for multiplication and
addition overflow.

Change-Id: I3f1c13102621bc5380be1f69caa88dba2118f3cb
(cherry picked from commit 239838608dbe9917acddfe5a51d92350a4c8e135)

8 years agomalloc_debug: round 0 byte allocations up to 1 byte
Colin Cross [Thu, 10 Mar 2016 01:56:14 +0000 (17:56 -0800)]
malloc_debug: round 0 byte allocations up to 1 byte

0 byte allocations can cause problems if they are immediately followed
by another allocation with no header, as both allocations will have the
same address.  Treat 0 byte allocations as 1 byte allocations so that
debug_iterate will return separate addresses for them.

Bug: 27578580
Change-Id: Ia8dc3481fa7062391e9b3ae58a36e8d47e7ee557
(cherry picked from commit 15af478080cfbfa800fb8172fdf70a84075925e3)