Commit graph

16552 commits

Author SHA1 Message Date
Christopher Ferris
bca25411b8 Merge "Fix problem where unknown option is not an error." 2016-03-15 17:47:02 +00:00
Josh Gao
3f36834fe8 Merge "Silence false positive warnings on GCC." 2016-03-15 02:43:10 +00:00
Josh Gao
d7878529b8 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
2016-03-14 18:28:14 -07:00
Christopher Ferris
a4b1425275 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
2016-03-14 15:34:22 -07:00
Christopher Ferris
0e00c168ce Merge "Init functions after debug malloc succeeds." 2016-03-12 21:15:34 +00:00
Dan Willemsen
470de8f4d7 Merge "Update Android.bp with x86 rint optimizations" 2016-03-11 21:07:49 +00:00
Dan Willemsen
603acbf9ca Update Android.bp with x86 rint optimizations
Change-Id: Ie14a40301d6dd601b34b3f2341947daf6294e2cb
2016-03-11 13:01:20 -08:00
Christopher Ferris
20f2c1ebd5 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
2016-03-11 12:27:02 -08:00
Colin Cross
6a20add813 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
2016-03-11 01:13:52 +00:00
Yabin Cui
7c66b17547 Merge "Adjust test to let it pass on libhoudini." 2016-03-10 23:58:32 +00:00
Colin Cross
7877df66c2 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 239838608d)
2016-03-10 14:53:02 -08:00
Colin Cross
9567c7b82c 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 15af478080)
2016-03-10 14:53:02 -08:00
Colin Cross
baa7c6f307 malloc_debug: iterate: use usable_size
malloc_iterate with malloc debug enabled was returning allocation sizes
using the requested size instead of usable size.  If anything wrote
pointers above the requested size but below the usable size, those
pointers would be invisible to libmemunreachable and referenced
allocations could be reported as a leak.

Bug: 27107100
Change-Id: I6b19fd631f68ce93b3aee408cc3d296ec457bd01
(cherry picked from commit b23c6606d2)
2016-03-10 14:53:02 -08:00
Yabin Cui
61e4d461e5 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.

Change-Id: Id9457f47fc338a3103fdee25a7a6e622915e7090
2016-03-10 14:28:43 -08:00
Elliott Hughes
ffd19ee64d Merge "Improve and fix the stack-protector tests." 2016-03-10 16:12:27 +00:00
Josh Gao
79c9ff28f9 Merge "debuggerd: rethrow the full signal we receive, always." 2016-03-10 00:00:54 +00:00
Josh Gao
61cf3f3e03 debuggerd: rethrow the full signal we receive, always.
The previous code assumed that returning would be sufficient to rethrow
signals like SIGSEGV. This is not true, for example,  in the case where a
SIGSEGV is sent via kill(2). We were previously only sending the signal
to ourselves in some cases, because using kill(2) would lose information
in the siginfo_t argument. Use rt_tgsigqueueinfo(2) instead to preserve
its contents.

Bug: http://b/27367422
Change-Id: I1be822818d5905461979c7e12dc4e9c25049273b
2016-03-09 14:56:37 -08:00
Elliott Hughes
fc69a8ad5f Improve and fix the stack-protector tests.
Bug: http://b/26888853
Change-Id: I505dbf7d5934f7247fb639f55dd6a9341df3947b
2016-03-09 14:50:03 -08:00
Elliott Hughes
2512310fd4 Merge "Switch bionic over to google-benchmark." 2016-03-09 20:36:52 +00:00
Erik Kline
192539f524 Merge "Don't leak sockets if setsockopt() or fchown() fail." 2016-03-09 04:18:22 +00:00
Erik Kline
7bbb181bf0 Don't leak sockets if setsockopt() or fchown() fail.
Change-Id: Idcf8c08ff50d21c3a04b7ef80c4044f3f9762f2b
2016-03-09 12:11:13 +09:00
Elliott Hughes
55dc0c5eea Merge "Add x86 optimization of rint functions and tests" 2016-03-08 22:01:07 +00:00
jzha136
f3ea093ebb Add x86 optimization of rint functions and tests
Change-Id: I5e7696ff9bcb1efc2625100ef8565b68dca2326c
Signed-off-by: Jingwei Zhang <jingwei.zhang@intel.com>
2016-03-07 18:31:26 -08:00
Elliott Hughes
281e06ba69 Switch bionic over to google-benchmark.
Also removes the old benchmarking library.

Change-Id: I4791ae69fa5dea03644d3d411c60b7c6d1fceae3
2016-03-07 13:50:50 -08:00
Elliott Hughes
59eab81e16 Merge "Minor clock_getcpuclockid optimization."
am: b83bd7bc25

* commit 'b83bd7bc256d5121ec3ff1babc3bc08d7f04eea2':
  Minor clock_getcpuclockid optimization.
2016-03-07 21:17:00 +00:00
Elliott Hughes
b83bd7bc25 Merge "Minor clock_getcpuclockid optimization." 2016-03-07 21:08:53 +00:00
Elliott Hughes
2bf5332f23 Minor clock_getcpuclockid optimization.
Don't ask the kernel to copy data to userspace if we don't need it.
(Noticed while cleaning up sysconf to not call clock_getres.)

Change-Id: Icc0f7559775b8a2dcefe638ce831d06b75d67122
2016-03-07 11:54:02 -08:00
Josh Gao
8598f1fd66 Merge "forkpty: set the output fd to -1 on the slave side."
am: ba2232d013

* commit 'ba2232d0132274433a269eeccbbbd3be7f8f4384':
  forkpty: set the output fd to -1 on the slave side.
