14506 Commits

Author SHA1 Message Date
Christopher Ferris
b78e60e7b7 Use the default unwind code.
This speeds up the debug malloc code by using the original unwinding code.
The only catch is that it has to link in the libc++ arm unwind code or
there will be crashes when attempting to unwind through libc++ compiled
code.

Bug: 16874447

(cherry picked from commit 3f7635f4906c53fa744731efc35235456b7d93bf)

Change-Id: If8a3821cdd95ed481bb496bf2daab449d13790f8
2014-08-27 13:13:21 -07:00
Baligh Uddin
0570368a79 am 388369b7: Merge branch \'lmp-dev-plus-aosp\' of https://googleplex-android.googlesource.com/_direct/platform/bionic into lmp-dev-plus-aosp
* commit '388369b788f93670551fe32233b6c4b55d3879d9':
  call uselocale() before freelocale() to make sure that g_local_key has a valid locale.
  Switch to OpenBSD <err.h> implementation.
2014-08-27 17:55:30 +00:00
Elliott Hughes
c15ee16fb3 am b489ba48: am 6cc4e3b6: Merge "call uselocale() before freelocale() to make sure that g_local_key has a valid locale." into lmp-dev
* commit 'b489ba48a11ae91bd51bd99b3741ad452484684d':
  call uselocale() before freelocale() to make sure that g_local_key has a valid locale.
2014-08-27 17:55:29 +00:00
Baligh Uddin
388369b788 Merge branch 'lmp-dev-plus-aosp' of https://googleplex-android.googlesource.com/_direct/platform/bionic into lmp-dev-plus-aosp 2014-08-27 17:39:51 +00:00
Elliott Hughes
6c3e6e7c40 am cb322a11: Merge "call uselocale() before freelocale() to make sure that g_local_key has a valid locale."
* commit 'cb322a116804a690fdde6096d7efef4819151ad9':
  call uselocale() before freelocale() to make sure that g_local_key has a valid locale.
2014-08-27 17:39:29 +00:00
Elliott Hughes
7a9471d815 am 64ae11ab: Merge "Switch to OpenBSD <err.h> implementation."
* commit '64ae11ab766421fe2c49ebdecb14c36fe0a047fe':
  Switch to OpenBSD <err.h> implementation.
2014-08-27 17:39:28 +00:00
Elliott Hughes
b489ba48a1 am 6cc4e3b6: Merge "call uselocale() before freelocale() to make sure that g_local_key has a valid locale." into lmp-dev
* commit '6cc4e3b6ce726fb7aab6eff1ca8f4a28f9f21ee9':
  call uselocale() before freelocale() to make sure that g_local_key has a valid locale.
2014-08-27 17:39:01 +00:00
Elliott Hughes
cb322a1168 Merge "call uselocale() before freelocale() to make sure that g_local_key has a valid locale." 2014-08-27 17:27:46 +00:00
Wally Yau
a40fdbd565 call uselocale() before freelocale() to make sure that g_local_key has a valid locale.
For tests that call uselocale(), the locale is stored in the
g_userlocale_key thread-specific key. If freelocale() is called later,
then g_uselocal_key points to a deleted pointer. CTS eventually calls
vfprintf to print the result, which calls MB_CUR_MAX and MB_CUR_MAX
accesses the deleted locale stored in g_uselocale_key, causing unpredictable
errors.

Fixed the tests by calling uselocale() with the old locale before
calling freelocale.

(cherry-pick of 8a46cf0fcf82b8c76e05be7e066ec854f974603a.)

Bug: 17299565
Change-Id: I87efa2a9b16999a11d587f68d3aeedcbe6ac8a2c
2014-08-27 10:26:49 -07:00
Elliott Hughes
64ae11ab76 Merge "Switch to OpenBSD <err.h> implementation." 2014-08-27 17:26:03 +00:00
Elliott Hughes
6cc4e3b6ce Merge "call uselocale() before freelocale() to make sure that g_local_key has a valid locale." into lmp-dev 2014-08-27 17:25:23 +00:00
Wally Yau
8a46cf0fcf call uselocale() before freelocale() to make sure that g_local_key has a valid locale.
For tests that call uselocale(), the locale is stored in the
g_userlocale_key thread-specific key. If freelocale() is called later,
then g_uselocal_key points to a deleted pointer. CTS eventually calls
vfprintf to print the result, which calls MB_CUR_MAX and MB_CUR_MAX
accesses the deleted locale stored in g_uselocale_key, causing unpredictable
errors.

