Commit Graph

15341 Commits

Author SHA1 Message Date
Yabin Cui 72e678c8a7 am cbd0a15b: Merge "Fix the way to get main thread stack start address."
* commit 'cbd0a15be881abb8ce1feb5b389da2f517a9a4c6':
  Fix the way to get main thread stack start address.
2015-09-17 02:42:52 +00:00
Yabin Cui cbd0a15be8 Merge "Fix the way to get main thread stack start address." 2015-09-17 02:37:20 +00:00
Dan Willemsen 208ae17e5f Add Android.bp for libc/libm/libdl
Change-Id: I3537363849ba1244348996ff17c5ace1b95dbeee
2015-09-16 16:50:01 -07:00
Mor-sarid, Nitzan 569333293a Fix the way to get main thread stack start address.
For previous way to get the stack using the [stack] string from
/proc/self/task/<pid>/maps is not enough. On x86/x86_64, if an
alternative signal stack is used while a task switch happens,
the [stack] indicator may no longer be correct.

Instead, stack_start from /proc/self/stat which is always inside
the main stack, is used to find the main stack in /proc/self/maps.

Change-Id: Ieb010e71518b57560d541cd3b3563e5aa9660750
Signed-off-by: Nitzan Mor-sarid <nitzan.mor-sarid@intel.com>
Signed-off-by: Mingwei Shi <mingwei.shi@intel.com>
2015-09-16 11:45:13 -07:00
Elliott Hughes bab1044d27 am 14545d4c: Merge "Move several FreeBSD functions to OpenBSD."
* commit '14545d4ce3dd446f20a14dcff37d60ff8d756f7a':
  Move several FreeBSD functions to OpenBSD.
2015-09-15 15:19:20 +00:00
Elliott Hughes 14545d4ce3 Merge "Move several FreeBSD functions to OpenBSD." 2015-09-15 15:13:35 +00:00
Elliott Hughes 364dbb3cf4 am 44c8ac8b: Merge "Sync with upstream NetBSD lib/libc/regex."
* commit '44c8ac8bd7747d907720c63538625a4b95245234':
  Sync with upstream NetBSD lib/libc/regex.
2015-09-15 15:12:36 +00:00
Elliott Hughes 44c8ac8bd7 Merge "Sync with upstream NetBSD lib/libc/regex." 2015-09-15 15:05:21 +00:00
Elliott Hughes 26a8322972 Move several FreeBSD functions to OpenBSD.
There's no difference between the two BSDs for these functions, so let's go
with the majority.

Change-Id: Ic296f23153a48bed5ad152f5b31989c4e00e60bd
2015-09-14 19:01:58 -07:00
Elliott Hughes 71927a8237 Sync with upstream NetBSD lib/libc/regex.
Bug: http://b/22850181
Change-Id: I11a51a2031e68a953ccd5691da98c699c7d01904
2015-09-14 18:45:52 -07:00
Daniel Micay 5ca66528c5 make mmap fail on requests larger than PTRDIFF_MAX
Allocations larger than PTRDIFF_MAX can be successfully created on
32-bit with a 3:1 split, or in 32-bit processes running on 64-bit.

Allowing these allocations to succeed is dangerous, as it introduces
overflows for `end - start` and isn't compatible with APIs (mis)using
ssize_t to report either the size or an error. POSIX is guilty of this,
as are many other Android APIs. LLVM even considers the `ptr + size`
case to be undefined, as all pointer arithmetic compiles down to signed
operations and overflow is treated as undefined for standard C pointer
arithmetic (GNU C `void *` arithmetic works differently).

This also prevents dlmalloc from allocating > PTRDIFF_MAX as it doesn't
merge mappings like jemalloc. A similar check will need to be added in
jemalloc's code path for huge allocations.

The musl libc implementation also performs this sanity check.

Change-Id: I5f849543f94a39719f5d27b00cef3079bb5933e9
2015-09-12 01:52:12 -04:00
Dan Albert a1a46a8e94 am cd0ed2f1: Merge "CMSG_DATA should return an unsigned char*."
* commit 'cd0ed2f174d9015da5ae7206bc4c5190cd0bb51e':
  CMSG_DATA should return an unsigned char*.
2015-09-11 22:14:07 +00:00
Dan Albert cd0ed2f174 Merge "CMSG_DATA should return an unsigned char*." 2015-09-11 17:39:12 +00:00
Dan Albert 268af26359 CMSG_DATA should return an unsigned char*.
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_socket.h.html
> CMSG_DATA(cmsg)
>    If the argument is a pointer to a cmsghdr structure, this macro
>    shall return an unsigned character pointer to the data array
>    associated with the cmsghdr structure.