2016-03-05 03:08:52 +00:00
Josh Gao
ba2232d013 Merge "forkpty: set the output fd to -1 on the slave side." 2016-03-05 03:04:37 +00:00
Elliott Hughes
a990df3b7f Merge "Don\'t call clock_getres in sysconf."
am: a703498f0c

* commit 'a703498f0c416f58fdfdf3cdb208fffee60c9bb8':
  Don't call clock_getres in sysconf.
2016-03-05 02:36:55 +00:00
Elliott Hughes
a703498f0c Merge "Don't call clock_getres in sysconf." 2016-03-05 02:31:08 +00:00
Elliott Hughes
d2b8de2cd1 Don't call clock_getres in sysconf.
There are a hundred other reasons why we can't run on kernels old enough
to not have all the clocks covered by sysconf.

This was causing trouble for jemalloc 4.1.0 in a seccomp-constrained process
because jemalloc 4.1.0 introduced a call to sysconf that caused us to make
clock_getres syscalls for the first time, leading to SIGSYS.

Bug: http://b/27408522
Change-Id: I2eb6986d871bc03cbef278e5617734409c39e057
2016-03-04 18:28:53 -08:00
Josh Gao
6d7c1ee9ff forkpty: set the output fd to -1 on the slave side.
glibc, FreeBSD, OpenBSD, and Darwin all just leave the fd unchanged and
possibly uninitialized. Setting it to -1 seems friendlier, though.

Bug: http://b/27506278
Change-Id: I7acdc8eecbea4404d5fb4ba0b4d572245a323886
2016-03-04 18:04:41 -08:00
Douglas Leung
5bfd3ffd36 Merge "Add __memset_chk assembler for mips32 and mips64."
am: c4d2bede15

* commit 'c4d2bede1592dd82dce9bfc6ebecdc414a79490b':
  Add __memset_chk assembler for mips32 and mips64.
2016-03-05 01:11:43 +00:00
Elliott Hughes
c4d2bede15 Merge "Add __memset_chk assembler for mips32 and mips64." 2016-03-05 01:07:10 +00:00
Douglas Leung
29d4b71426 Add __memset_chk assembler for mips32 and mips64.
Change-Id: I365b1f345c695850c30ccb1a9f56f254ce182000
2016-03-04 15:15:00 -08:00
Dimitry Ivanov
b4e083ed05 Merge "libm: rename LIBC_PRIVATE to LIBC_DEPRECATED"
am: 015f2e803a

* commit '015f2e803abd9403808a1829e40c2609e3cd4fde':
  libm: rename LIBC_PRIVATE to LIBC_DEPRECATED
2016-03-04 21:32:14 +00:00
Chih-Hung Hsieh
91c9943c95 Merge "Enable test with clang aarch64."
am: cb9e4530a8

* commit 'cb9e4530a8fbf6eb078476610b71e4ca41988cb2':
  Enable test with clang aarch64.
2016-03-04 21:32:07 +00:00
Dimitry Ivanov
015f2e803a Merge "libm: rename LIBC_PRIVATE to LIBC_DEPRECATED" 2016-03-04 21:29:49 +00:00
Chih-hung Hsieh
cb9e4530a8 Merge "Enable test with clang aarch64." 2016-03-04 21:26:05 +00:00
Chih-Hung Hsieh
389e28e61d Enable test with clang aarch64.
TLS bug on aarch64 was fixed.

Bug: 25642296
Change-Id: I02b4f67955991f08a133a3d72ba4b109f896f1dd
2016-03-04 12:28:50 -08:00
Dimitry Ivanov
9296460bf4 libm: rename LIBC_PRIVATE to LIBC_DEPRECATED
Bug: http://b/26386014
Change-Id: Ia32411ce779f9dcf2cf7910d8658ffa753c73af9
2016-03-04 11:05:52 -08:00
Elliott Hughes
b9b99b83cd Merge "Add x86 __memset_chk assembler."
am: 728e0e9b97

* commit '728e0e9b97d7a43b4348062e4040d478c2ab8f51':
  Add x86 __memset_chk assembler.
2016-03-04 16:33:58 +00:00
Elliott Hughes
728e0e9b97 Merge "Add x86 __memset_chk assembler." 2016-03-04 16:28:10 +00:00
Elliott Hughes
6ac4d0a054 Merge "Fix x86-64 __memset_chk."
am: 7d188ce0fe

* commit '7d188ce0feda07f3e0cf6bdbe4e52efe224bb39f':
  Fix x86-64 __memset_chk.
2016-03-04 03:21:06 +00:00
Elliott Hughes
7d188ce0fe Merge "Fix x86-64 __memset_chk." 2016-03-04 03:12:35 +00:00
Elliott Hughes
a80ddc8a34 Fix x86-64 __memset_chk.
I can only assume I was testing the 32-bit implementation when I claimed
this worked. While improving the 32-bit code I realized that I'd used
signed comparisons instead of unsigned, and came back to find that the
64-bit code didn't work.

By way of apology, make x86-64 the first architecture where __memset_chk
falls through to memset.

Change-Id: I54d9eee5349b6a2abb2ce81e161fdcde09556561
2016-03-03 16:46:25 -08:00
Dan Willemsen
27770d6286 Merge "Update Android.bp with recent *.mk changes"
am: 5f67f8ae9d

* commit '5f67f8ae9ded09b1eb68e54a1b3a226c35e10166':
  Update Android.bp with recent *.mk changes
2016-03-04 00:40:52 +00:00
Elliott Hughes
81d6a18c69 Add x86 __memset_chk assembler.
Change-Id: Ic6732f761ea8a41f70d5ff59d47ad38417d17cc2
2016-03-03 16:10:33 -08:00
Dan Willemsen
5f67f8ae9d Merge "Update Android.bp with recent *.mk changes" 2016-03-03 23:50:24 +00:00