Fixed the tests by calling uselocale() with the old locale before
calling freelocale.

Bug: 17299565
Change-Id: I87efa2a9b16999a11d587f68d3aeedcbe6ac8a2c
2014-08-27 17:22:29 +00:00
Christopher Ferris
e94c0e6abf am 7bad1a90: am 3f7635f4: Use the default unwind code.
* commit '7bad1a90f1f270d5e2e3ca798d1e0f35c79bec6b':
  Use the default unwind code.
2014-08-27 04:55:00 +00:00
Christopher Ferris
7bad1a90f1 am 3f7635f4: Use the default unwind code.
* commit '3f7635f4906c53fa744731efc35235456b7d93bf':
  Use the default unwind code.
2014-08-27 04:46:05 +00:00
Hans Boehm
c0c0e0404f am 3b32ba0e: am 6bfcefe0: Merge "Undefine _Atomic before redefining"
* commit '3b32ba0e2c1851e20f72a73c606dcbfc79e687bb':
  Undefine _Atomic before redefining
2014-08-27 00:11:45 +00:00
Elliott Hughes
e294a02c0c am d961078f: am 07401c71: Merge "Switch to OpenBSD daemon(3)."
* commit 'd961078f2d1ee42f41ae967d33ba583dd42475f8':
  Switch to OpenBSD daemon(3).
2014-08-27 00:11:45 +00:00
Elliott Hughes
edbd5b2659 am 3e95a0d6: am f1e64b5c: (-s ours) Merge "More cases where libc should use O_CLOEXEC."
* commit '3e95a0d6f0fb3e15485c4671643b4c61e89c49d3':
  More cases where libc should use O_CLOEXEC.
2014-08-27 00:11:44 +00:00
Hans Boehm
3b32ba0e2c am 6bfcefe0: Merge "Undefine _Atomic before redefining"
* commit '6bfcefe02f8fbeec1f6790bd5ebb1fdd5dba1e33':
  Undefine _Atomic before redefining
2014-08-27 00:01:46 +00:00
Elliott Hughes
d961078f2d am 07401c71: Merge "Switch to OpenBSD daemon(3)."
* commit '07401c7136af113304a22f4a8245ef3fc1b6929b':
  Switch to OpenBSD daemon(3).
2014-08-27 00:01:45 +00:00
Elliott Hughes
3e95a0d6f0 am f1e64b5c: (-s ours) Merge "More cases where libc should use O_CLOEXEC."
* commit 'f1e64b5c171a374f36cd970df0c84558d4209e1c':
  More cases where libc should use O_CLOEXEC.
2014-08-27 00:01:42 +00:00
Elliott Hughes
cc7e5f489f Switch to OpenBSD <err.h> implementation.
Change-Id: Ia950d88871a30f68e74f9ac7dbd87788e128e02f
2014-08-26 17:00:37 -07:00
Elliott Hughes
77fd54ae1c am f975bc2d: am 7b87d441: Merge "Switch to OpenBSD res_random."
* commit 'f975bc2d59b064e08f5d01ecd0724cb76351727f':
  Switch to OpenBSD res_random.
2014-08-26 23:47:17 +00:00
Elliott Hughes
390a11303d am 06b03394: am 59de803a: Merge "libc should use O_CLOEXEC when opening files for its own use."
* commit '06b033942ae7c6d967e4c58a4dd649e421598eba':
  libc should use O_CLOEXEC when opening files for its own use.
2014-08-26 23:47:16 +00:00
Dmitriy Ivanov
df8e8af8f7 am a04130f5: am 9f5dee55: Merge "Remove unnecessary calls to LinkedList::clear()"
* commit 'a04130f54c087cf2ad2924863a8a1e5c22fdd8a9':
  Remove unnecessary calls to LinkedList::clear()