Change-Id: I3f89ba19cbca4e6727abc65a2bbcd59267892ba8
2015-09-11 09:47:27 -07:00
Dan Albert 32ec749873 am 1c7b84ca: Merge changes Ia1777fd4,I3998d88b
* commit '1c7b84ca0095e0dc4da8434e9e0c59cd2326f763':
  Unify unistd.h.
  Use attribute availability.
2015-09-08 20:32:37 +00:00
Dan Albert 1c7b84ca00 Merge changes Ia1777fd4,I3998d88b
* changes:
  Unify unistd.h.
  Use attribute availability.
2015-09-08 20:24:39 +00:00
Dan Albert af4713e6a5 Unify unistd.h.
Make unistd.h usable from all platform versions.

Also name all function parameters for Android Studio.

Bug: http://b/21952040
Change-Id: Ia1777fd4a6d4e37f25cc402c28fb78c003e481e3
2015-09-04 13:02:09 -07:00
Dan Albert a6435a186d Use attribute availability.
Bug: http://b/21952040
Change-Id: I3998d88bc6076d60ae5cf7efd112817f80f17971
2015-09-04 13:02:03 -07:00
Elliott Hughes edc73f6286 am ba9c1705: Merge "linker: don\'t pass dlextinfo to dependent loads"
* commit 'ba9c17053456aed4452a349cf45c5960d9231f25':
  linker: don't pass dlextinfo to dependent loads
2015-09-04 18:12:33 +00:00
Elliott Hughes ba9c170534 Merge "linker: don't pass dlextinfo to dependent loads" 2015-09-04 18:02:18 +00:00
Christopher Ferris 2fe50aa380 am cb0d96e6: Merge "Only close stdin/stdout/stderr for debug malloc."
* commit 'cb0d96e6a218cc37eb0ab764740a8bf1ea385511':
  Only close stdin/stdout/stderr for debug malloc.
2015-09-04 01:17:48 +00:00
Christopher Ferris cb0d96e6a2 Merge "Only close stdin/stdout/stderr for debug malloc." 2015-09-04 01:09:11 +00:00
Christopher Ferris efc134dba3 Only close stdin/stdout/stderr for debug malloc.
The debug malloc code unconditionally closes stdin/stdout/stderr,
which means that other atexit functions cannot use them. Only
close these if there is a debug malloc final function to call.

This doesn't appear to be a problem on most normal applications or the
atexit_exit bionic unit test would be failing. However, if you
enable stat dumping in jemalloc, nothing prints. Most likely trying
to add an atexit function from within libc is causing that atexit
to run after the debug malloc atexit function.

Change-Id: I963720d4ccaaa511e44af07a7461f17eb3f84e8e
2015-09-03 17:45:33 -07:00
Christopher Ferris 7bb544cc7c am b423ffa6: Merge "Update to v3.18.21 kernel headers."
* commit 'b423ffa6c27ade8485f1f061fd3775553e9bb457':
  Update to v3.18.21 kernel headers.
2015-09-03 18:00:09 +00:00
Christopher Ferris b423ffa6c2 Merge "Update to v3.18.21 kernel headers." 2015-09-03 17:52:47 +00:00
Christopher Ferris 915bf813ad Update to v3.18.21 kernel headers.
Change-Id: I4ade68d62981c7f6f361750cc811e8d84be9d5b9
2015-09-02 17:23:31 -07:00
Dmitriy Ivanov edfc9f63a2 linker: don't pass dlextinfo to dependent loads
Don't pass the parent load's dlextinfo to dependent loads, since this
causes the linker to try to load the dependencies using the same
addresses/relro/fds/etc as the main library, which is never going to
work. This was how it worked before ae69a95 which broke this.

Bug: http://b/23742664
Bug: http://b/20948231
Bug: http://b/20841817
Change-Id: I340ebae1127666d5c6c6f9c6521b89fb93f15bdd
2015-09-02 16:32:02 -07:00
Elliott Hughes 67c6da80bb am cc251966: Merge "Rename debug_stacktrace to debug_backtrace."
* commit 'cc25196662cab824117e7cb79e435bd3aaf37dcc':
  Rename debug_stacktrace to debug_backtrace.
2015-09-02 03:52:24 +00:00
Elliott Hughes cc25196662 Merge "Rename debug_stacktrace to debug_backtrace." 2015-09-02 03:44:31 +00:00
Yabin Cui d3c7f67aed am 32c85daa: Merge "build bionic gtest runner on mac."
* commit '32c85daa1570e589ce953c42b40fb34cf2b5e989':
  build bionic gtest runner on mac.