2014-08-26 23:47:15 +00:00
Elliott Hughes
f975bc2d59 am 7b87d441: Merge "Switch to OpenBSD res_random."
* commit '7b87d441b0f2aa3ad5021ab6bd879a995a1bc2ce':
  Switch to OpenBSD res_random.
2014-08-26 23:41:23 +00:00
Elliott Hughes
06b033942a am 59de803a: Merge "libc should use O_CLOEXEC when opening files for its own use."
* commit '59de803af98a284378303489f614be3e53800b3f':
  libc should use O_CLOEXEC when opening files for its own use.
2014-08-26 23:41:23 +00:00
Dmitriy Ivanov
a04130f54c am 9f5dee55: Merge "Remove unnecessary calls to LinkedList::clear()"
* commit '9f5dee55aa401b11b3eb15806d3f8ffc291c2bb1':
  Remove unnecessary calls to LinkedList::clear()
2014-08-26 23:41:22 +00:00
Dmitriy Ivanov
2ad7cce57c am 8e35e9e7: am d2bd3c47: Merge "Enable __cxa_atexit && __cxa_finalize for linker"
* commit '8e35e9e73ee14fa8c725c83d871db2b58821d8c9':
  Enable __cxa_atexit && __cxa_finalize for linker
2014-08-26 23:35:36 +00:00
Hans Boehm
6bfcefe02f Merge "Undefine _Atomic before redefining" 2014-08-26 23:34:49 +00:00
Elliott Hughes
07401c7136 Merge "Switch to OpenBSD daemon(3)." 2014-08-26 23:33:43 +00:00
Dmitriy Ivanov
8e35e9e73e am d2bd3c47: Merge "Enable __cxa_atexit && __cxa_finalize for linker"
* commit 'd2bd3c4717ed223bca1c68a87f243f4bcf492a4b':
  Enable __cxa_atexit && __cxa_finalize for linker
2014-08-26 23:26:32 +00:00
Elliott Hughes
e5055179fd Switch to OpenBSD daemon(3).
Change-Id: I1fd0be09fdb24aa6f1d945410eba5987f8a949b4
2014-08-26 16:25:19 -07:00
Elliott Hughes
f1e64b5c17 Merge "More cases where libc should use O_CLOEXEC." 2014-08-26 23:23:59 +00:00
Elliott Hughes
f73183f1a3 More cases where libc should use O_CLOEXEC.
Change-Id: Idfa111aeebc5deca2399dae919e8b72eb54c23c0
2014-08-26 16:20:59 -07:00
Elliott Hughes
7b87d441b0 Merge "Switch to OpenBSD res_random." 2014-08-26 23:18:04 +00:00
Elliott Hughes
59de803af9 Merge "libc should use O_CLOEXEC when opening files for its own use." 2014-08-26 23:11:46 +00:00
Christopher Ferris
3f7635f490 Use the default unwind code.
This speeds up the debug malloc code by using the original unwinding code.
The only catch is that it has to link in the libc++ arm unwind code or
there will be crashes when attempting to unwind through libc++ compiled
code.

Bug: 16874447
Change-Id: Ifdbbcbd4137d668b25cf3c2bd59535e06ebfa5a7
2014-08-26 16:02:51 -07:00
Dmitriy Ivanov
9f5dee55aa Merge "Remove unnecessary calls to LinkedList::clear()" 2014-08-26 23:00:44 +00:00
Hans Boehm
3e4a0099a1 Undefine _Atomic before redefining
Stdatomic.h was potentially redefining _Atomic, in spite of a
prior definition by <atomic>.  This could cause g++ builds that
included <stdatomic.h> with an available <atomic> header to break.

Change-Id: I562c7115118c0587d594d4d5b62d25101e47bfd8
2014-08-26 15:58:15 -07:00
Elliott Hughes
c674edbf27 libc should use O_CLOEXEC when opening files for its own use.
Change-Id: I159f1d57e0ca090d837f57854fcef5879b8b8248
2014-08-26 15:56:54 -07:00
Dmitriy Ivanov
608217e167 Remove unnecessary calls to LinkedList::clear()
Change-Id: I981d2700cb17322c634b751715543fd33ee49b7c
2014-08-26 15:56:31 -07:00
Dmitriy Ivanov
d2bd3c4717 Merge "Enable __cxa_atexit && __cxa_finalize for linker" 2014-08-26 22:53:16 +00:00
Dmitriy Ivanov
14241402de Enable __cxa_atexit && __cxa_finalize for linker
This allows adding destructors to classes used
 for global variables.

Change-Id: I5e1cd63fe3bf8f66de88cc4f7437cafb350f49b5
2014-08-26 15:44:18 -07:00
Elliott Hughes
8572efefa5 am 05409ded: am c764fb24: Merge "Fix pthread_getattr_np for the main thread."
* commit '05409dedcd6268d8150e5a39327b1b48711834c0':
  Fix pthread_getattr_np for the main thread.
2014-08-26 20:18:50 +00:00
Elliott Hughes
05409dedcd am c764fb24: Merge "Fix pthread_getattr_np for the main thread."
* commit 'c764fb24ccb47e05d8e140cde5b4111225790ef1':
  Fix pthread_getattr_np for the main thread.
2014-08-26 20:08:44 +00:00
Elliott Hughes
6421823410 Fix pthread_getattr_np for the main thread.
On most architectures the kernel subtracts a random offset to the stack
pointer in create_elf_tables by calling arch_align_stack before writing
the auxval table and so on. On all but x86 this doesn't cause a problem
because the random offset is less than a page, but on x86 it's up to two
pages. This means that our old technique of rounding the stack pointer
doesn't work. (Our old implementation of that technique was wrong too.)

It's also incorrect to assume that the main thread's stack base and size
are constant. Likewise to assume that the main thread has a guard page.
The main thread is not like other threads.

This patch switches to reading /proc/self/maps (and checking RLIMIT_STACK)
whenever we're asked.

Bug: 17111575
Signed-off-by: Fengwei Yin <fengwei.yin@intel.com>

(cherry picked from commit 57b7a6110e7e8b446fc23cce4765ff625ee0a105)

Change-Id: I87e679ee1c0db8092f2d1221c8e7c1461545c5a4
2014-08-26 12:55:01 -07:00
Elliott Hughes
c764fb24cc Merge "Fix pthread_getattr_np for the main thread." 2014-08-26 19:53:40 +00:00
Elliott Hughes
57b7a6110e Fix pthread_getattr_np for the main thread.
On most architectures the kernel subtracts a random offset to the stack
pointer in create_elf_tables by calling arch_align_stack before writing
the auxval table and so on. On all but x86 this doesn't cause a problem
because the random offset is less than a page, but on x86 it's up to two
pages. This means that our old technique of rounding the stack pointer
doesn't work. (Our old implementation of that technique was wrong too.)

It's also incorrect to assume that the main thread's stack base and size
are constant. Likewise to assume that the main thread has a guard page.
The main thread is not like other threads.

This patch switches to reading /proc/self/maps (and checking RLIMIT_STACK)
whenever we're asked.

Bug: 17111575
Signed-off-by: Fengwei Yin <fengwei.yin@intel.com>
Change-Id: I1d4dbffe7bc7bda1d353c3a295dbf68d29f63158
2014-08-26 10:36:38 -07:00
Chih-Hung Hsieh
b4e5b1012b am a9c435e0: am 9e307af9: Merge "Add standard throw() spec to delete operators."
* commit 'a9c435e072111d6e4a90748bb4a34f2c46814162':
  Add standard throw() spec to delete operators.
2014-08-25 22:41:21 +00:00
Chih-Hung Hsieh
a9c435e072 am 9e307af9: Merge "Add standard throw() spec to delete operators."
* commit '9e307af982ea9030849293b5e3307733289e3c2c':
  Add standard throw() spec to delete operators.
2014-08-25 22:29:24 +00:00