2015-09-01 23:08:34 +00:00
Elliott Hughes 32bf43f44a Rename debug_stacktrace to debug_backtrace.
All the functions say "backtrace", so it's weird that the filename
says "stacktrace".

Change-Id: I1c88a56c1f9adb1bae4615edc8af3e73db270a8c
2015-09-01 16:01:50 -07:00
Yabin Cui 32c85daa15 Merge "build bionic gtest runner on mac." 2015-09-01 22:58:23 +00:00
Yabin Cui 767fb1c5c6 build bionic gtest runner on mac.
Change-Id: I39a7e94b6662256646dfaeb8f9ecd5c03cd5fbc6
2015-09-01 15:40:38 -07:00
Elliott Hughes c121e179a2 am a992004c: Merge "Regenerate NOTICE files."
* commit 'a992004c9edf4db0c11aae8610cce6ebf13d53b4':
  Regenerate NOTICE files.
2015-08-29 04:07:20 +00:00
Elliott Hughes a992004c9e Merge "Regenerate NOTICE files." 2015-08-29 04:00:21 +00:00
Elliott Hughes 74c5bba540 am cb58f528: Merge "Sync with upstream FreeBSD libm."
* commit 'cb58f528bfc19bbc32d8a8b9d7e954f61d622c52':
  Sync with upstream FreeBSD libm.
2015-08-29 03:55:19 +00:00
Elliott Hughes cb58f528bf Merge "Sync with upstream FreeBSD libm." 2015-08-29 03:46:21 +00:00
Elliott Hughes 44ead71726 Regenerate NOTICE files.
Change-Id: Ia5c340220bb75e4e3166cc483ea77d19cfb08a71
2015-08-28 20:23:52 -07:00
Elliott Hughes 8cff2f95d8 Sync with upstream FreeBSD libm.
Change-Id: I97e9b23903f1d993d84825806065e85626007d31
2015-08-28 20:21:43 -07:00
Elliott Hughes b57e9efd40 am c2e634dd: Merge "Fix regoff_t for LP32 and _FILE_OFFSET_BITS=64."
* commit 'c2e634dd303a44b11e30ab31e39ffc4eae5467f8':
  Fix regoff_t for LP32 and _FILE_OFFSET_BITS=64.
2015-08-27 23:24:33 +00:00
Elliott Hughes c2e634dd30 Merge "Fix regoff_t for LP32 and _FILE_OFFSET_BITS=64." 2015-08-27 23:17:43 +00:00
Dan Albert a71f81a08b am 46c7bc83: Merge "Don\'t re-export libunwind_llvm."
* commit '46c7bc83ab0324983312f16bd40cc1cdfe11cce6':
  Don't re-export libunwind_llvm.
2015-08-27 22:27:38 +00:00
Dan Albert 46c7bc83ab Merge "Don't re-export libunwind_llvm." 2015-08-27 22:20:51 +00:00
Elliott Hughes adf5c7237d Fix regoff_t for LP32 and _FILE_OFFSET_BITS=64.
bionic is built without _FILE_OFFSET_BITS=64, so internally regoff_t
was 32-bit on LP32, but code compiled with _FILE_OFFSET_BITS would
expect rm_so and rm_eo in struct regmatch_t to be 64-bit, leading to
confusion.

Bug: http://b/23566443
Change-Id: Iae92fa545104068e4f64ce1977f5ec616859638c
2015-08-27 14:48:32 -07:00
Chih-hung Hsieh e7a09ff7d9 am bfaee4bd: Merge "Add test cases for __emutls_get_address."
* commit 'bfaee4bd6ad901a699df21fd44d95f34e2e7444d':
  Add test cases for __emutls_get_address.
2015-08-27 05:22:56 +00:00
Elliott Hughes c6effb3af6 am 848808c6: Merge "Add preadv/pwritev."
* commit '848808c660ec4811f4ff5a2748b6f754b008cd21':
  Add preadv/pwritev.
2015-08-27 05:22:55 +00:00
Chih-hung Hsieh bfaee4bd6a Merge "Add test cases for __emutls_get_address." 2015-08-26 22:27:35 +00:00
Elliott Hughes 848808c660 Merge "Add preadv/pwritev." 2015-08-26 22:04:32 +00:00
Elliott Hughes 6f4594d5dc Add preadv/pwritev.
Bug: http://b/12612572
Change-Id: I38ff2684d69bd0fe3f21b1d371b88fa60d5421cb
2015-08-26 14:48:55 -07:00
Chih-Hung Hsieh 83380b5cf0 Add test cases for __emutls_get_address.
BUG: 22984770
Change-Id: I193c3612190260a08f3b3ad8b856c0ae8f94e03d
2015-08-26 13:10:14 -07:00