Commit graph

2297 commits

Author SHA1 Message Date
Elliott Hughes
728cde5be9 Add trivial ttyname(3) test.
Bug: N/A
Test: ran tests
Change-Id: Id5bf51a9c50db0fdbc9df0225165e87e698d0c83
2017-11-08 21:53:50 -08:00
Elliott Hughes
32f608dd46 Remove test that adds no coverage.
qsort_test doesn't test anything that stdlib's qsort tests don't already cover.

Bug: N/A
Test: ran tests
Change-Id: I6df3008d82083f1120a2027e759dc7cf77cc4e3b
2017-11-08 21:40:55 -08:00
Elliott Hughes
70f020953b Add trivial tests for the <resolv.h> base64 functions.
Bug: N/A
Test: ran tests
Change-Id: Ib57443efb03dbaddbe69e21949ebc8df6cf8a4bb
2017-11-08 21:13:15 -08:00
Treehugger Robot
265b1ab966 Merge "Change bool, and string properties to *bool, and *string for cc" 2017-11-08 18:41:33 +00:00
Treehugger Robot
3404bb11a3 Merge "Allow 32-bit fseeko/fseeko64 SEEK_CUR/SEEK_SET to exceed 2 GiB" 2017-11-08 01:57:38 +00:00
Ryan Prichard
bf54986d19 Allow 32-bit fseeko/fseeko64 SEEK_CUR/SEEK_SET to exceed 2 GiB
Bug: http://b/68837650
Test: /data/nativetest/bionic-unit-tests/bionic-unit-tests
Test: /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static
Test: /data/nativetest64/bionic-unit-tests/bionic-unit-tests
Change-Id: I367e0238c31d35f76d8ad89fd0aa27ecfeb7c149
2017-11-07 15:34:23 -08:00
Nan Zhang
dab0fd582f Change bool, and string properties to *bool, and *string for cc
there's no use case for prepending/appending to bool, and string
properties within module struct. Declearing "*bool" and "*string" almost
cover everything user need.

Test: m -j checkbuild
Bug: b/68853585
Change-Id: I8342d4a43fb81f2842532ddb38fba414767ac82a
2017-11-07 12:39:10 -08:00
Treehugger Robot
8574a1f630 Merge "Fix arm/arm64 <fenv.h> to match current reality." 2017-11-07 18:50:41 +00:00
dimitry
109040c868 Add test checking library unload on dlclose
Bug: http://b/68262627
Test: Run bionic-unit-tests --gtest_filter=dl*:Dl*
Change-Id: Ied85bc4ab37524cfcdbc33fd6c6e69b8d87ee08a
2017-11-07 10:51:59 +01:00
Elliott Hughes
b6c7f6e595 Fix arm/arm64 <fenv.h> to match current reality.
ARM stopped supporting enabling of FP exceptions years ago.

Bug: http://b/68832485
Test: ran tests
Change-Id: I8450baa78e04d994c352180975b0a1ecd5a9f662
2017-11-03 16:46:32 -07:00
Raj Mamadgi
527229cb72 Fix for dlfcn.rtld_next_from_library.
Using fclose to get the same address for the test assertion because
Samsung already uses LD_PRELOAD to intercept `close`.

Bug: http://b/67978141
Bug: http://b/68855476
Test: ran tests
Change-Id: I2da463e8b27e0db5cb1ba370d30f0402d7531396
Signed-off-by: Raj Mamadgi <r.mamadgi@samsung.com>
2017-11-03 15:00:09 -07:00
Elliott Hughes
232541aa02 Merge "More printf de-duplication." 2017-11-03 15:26:02 +00:00
Elliott Hughes
3a33da5d73 Merge "Fix pthread test race conditions." 2017-11-03 04:55:33 +00:00
Elliott Hughes
4f97cffd29 Merge "Add basic tests for the remaining 9 libm <fenv.h> functions." 2017-11-03 02:52:03 +00:00
Elliott Hughes
618303ca4a More printf de-duplication.
Fix the 'j' (intmax_t/uintmax_t) length qualifier in the wide
variant. (With new tests that fail without this fix.)

Fix a typo in the wide support for intmax_t*, which isn't testable because
%n is disabled on Android (and will be removed in a later cleanup pass).

Also move the public vfprintf/vfwprint functions into stdio.cpp.

Bug: http://b/67371539
Test: ran tests
Change-Id: Ib003599b1e9cb789044a068940b59e447f2cb7cb
2017-11-02 16:58:44 -07:00
Elliott Hughes
18a1957444 Add basic tests for the remaining 9 libm <fenv.h> functions.
It seems that feenableexcept/fegetexcept are lying to us on arm/arm64
because the hardware doesn't actually support such functionality. When
I get confirmation of that from ARM I'll fix the <fenv.h> implementation
correspondingly --- writing to/reading from reserved FP control register
bits as we currently do doesn't seem like the best of ideas.

Bug: http://b/31742322
Test: ran tests on arm/arm64/x86/x86-64
Change-Id: If78f83ddab221b568fa168c3364a7ae95c024983
2017-11-02 16:18:43 -07:00
Elliott Hughes
0bd9d13572 Fix pthread test race conditions.
Guarantee that threads live long enough for us to fiddle with them.

Bug: http://b/68768209
Test: ran tests
Change-Id: I06b1bb64fec9f8181b5f5b43ca1030e255fdccc1
2017-11-02 13:11:13 -07:00
Elliott Hughes
eed523e7cb Merge "Test __fpclassify/__isinf/__isnan." 2017-11-02 16:54:40 +00:00
Elliott Hughes
46621f43b0 Merge "Start de-duplicating the regular and wide printf implementations." 2017-11-02 15:44:32 +00:00
Elliott Hughes
9ecd2cc0a2 Test __fpclassify/__isinf/__isnan.
These are obsolete aliases for equally obsolete functions, but apps built
with old versions of the NDK might still be emitting references to them.

Bug: N/A
Test: ran tests
Change-Id: I6eab910e3cd4d322604167799e83b5b7411c04c3
2017-11-01 22:17:26 -07:00
Elliott Hughes
2f9c8ce38a Start de-duplicating the regular and wide printf implementations.
This patch switches to C++ (in anticipation of needing it later), removes
a little duplication (via a macro for now), and ensures uniform support
for %C/%lc and %S/%ls between regular and wide (with new tests).

Since it's so hard to debug problems in printf (as the time I've wasted
already today will testify), that's all I want to do in this change. The
other 500 lines of diff can wait...

(Also merge "floatio.h" into "local.h" now all the users are in forked
code.)

Bug: http://b/67371539
Test: ran tests
Change-Id: I083353d89c32b9302d759ca6967cc6d8a62cd8a5
2017-11-01 18:13:36 -07:00
Chih-Hung Hsieh
b1cc5bd276 Use -Werror in bionic/tests
* Should not use -Wno-error

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I92552b0d9860835216500c4f57574cd2928b24f1
2017-11-01 14:13:24 -07:00
Treehugger Robot
07e412419b Merge "More missing _unlocked <stdio.h> functions." 2017-10-31 22:43:34 +00:00
Elliott Hughes
37ad959783 More missing _unlocked <stdio.h> functions.
Also simplify trivial one-liners like perror/puts/fputs, and clean up
fread/fwrite slightly.

Fix perror to match POSIX.

Add basic perror and *_unlocked tests.

Bug: N/A
Test: ran tests
Change-Id: I63f83c8e0c15c3c4096509d17421ac331b6fc23d
2017-10-31 13:23:41 -07:00
George Burgess IV
0086fc813e Rename the fortify compile-time diags test
Following up on comments from I40c66ff9e638b306878ada006bc2c98f2346e77a.
My best attempt at a name that conveys "a test that fails to compile in
N different ways with FORTIFY enabled, and is intended to be used with
either FileCheck, or as a cheap way to check that FORTIFY is getting
properly disabled given some set of flags."

Bug: None
Test: mma.
Change-Id: I6d62875bd1cabc5d01b10ae0f03accd5ee5c8c0a
2017-10-31 13:14:56 -07:00
George Burgess IV
e5d66eb86a libc: Disable FORTIFY if we're using clang-tidy.
Having FORTIFY enabled for clang-tidy adds no value, and breaks some
heuristics for recognizing standard library functions (see the bug).

This also disables FORTIFY for the static analyzer (which we use
through clang-tidy), because it presumably tries to recognize standard
library functions through similar heuristics.

Bug: 36664104
Test: mma with and without the patch to cdefs. New test breaks without.
Change-Id: I40c66ff9e638b306878ada006bc2c98f2346e77a
2017-10-30 22:30:40 -07:00
Elliott Hughes
7a66066e66 Fix pthread.pthread_attr_setinheritsched__PTHREAD_INHERIT_SCHED__PTHREAD_EXPLICIT_SCHED for LP32.
LP32 continues to ignore failures to set scheduler attributes for
backwards compatibility with pre-Honeycomb bugs :-(

Bug: http://b/68486614
Test: ran tests (32-bit and 64-bit!)
Change-Id: I18a012cdf2f3c5bb63a5367bca2bac2de7f53ae2
2017-10-30 09:26:06 -07:00
Elliott Hughes
6c1d23f059 Merge "Improve glibc compatibility of gethostby*_r functions." 2017-10-26 16:51:43 +00:00
Elliott Hughes
c8a2612ffc Merge "Implement pthread_attr_getinheritsched/pthread_attr_setinheritsched." 2017-10-26 16:12:04 +00:00
Elliott Hughes
8aecba7aa6 Implement pthread_attr_getinheritsched/pthread_attr_setinheritsched.
Historically, Android defaulted to EXPLICIT but with a special case
because SCHED_NORMAL/priority 0 was awkward. Because the code couldn't
actually tell whether SCHED_NORMAL/priority 0 was a genuine attempt to
explicitly set those attributes (because the parent thread is SCHED_FIFO,
say) or just because the pthread_attr_t was left at its defaults.

Now we support INHERIT, we could call sched_getscheduler to see whether
we actually need to call sched_setscheduler, but since the major cost
is the fixed syscall overhead, we may as well just conservatively
call sched_setscheduler and let the kernel decide whether it's a
no-op. (Especially because we'd then have to add both sched_getscheduler
and sched_setscheduler to any seccomp filter.)

Platform code (or app code that only needs to support >= P) can actually
add a call to pthread_attr_setinheritsched to say that they just want
to inherit (if they know that none of their threads actually mess with
scheduler attributes at all), which will save them a sched_setscheduler
call except in the doubly-special case of SCHED_RESET_ON_FORK (which we
do handle).

An alternative would be "make pthread_attr_setschedparams and
pthread_attr_setschedprio set EXPLICIT and change the platform default
to INHERIT", but even though I can only think of weird pathological
examples where anyone would notice that change, that behavior -- of
pthread_attr_setschedparams/pthread_attr_setschedprio overriding an
earlier call to pthread_attr_setinheritsched -- isn't allowed by POSIX
(whereas defaulting to EXPLICIT is).

If we have a lot of trouble with this change in the app compatibility
testing phase, though, we'll want to reconsider this decision!

 -*-

This change also removes a comment about setting the scheduler attributes
in main_thread because we'd have to actually keep them up to date,
and it's not clear that doing so would be worth the trouble.

Also make async_safe_format_log preserve errno so we don't have to be
so careful around it.

Bug: http://b/67471710
Test: ran tests
Change-Id: Idd026c4ce78a536656adcb57aa2e7b2c616eeddf
2017-10-25 14:28:42 -07:00
Elliott Hughes
fc30bfe2a4 Don't try to link(2) in a test if we're not root.
Bug: http://b/68055982
Test: ran tests
Change-Id: Icdbe3dd58fb84f3661e5d9ed3ff6884cc0ea2ff8
2017-10-24 22:54:34 -07:00
Dimitry Ivanov
0b1c8be3be Merge "linker: fix error message for inaccessible libs" 2017-10-24 06:44:19 +00:00
Elliott Hughes
bb7d9fb5d4 Improve glibc compatibility of gethostby*_r functions.
And add more tests.

Bug: N/A (but I'm here because a recent test broke existing tests)
Test: ran tests
Change-Id: Ib78430f179b43484a49bb50ff447ea6870c1ee3a
2017-10-23 17:38:35 -07:00
Treehugger Robot
8220d84f52 Merge "Fix WORD_BIT test." 2017-10-23 21:00:02 +00:00
Elliott Hughes
dc8a612bf3 Fix WORD_BIT test.
The only explanation for this and the unistd_test failures is that I
wasn't actually running the code I thought I was. There are some unrelated
netdb_test failures still to come...

Bug: N/A
Test: ran tests
Change-Id: I91af9d2d6a42f5433fa27e7cd8f5b903e1af36ba
2017-10-23 12:06:30 -07:00
Elliott Hughes
cf3a3e6774 Fix unistd.sysconf test.
A previous change added new assertions about these, but didn't remove
these old now-invalid assertions.

Bug: http://b/68133223
Test: ran tests
Change-Id: Ib6ce6e5f7abe143f2c871e074e7fd51faaf452ac
2017-10-23 17:10:53 +00:00
dimitry
8db36a51ff linker: fix error message for inaccessible libs
Added a test to make sure linker produces correct error message
when user attempts to load a library in a linked namespace and fails.

Bug: http://b/67866190
Bug: http://b/64950640
Bug: http://b/64888291
Test: bionic-unit-test --gtest_filter=dlext*
Change-Id: I5b5c2070d1388eff123118350b2b5c8fc7571a29
2017-10-23 15:14:01 +02:00
Treehugger Robot
8f348a0cce Merge "Remove some legacy declarations from <math.h>." 2017-10-20 18:40:17 +00:00
Treehugger Robot
619df557c0 Merge "Fix: linker segfault on dlopen of a DF_1_GLOBAL so" 2017-10-20 00:55:59 +00:00
Treehugger Robot
ac29d9f3b9 Merge "Add POSIX swab." 2017-10-19 21:49:29 +00:00
Elliott Hughes
5c6a7bf0dc Remove some legacy declarations from <math.h>.
These are still needed for backwards compatibility with code built by old
versions of the NDK, but we don't need to pollute the headers with them.

Also lose the hand-written code for these. The compiler-generated code
is either the same or better, and no new code is calling these functions
anyway.

Bug: N/A
Test: ran tests
Change-Id: Ib01ad9805034433e0105aec882608cc8e6526f78
2017-10-19 14:15:31 -07:00
Elliott Hughes
a1c30b98e9 Merge "Add POSIX fexecve." 2017-10-19 15:42:56 +00:00
Dimitry Ivanov
d6084a764e Merge "Use ro.debuggable property instead of checking build type" 2017-10-19 06:51:21 +00:00
Jiyong Park
01162f2469 Fix: linker segfault on dlopen of a DF_1_GLOBAL so
Added the missing null check routine.

Bug: 67755729
Test: dlfcn.dlopen_df_1_global added and it passes
Change-Id: Ibe8db18b0b5a481e2e9937041abef6d6b179dd87
2017-10-19 15:13:54 +09:00
Elliott Hughes
e3d21c84af Merge "More <limits.h> fixes." am: 8f57fd4179 am: 4dd32e00f7
am: 47ffbcad0f

Change-Id: Ia75335d51f86594d2c828e0b6c5fa492b675c6df
2017-10-18 23:35:03 +00:00
Elliott Hughes
4d215aad85 Add POSIX fexecve.
I'm skeptical about the usefulness of this, but it's in POSIX, it's
in glibc (but not iOS), and it is used in some internal source (test
runners and container code).

Bug: N/A
Test: ran tests
Change-Id: I92c5398f2a679b21a33fba92bc8e67e3ae2eb76f
2017-10-18 16:26:17 -07:00
Elliott Hughes
fa386e0d1e Add POSIX swab.
Surprisingly to me, there are actual uses of `swab` in the codebases
I have available to search, including one with a #ifndef __ANDROID__
around it.

Bug: N/A
Test: ran tests
Change-Id: Ic91b78ae22bb65c346cb46dd38916f48d979abe0
2017-10-18 13:34:32 -07:00
Elliott Hughes
19d7685982 More <limits.h> fixes.
Went through the POSIX spec for the _POSIX* and _XOPEN* constants.

Bug: http://b/32776472
Test: ran tests
Change-Id: I389100dbc7de354eae9056e44b0a7fa8c37374e3
2017-10-18 13:27:01 -07:00
dimitry
59d3062f51 Use ro.debuggable property instead of checking build type
Test: make
Change-Id: I094663c20721f345cd6684e06fcef38f300790be
2017-10-18 13:23:08 +02:00
Elliott Hughes
9793ea25c4 Merge "Add pthread_setschedprio." am: 435e6384de am: 0cf1a3699b
am: 463ab4b0f5

Change-Id: If6f7adf5f9c824e24309682309762e9ed40ab83b
2017-10-17 18:08:58 +00:00
Elliott Hughes
dff08ced56 Add pthread_setschedprio.
Bug: http://b/26204555
Test: ran tests
Change-Id: Ic34062b9b6036a1ce2642a069514bab48a893338
2017-10-17 09:14:05 -07:00
Elliott Hughes
f22fd343d7 Merge "Complete <netdb.h>." am: bf886f621b am: 8b9405e779
am: c7a36acf91

Change-Id: Idb39ed2af66acd1db2268833845d1143b02c3747
2017-10-17 16:12:23 +00:00
Elliott Hughes
bf886f621b Merge "Complete <netdb.h>." 2017-10-17 16:03:54 +00:00
Josh Gao
11e18a31dc Merge changes I93dc3811,I710d2929,I6ae029ed am: d4b4f06cad am: 9a0a7b3f5c
am: a29ad1565c

Change-Id: I35c66a1394f4d9201aea78d3ddadcc4c91e90143
2017-10-17 06:39:16 +00:00
Josh Gao
084f6ec9af Don't use PR_SET_DUMPABLE to prevent crash dumping in death tests.
Bug: http://b/27833000
Test: bionic-unit-tests are way faster
Change-Id: I6ae029edcd4c4b4b0dfaf613fc17c208d3cb24d1
2017-10-16 21:31:37 -07:00
Elliott Hughes
5033918092 Complete <netdb.h>.
Add all the missing <netdb.h> functions.

Also fix getservbyport to handle a null protocol correctly.

Also fix getservbyname/getservbyport to not interfere with getservent.

Also fix endservent to reset getservent iteration.

Also reduce unnecessary differences from upstream NetBSD sethostent.c.

The servent implementation is still horrific, and we should
probably support protoent too so that debugging tools can use
getprotobyname/getprotobynumber.

Bug: N/A
Test: ran tests
Change-Id: I639108c46df0a768af297cf3bbce857cb1bef9d9
2017-10-15 10:37:51 -07:00
Elliott Hughes
bea6a12ee0 Merge "Implement <spawn.h>." am: 01bb7bf6fb am: 1f1c3a8b80
am: bb5e49fcde

Change-Id: I44b79c654dcda78ce45239bd2a1051cfd0c9c285
2017-10-12 21:31:46 +00:00
Elliott Hughes
01bb7bf6fb Merge "Implement <spawn.h>." 2017-10-12 21:02:54 +00:00
dimitry
b48bb2dae3 Merge "ns_anonymous test: Make it work for natively bridged environment" am: b49ac81c8e am: 1ac327aed7
am: 24837ada27

Change-Id: I3525fdbfff4ae1b41ef9525a1a742a1304016221
2017-10-12 17:42:32 +00:00
Treehugger Robot
b49ac81c8e Merge "ns_anonymous test: Make it work for natively bridged environment" 2017-10-12 17:26:32 +00:00
dimitry
8eaf28dc42 ns_anonymous test: Make it work for natively bridged environment
The executable flag might not be present for the executable segment
if the code is being handled by native bridge implementation. This
commit changes the test to restore executable flag for first segment
if it was removed.

Test: bionic-unit-tests
Change-Id: Ie930539135edc4db3245574b5cbe476aa1ad49c7
2017-10-12 15:02:16 +02:00
Tom Cherry
b02df314d3 Merge "Allow read-only system properties to have arbitrary lengths" am: a08f704e2a am: 127c1f940e
am: 4735c9291f

Change-Id: I2b7983aca2a54cd2119b0efb35b21b7f3e534939
2017-10-12 00:50:14 +00:00
Tom Cherry
a08f704e2a Merge "Allow read-only system properties to have arbitrary lengths" 2017-10-12 00:22:57 +00:00
Elliott Hughes
14e3ff9f09 Implement <spawn.h>.
As described here:

  http://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawn.html

And here:

  http://man7.org/linux/man-pages/man3/posix_spawn.3.html

Bug: N/A (but mentioned in my inbox since 2013)
Test: ran tests
Change-Id: I0b27b2919b660779e3bd8a25fb429527c16dc621
2017-10-11 14:57:49 -07:00
dimitry
9bff7d8814 Merge "Fix dlopen_vdso test" am: 1d297d2654 am: c46b602403
am: ab0a1d5cd6

Change-Id: I5fb27cd474afc34f6736aef8b227121f0cdf7260
2017-10-11 19:40:04 +00:00
Treehugger Robot
1d297d2654 Merge "Fix dlopen_vdso test" 2017-10-11 19:17:10 +00:00
dimitry
b9555a9251 Fix dlopen_vdso test
arm32 is still missing vdso (at least on some kernels).
This commit adds explicit check for it and skip the test
if AT_SYSINFO_EHDR is not set.

Test: run 32bit bionic-unit-tests --gtest_filter=dlfcn.dlopen_vdso on angler
Change-Id: I7fae78c6a4f819601a4ac9e8e1da53ff07c833ff
2017-10-11 18:04:05 +02:00
Kazuhiro Inaba
8bffeaba27 Merge "Fix fcntrl#tee test to use the same expected/actual buffer size." am: a52555d356 am: 67c73cde0b
am: a1933210ef

Change-Id: I0b77906eaa0b3019b7f8170d4199595918213a24
2017-10-10 23:56:08 +00:00
Treehugger Robot
a52555d356 Merge "Fix fcntrl#tee test to use the same expected/actual buffer size." 2017-10-10 23:32:52 +00:00
Tom Cherry
8a311631ed Allow read-only system properties to have arbitrary lengths
We need to be able to store build fingerprints that are over 92 characters
long, which is the current restriction for system property value
length.

Increasing the value maximum across the board has plenty of caveats,
particularly that an allocator would be required to handle
deallocation when replacing long property values with short values.
There is also no compelling reasons to do this.

But, increasing the length of simply read-only properties, such as the
build fingerprint, has less caveats as there will never be a
deallocation of these strings.

This change uses spare bits in the top of serial (only spare for
read-only properties) to indicate if a property is 'long' or not.  The
information required to access these 'long' properties is stored in a
union where the legacy property value is located.  An error message is
retained for legacy callers.

The new property is readable via __system_property_read_callback() and
most importantly android::base::GetProperty and higher level (Java,
`getprop`) callers.  All code should move to these higher level
functions as much as possible.

Bug: 23102347
Bug: 34954705
Test: bionic unit tests
Change-Id: Ia85e0d979b92afff601cc52b39114379617a0c64
2017-10-10 15:52:25 -07:00
Elliott Hughes
731bb0f4c4 Merge "More POSIX limits cleanup." am: 7181e53cfe am: 0b071dfeed
am: f19357a158

Change-Id: I3b87e39007f2aeafc468876046da9578885734c1
2017-10-06 02:29:41 +00:00
Elliott Hughes
aaf83e8051 More POSIX limits cleanup.
http://man7.org/linux/man-pages/man7/posixoptions.7.html is a very useful
quick reference to what these are supposed to mean.

Bug: http://b/32776472
Test: ran tests
Change-Id: Icea6812d6075e663885844d7424aa6cf73d6284a
2017-10-05 16:18:10 -07:00
Elliott Hughes
86ea76009a Merge "POSIX clock cleanup." am: 0a451314b0 am: 71830bea01
am: 4fc3146765

Change-Id: I5d05f3d6cc6d52100d6a816d27a3ed696c77e772
2017-10-05 21:02:05 +00:00
Elliott Hughes
0a451314b0 Merge "POSIX clock cleanup." 2017-10-05 20:45:39 +00:00
Elliott Hughes
3a8f75d8b0 POSIX clock cleanup.
The newest of these clocks was added in Linux 2.6.12, so no need for runtime
checks.

Add CTS tests that we can actually use the various clocks.

Bug: http://b/67458266
Test: ran tests
Change-Id: I3cfd7982043d6f8d4ebdc2b29e8722334f443ce5
2017-10-05 10:33:18 -07:00
Dan Willemsen
ebf1259a2a Merge "Make bionic tests build for linux_bionic" am: 7c6784061d am: 0b537c2773
am: ce5514d287

Change-Id: I30f5ef5add1058f391a83d2a196b730be9fbdf0b
2017-10-04 21:03:58 +00:00
Treehugger Robot
7c6784061d Merge "Make bionic tests build for linux_bionic" 2017-10-04 20:13:33 +00:00
Elliott Hughes
98b03efe12 Merge "Fix pthread_leak test flakiness." am: 11dfca4c4a am: 8863421ad1
am: fb88ac00df

Change-Id: If07a27a269d2cc90c8f624c5d3065ec9fac1de2f
2017-10-04 00:34:06 +00:00
Treehugger Robot
42f3bd0ffc Merge "Sync internal and external master." 2017-10-04 00:10:31 +00:00
Elliott Hughes
11dfca4c4a Merge "Fix pthread_leak test flakiness." 2017-10-04 00:04:59 +00:00
Dan Willemsen
268ae362cd Make bionic tests build for linux_bionic
Adds a necessary library, and disables the glibc host tests when
building for bionic host.

Bug: 31559095
Test: mmma bionic
Change-Id: Ie825db59a21bf8e9b4dbdadc63ff14bf8da23087
2017-10-03 16:30:21 -07:00
Elliott Hughes
6a571e7b19 Merge "Pre-size the vector in the pthread_create ENOMEM test." am: 48fbf91672 am: c56d884b97
am: 71fb19589b

Change-Id: Ib55c1f3dee0ed9988afbb87b79b936501028fc17
2017-10-03 22:39:30 +00:00
Elliott Hughes
5a7c950909 Sync internal and external master.
Not sure how this managed to cling on in AOSP master, but all the other
mentions of this constant in AOSP master are already expecting the new
value anyway.

Bug: N/A
Test: ran tests
Change-Id: I8b6b4b320eeb1c4cea1c06bea4c1e8e314ee344d
2017-10-03 15:19:02 -07:00
Jiyong Park
41704cdf61 Don't run exec_with_ld_config_file* tests on non-production devices
The tests that use LD_CONFIG_FILE environment variable shouldn't be run
on non-production devices because LD_CONFIG_FILE is only for debuggable
builds. We have used the build-time flag USE_LD_CONFIG_FILE, which is
set for the debuggable builds, to conditionally include or exclude the
tests. However, this can be a problem when 1) the device is not
debuggable but 2) the CTS itself is built with debuggable target. So,
instead of relying on the build-time flag USE_LD_CONFIG_FILE, the tests
now check the debuggability of the device and skip the tests when it
isn't debuggable.

Bug: 65842135
Test: 1) flash user build image to a 2017 pixel device.
2) build cts with 'userdebug' build target
3) CtsBionicTestCases pass on the device

(cherrypick of 5e3d44100be32fd5efffd0c309bd90c04cc9620c.)

Change-Id: Ib88e3b26d093e5479d52cd87db47dee5e108cac2
2017-10-03 15:03:44 -07:00
Elliott Hughes
a838490101 Fix pthread_leak test flakiness.
Stop allocating and deallocating memory as part of the test itself.

There's still the fopen, but since our stdio reuses existing structs,
that doesn't seem to be a problem in practice.

Bug: http://b/67077411
Test: ran tests with --gtest_repeat=1000
Change-Id: I99de5de0911161ec04afe75653075f1ccefb01a5
2017-10-03 13:51:45 -07:00
Elliott Hughes
575129886c Pre-size the vector in the pthread_create ENOMEM test.
Just to avoid the possibility of an unfortunate mmap occurring in order to
grow the vector.

Bug: N/A
Test: ran tests
Change-Id: I850740461d761916a0377272664159d010da7b84
2017-10-03 12:20:07 -07:00
Chih-Hung Hsieh
dfbff07c92 Merge "Use -Werror in bionic" am: 9385d778fd am: 7887421aed
am: a4fcd22ffd

Change-Id: I40302d02f9f70c2d020d029336c4c73816636de8
2017-10-02 22:28:38 +00:00
Treehugger Robot
9385d778fd Merge "Use -Werror in bionic" 2017-10-02 22:04:48 +00:00
Chih-Hung Hsieh
84f0dcd59e Use -Werror in bionic
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: Ic68141a5c50880c485646e38349f94b866267bd9
2017-10-02 13:21:22 -07:00
dimitry
0de4982099 Merge "Replace abort with exit(1) in __linker_cannot_link" am: 95f90784ea am: 2161b032e0
am: 4eae0fc50a

Change-Id: I3ffe725ed2977cb211ba96d02dca03e7d4046547
2017-09-29 20:05:17 +00:00
Treehugger Robot
95f90784ea Merge "Replace abort with exit(1) in __linker_cannot_link" 2017-09-29 19:53:17 +00:00
Elliott Hughes
fa1d5e473b Merge "Require getrandom(2)." am: b93f2631e4 am: 3e6a64901a
am: b1fbb46d00

Change-Id: I5eb10e80c40fb838df97a9263d90151aa8e6d8fc
2017-09-29 19:12:39 +00:00
dimitry
04f7a798cf Replace abort with exit(1) in __linker_cannot_link
Bug: http://b/67038409
Test: bionic-unit-tests
Change-Id: I7d39b44f2da8c5111ac8a9faf3416f19d5a35c05
2017-09-29 19:48:46 +02:00
Elliott Hughes
89794c4239 Merge changes I76dde1e3,I54fec461 am: b3639adf9c am: a76e668634
am: 5f3eb36898

Change-Id: Ifed38d4fa8c7835b3771ea8112ea8270bb5c31e5
2017-09-29 17:10:58 +00:00
Elliott Hughes
6a5dfebd41 Require getrandom(2).
It's almost 2018, Linux 3.17 -- the first kernel with getrandom(2) --
was released in October 2014, and being able to assume getrandom lets
us simplify and improve some security-related code in libc, and revert a
hack to getentropy that's been necessary in the meantime. Only the fugu
kernel doesn't have getrandom(2) at this point, and that's EOL.

Bug: http://b/67014255
Test: ran tests
Change-Id: I1736f4dd33d50fe99e7a524851180989f4c85a33
2017-09-29 09:01:01 -07:00
Elliott Hughes
b3639adf9c Merge changes I76dde1e3,I54fec461
* changes:
  Add <sys/random.h>.
  Run other maintenance scripts as part of the preupload hooks.
2017-09-29 15:39:29 +00:00
Dan Willemsen
48343a80a7 Merge "Remove default libraries" am: bd2754177f am: 19e2c5b81b
am: 719ba0c39d

Change-Id: I2ce8a61f8d57fff26d1cb3255c5db6a4fb07cd8e
2017-09-29 09:55:27 +00:00
Elliott Hughes
8465e968a8 Add <sys/random.h>.
iOS 10 has <sys/random.h> with getentropy, glibc >= 2.25 has
<sys/random.h> with getentropy and getrandom. (glibc also pollutes
<unistd.h>, but that seems like a bad idea.)

Also, all supported devices now have kernels with the getrandom system
call.

We've had these available internally for a while, but it seems like the
time is ripe to expose them.

Bug: http://b/67014255
Test: ran tests
Change-Id: I76dde1e3a2d0bc82777eea437ac193f96964f138
2017-09-29 05:31:35 +00:00
Dan Willemsen
ae407e522a Remove default libraries
libdl is part of system_shared_libs now. -ldl -lpthread -lm are now defaults
for host_ldlibs on Linux and Darwin. -lrt is a default for host_ldlibs on
Linux.

Test: m host
Test: mmma bionic
Change-Id: I966e2f88c24fba5e412bee6b6382045a2026a8e4
2017-09-28 16:16:14 -07:00
Elliott Hughes
f43c91a035 Merge "Add <glob.h>." am: b736c41ffe am: a9b9b12728
am: 6122258c90

Change-Id: I6a7d5cd1610b779c4dc91b7f376947804a6c4cc1
2017-09-28 17:27:38 +00:00
Elliott Hughes
b736c41ffe Merge "Add <glob.h>." 2017-09-28 17:01:06 +00:00
Elliott Hughes
f1c568d1ea Add <glob.h>.
This is the FreeBSD implementation, plus some tests. The FreeBSD
implementation includes the GNU extensions and seems to be what
iOS is using too, which should provide bug compatibility for app
developers.

The code unfortunately uses a lot of stack, and uses FreeBSD locale
implementation that we don't have, but it does seem better maintained
than the other BSDs.

Bug: http://b/29251134
Test: ran tests
Change-Id: Ie477b45e42a6df1319b25712098519d2b33adf67
2017-09-26 18:46:09 -07:00
dimitry
df775eda92 Merge "Link vdso before linking the main executable" am: 62767bc31d am: 348161ed3c
am: ce97d243f1

Change-Id: Ic65207315cd9cb03d77f305428d73d6cb0936bac
2017-09-26 17:20:29 +00:00
dimitry
c18de1bd47 Link vdso before linking the main executable
Also set linked flag after it is linked and
call constructors. Set RTLD_NODELETE flag to
prevent accidental unloads.

Test: bionic-unit-tests --gtest_filter=dl*:Dl*
Test: bionic-unit-tests-glibc --gtest_filter=dl*
Change-Id: Ib2178849b918cbefd6f8fcfe6d1f78889fe0bf76
2017-09-26 14:34:18 +02:00
Kazuhiro Inaba
f7a8e95fe8 Fix fcntrl#tee test to use the same expected/actual buffer size.
Previously the test compared /proc/version read into expected[256]
with actual[BUFSIZ]. This CL aligns the both of the buffer sizes to
the same BUFSIZ, so that /proc/version longer than 256 bytes won't
result in a test failure.

Bug: 66872345
Test: fcntl#tee on a device with long /proc/version (Chromebook Plus)
Change-Id: I004dd2189565b0bdde1aa22a2f25fafe74560180
(cherry picked from commit 85a08ae9fead3f24daf108108257e4793a192e5f)
2017-09-25 23:34:19 +00:00
Jiyong Park
84bc230f27 Merge "Don't run exec_with_ld_config_file* tests on non-production devices" into oc-mr1-dev
am: 146fa6b458

Change-Id: Ife179503595f1652e3eaa0bc395e0a03bc1ffca5
2017-09-21 05:24:26 +00:00
TreeHugger Robot
146fa6b458 Merge "Don't run exec_with_ld_config_file* tests on non-production devices" into oc-mr1-dev 2017-09-21 05:17:21 +00:00
Jiyong Park
5e3d44100b Don't run exec_with_ld_config_file* tests on non-production devices
The tests that use LD_CONFIG_FILE environment variable shouldn't be run
on non-production devices because LD_CONFIG_FILE is only for debuggable
builds. We have used the build-time flag USE_LD_CONFIG_FILE, which is
set for the debuggable builds, to conditionally include or exclude the
tests. However, this can be a problem when 1) the device is not
debuggable but 2) the CTS itself is built with debuggable target. So,
instead of relying on the build-time flag USE_LD_CONFIG_FILE, the tests
now check the debuggability of the device and skip the tests when it
isn't debuggable.

Bug: 65842135
Test: 1) flash user build image to a 2017 pixel device.
2) build cts with 'userdebug' build target
3) CtsBionicTestCases pass on the device

Change-Id: Ib88e3b26d093e5479d52cd87db47dee5e108cac2
2017-09-21 11:57:38 +09:00
Elliott Hughes
bd8391f80d Merge "Improve pthread_create failure handling." am: e27d29cfaf am: 87c0bddba9
am: 30c907352c

Change-Id: I37cb864fbfae7ced32ef020816f03fc484fee4f5
2017-09-19 23:57:30 +00:00
Treehugger Robot
e27d29cfaf Merge "Improve pthread_create failure handling." 2017-09-19 23:44:23 +00:00
Evgenii Stepanov
4994552198 Extend cfi test to verify a range of target pointers.
Test: bionic device tests
Bug: 63400743
Bug: 65590288

(cherry picked from commit 1dfd76ac2c)

Change-Id: I33832ef9ab98baf52afe969ea7a03fe419f93cb2
2017-09-19 16:21:22 -07:00
Evgenii Stepanov
6b230cd2de Merge "Extend cfi test to verify a range of target pointers." am: 1ec162d392 am: 8f9268c0f3
am: 86abadb822

Change-Id: Ic676701b948b04b9d8afd07b785cf1a14f2249e2
2017-09-19 22:54:00 +00:00
Elliott Hughes
53dc9dd701 Improve pthread_create failure handling.
Return EAGAIN rather than aborting if we fail to set up the TLS for a new
thread.

Add a test that uses all the VMAs so we can properly test these edge cases.

Add an explicit test for pthread_attr_setdetachstate, which we use in the
previous test, but other than that has no tests.

Remove support for ro.logd.timestamp/persist.logd.timestamp, which doesn't
seem to be used, and which prevents us from logging failures in cases where
mmap fails (because we need to mmap in the system property implementation).

Bug: http://b/65608572
Test: ran tests
Change-Id: I9009f06546e1c2cc55eff996d08b55eff3482343
2017-09-19 14:02:50 -07:00
Evgenii Stepanov
1dfd76ac2c Extend cfi test to verify a range of target pointers.
Test: bionic device tests
Bug: 63400743
Bug: 65590288
Change-Id: Ic4ef9630a2db709cf4edcc7f76c791df3f349192
2017-09-19 13:59:34 -07:00
Elliott Hughes
1deb26e6ff Merge "Support larger guard regions." am: dacbb04cde am: 951f4af9ce
am: eadf51ccbe

Change-Id: Ib4e8e1d35be5fad89deb25ff284939dddb94dd01
2017-09-19 01:17:55 +00:00
Treehugger Robot
dacbb04cde Merge "Support larger guard regions." 2017-09-19 01:08:25 +00:00
Elliott Hughes
d6c678ca90 Support larger guard regions.
This also fixes a long-standing bug where the guard region would be taken
out of the stack itself, rather than being -- as POSIX demands -- additional
space after the stack. Historically a 128KiB stack with a 256KiB guard would
have given you an immediate crash.

Bug: http://b/38413813
Test: builds, boots
Change-Id: Idd12a3899be1d92fea3d3e0fa6882ca2216bd79c
2017-09-18 16:09:43 -07:00
Elliott Hughes
f810219ce7 Merge "Always log errno when aborting." am: 0c9ea17e0c am: 002b30843b
am: 5d1cf56ce5

Change-Id: I1999c656307aea0a0a0372248d65a05657546e59
2017-09-18 21:44:57 +00:00
Elliott Hughes
b89260790d Merge "Use __RENAME for long double functions." am: df862454b6 am: c4287cec82
am: 79dd9b7c0e

Change-Id: Icc362b01d39427f79cbea235cc54a14274df560e
2017-09-18 21:44:38 +00:00
Treehugger Robot
0c9ea17e0c Merge "Always log errno when aborting." 2017-09-18 21:33:54 +00:00
Elliott Hughes
df862454b6 Merge "Use __RENAME for long double functions." 2017-09-18 21:33:06 +00:00
Elliott Hughes
7b0af7ad82 Always log errno when aborting.
(Where errno is relevant.)

Also consistently use -1 as the fd for anonymous mmaps. (It doesn't matter,
but it's more common, and potentially more intention-revealing.)

Bug: http://b/65608572
Test: ran tests
Change-Id: Ie9a207632d8242f42086ba3ca862519014c3c102
2017-09-15 16:18:49 -07:00
Bill Yi
5828840e72 Merge remote-tracking branch 'aosp/oreo-cts-dev' into HEAD 2017-09-15 13:44:31 -07:00
Elliott Hughes
50cda38f1d Use __RENAME for long double functions.
We can cut a lot of stuff out of the NDK's libandroid_support with this,
and reduce unnecessary relocations for all LP32 code. LP64 code should
be unaffected.

Bug: https://issuetracker.google.com/64450768
Bug: https://github.com/android-ndk/ndk/issues/507
Test: ran tests, plus manual readelf on the _test.o files
Change-Id: I3de6015921195304ea9c829ef31665cd34664066
2017-09-14 16:10:43 -07:00
Lennart Wieboldt
9deb345edd Merge "Remove clang: true" am: 7e6f98b93d am: af4de40428
am: fbf0f50632

Change-Id: I9b11125cf544029b93f28e943a1b0ddfa0fb6bc4
2017-09-11 22:04:13 +00:00
Lennart Wieboldt
af4de40428 Merge "Remove clang: true"
am: 7e6f98b93d

Change-Id: Ib97ff76648505fa29d7e764ecaeabe2a1ea84906
2017-09-11 21:48:09 +00:00
Treehugger Robot
7e6f98b93d Merge "Remove clang: true" 2017-09-11 21:39:41 +00:00
Lennart Wieboldt
2286b9f5ae Remove clang: true
clang is the default compiler since Android nougat

Test: mma & verified it´s still build with clang
Change-Id: Id8b5361d18c1b2febb2dc6cc44502feaa08f605c
Signed-off-by: Lennart Wieboldt <lennart.1997@gmx.de>
2017-09-11 21:43:58 +02:00
Elliott Hughes
3cf002aef5 Merge "Finish <search.h>." am: 4c9d528a25 am: 9b0889c7bd
am: 886d1b5b63

Change-Id: I1d74385fe8f6a09b621097dd92c21b3daee79a6d
2017-09-11 18:50:51 +00:00
Elliott Hughes
9b0889c7bd Merge "Finish <search.h>."
am: 4c9d528a25

Change-Id: I39f10ca14b88d4c9075e83105f3b7101da610269
2017-09-11 18:40:59 +00:00
Elliott Hughes
4c9d528a25 Merge "Finish <search.h>." 2017-09-11 18:39:30 +00:00
Elliott Hughes
df71545eba Merge "Trivial tests for <inttypes.h>/<stdlib.h> *abs and *div functions." am: 60103831eb am: 5398ead784
am: c7ad49251e

Change-Id: Ib7cdf6e0671ed4966b62611f9368ac22dd05ab52
2017-09-08 20:03:07 +00:00
Elliott Hughes
5398ead784 Merge "Trivial tests for <inttypes.h>/<stdlib.h> *abs and *div functions."
am: 60103831eb

Change-Id: I5542305cc9142072613267346f4bdfad8748a2a0
2017-09-08 19:43:06 +00:00
Elliott Hughes
00d8a8b779 Trivial tests for <inttypes.h>/<stdlib.h> *abs and *div functions.
Because I want something to copy & paste into the NDK support library test
that's slightly better than taking the address of the function...

Bug: https://github.com/android-ndk/ndk/issues/502
Test: ran tests
Change-Id: If43089d16691d6a4dcf5d972450b14ed85bbca81
2017-09-07 17:01:37 -07:00
Elliott Hughes
5702c6ff45 Finish <search.h>.
I'm unable to find a bug, but we've had requests for this internally
once or twice (though I pointed those folks at the STL), and there's
code we build for the host or in our bootloaders that would use this,
and there's reasonable-looking FreeBSD implementation ready and waiting.

Bug: N/A
Test: ran tests
Change-Id: I6ddee4b71bea4c22ed015debd31d3eaac4fcdd35
2017-08-31 17:38:51 -07:00
Elliott Hughes
cfffa48498 Merge "Add an extra test for a POSIX iconv requirement." am: b20c246fc9 am: 44022d3d1d
am: eee0f02f11

Change-Id: Ide2dd71edc5d0e2869e3b95c76c23bbfdfc12d8c
2017-09-01 00:00:03 +00:00
Elliott Hughes
44022d3d1d Merge "Add an extra test for a POSIX iconv requirement."
am: b20c246fc9

Change-Id: Iec293ed1cc9b0b7611f76f02839a69ba6495787f
2017-08-31 23:52:35 +00:00
Treehugger Robot
b20c246fc9 Merge "Add an extra test for a POSIX iconv requirement." 2017-08-31 23:45:27 +00:00
Elliott Hughes
d40a833ab0 Add an extra test for a POSIX iconv requirement.
Bug: N/A
Test: ran tests
Change-Id: If211bf2a74ac3a6e8e84375c88f6c2580c392d50
2017-08-31 14:14:16 -07:00
Jiyong Park
7f1e941ab6 Make dlext.ns_shared be independent of default namespace config
am: 917d34a84f

Change-Id: I1b459654147912c5a8169126773e585bc5364f2a
2017-08-31 18:13:05 +00:00
Jiyong Park
917d34a84f Make dlext.ns_shared be independent of default namespace config
dlext.ns_shared creates a child namespace, which is isolated & shared,
from the default namespace. It then checks whether a lib that was loaded
in the parent(=default) namespace *after* the child namespace is created
is not accessible to the child namespace. Because this test is using the
default namespace as a parent namespace, the test result is dependent on
the specific configuration of the default namespace, which isn't
desirable.

Specifically, since ANDROID_NAMESPACE_TYPE_SHARED now copies search
paths and permitted paths of the parent namespace to the child namespace,
a lib that is accessible to the former is also accessible to the latter
even if the lib hasn't been shared when creating the latter. So, the
result of the test varies depending on whether the default namespace has
permitted paths or not. (if it is configured as an isolated namespace
and has permitted paths, then the test fails).

In order to make this test be independent from how the default namespace
is configured, a parent namespace is explicitly created and the child
namespaces are created from the parent namespace, not from the default
namespace.

Bug: 65189955
Test: bionic-unit-tests --gtest_filter=dlext.ns_shared successful
Test: the same test successful when the default namespace is configured
as follows
namespace.default.isolated = true
namespace.default.permitted_paths = ...:/data

Change-Id: Ifa33c6c42f8c327b2b1c380c7abba8e8f1afee82
2017-08-31 14:11:49 +09:00
Jiyong Park
e1c82be90b Merge "Don't run disable_ld_config_file test on non-production devices"
am: 7f9f1b6f91

Change-Id: I256ad6da2e890d4b50b5aaa9ae47a3e64253538e
2017-08-31 00:08:29 +00:00
Treehugger Robot
7f9f1b6f91 Merge "Don't run disable_ld_config_file test on non-production devices" 2017-08-30 23:57:40 +00:00
Jiyong Park
ac184dd383 Merge "Don't run disable_ld_config_file test on non-production devices" into oc-mr1-dev
am: 4ce79ba154

Change-Id: I517179e1b527dfe8d88f9048f6c9fcf6b7252b56
2017-08-30 19:06:53 +00:00
Elliott Hughes
f4eb1c7554 Merge "Use have_dl to guard all tests that rely on icu4c." am: b3aea2bb9a am: 6446acf814
am: b1958d2277

Change-Id: I94ffc7a1e4c1bb9b42359eec805a475618cc6749
2017-08-30 18:47:23 +00:00
Elliott Hughes
6446acf814 Merge "Use have_dl to guard all tests that rely on icu4c."
am: b3aea2bb9a

Change-Id: Ib5c30b73698e98e54fc4e2a9f0287683a2923caa
2017-08-30 18:33:33 +00:00
Treehugger Robot
b3aea2bb9a Merge "Use have_dl to guard all tests that rely on icu4c." 2017-08-30 18:22:37 +00:00
Jiyong Park
4945d8f121 Don't run disable_ld_config_file test on non-production devices
The test always fails when run on non-production devices. Silence the
expected failure.

Bug: 64908138
Test: run CtsBionicTestCases on userdebug device. disable_ld_config_file
test does not fail.

Merged-In: Icd24a356dfbc62f540e3263070434a4fd065bfbc
Change-Id: Icd24a356dfbc62f540e3263070434a4fd065bfbc
(cherry picked from commit 157655dc67)
2017-08-31 01:42:55 +09:00
Elliott Hughes
ded2e6c7bb Merge "Add tests for all C11 headers." am: 76a4bb980c am: ed7a15453d
am: 6b1f428dd3

Change-Id: I6b2e61a1f7776f83e7d4b21479df72dea2a160a8
2017-08-30 16:23:25 +00:00
Elliott Hughes
966d8a321e Use have_dl to guard all tests that rely on icu4c.
Bug: http://b/65138342
Test: ran tests
Change-Id: Iddded068a2481e8b15e102c8705545a886ae2772
2017-08-30 16:17:40 +00:00
Elliott Hughes
ed7a15453d Merge "Add tests for all C11 headers."
am: 76a4bb980c

Change-Id: I44c85180e90d5f635ecd2223a8de011a007d4214
2017-08-30 16:07:53 +00:00
Jiyong Park
157655dc67 Don't run disable_ld_config_file test on non-production devices
The test always fails when run on non-production devices. Silence the
expected failure.

Bug: 64908138
Test: run CtsBionicTestCases on userdebug device. disable_ld_config_file
test does not fail.

Change-Id: Icd24a356dfbc62f540e3263070434a4fd065bfbc
2017-08-30 11:30:53 +09:00
Elliott Hughes
45da326324 Add tests for all C11 headers.
Well, all except <threads.h> which we have no current plans to implement.

The only thing this turned up is that clang's <float.h> doesn't define
FLT_HAS_SUBNORM/DBL_HAS_SUBNORM/LDBL_HAS_SUBNORM, so for now we assert
that those are missing so that when we get a fixed clang, we notice.

Also the <tgmath.h> is utterly perfunctory, but seems like an appropriate
amount of effort to put in.

Bug: N/A
Test: ran tests
Change-Id: I7f7a7040b3271ceda625bee8a40a9d8cef52ee44
2017-08-29 15:32:18 -07:00
Elliott Hughes
0977c8baa1 Merge "Implement <iconv.h>." am: d615a06068 am: 94e366e616
am: 01987bfc77

Change-Id: I1c9a36ed0123db89aec989e74ddd40cd789760ab
2017-08-25 21:16:07 +00:00
Elliott Hughes
94e366e616 Merge "Implement <iconv.h>."
am: d615a06068

Change-Id: I22e3bf2d373c752115c27f0d5c9cb6a9b1ea3c76
2017-08-25 21:11:39 +00:00
Elliott Hughes
a648733cb7 Implement <iconv.h>.
Bug: http://b/32978596
Test: ran tests
Change-Id: I56b6ae3d9c5a3a56d2b4afba33fb8f9e964bf7b9
2017-08-25 08:47:41 -07:00
Elliott Hughes
1a61d3e26b Merge "Add syncfs(2)." am: fa3d3291e1 am: 1d1f15ab1b
am: cbea75b46b

Change-Id: Ic2a4c90bf1cfadc72cfba60558f751bc9604a2c5
2017-08-25 15:06:06 +00:00
Elliott Hughes
1d1f15ab1b Merge "Add syncfs(2)."
am: fa3d3291e1

Change-Id: I6ac91294e9cf5ff8d0b44fc3ddc46b6ee3fbd9bf
2017-08-25 14:56:34 +00:00
Elliott Hughes
896362eb0e Add syncfs(2).
GMM calls this system call directly at the moment. That's silly.

Bug: http://b/36405699
Test: ran tests
Change-Id: I1e14c0e5ce0bc2aa888d884845ac30dc20f13cd5
2017-08-24 16:31:49 -07:00
George Burgess IV
bc67a8422a Merge "tests: explain how to debug FileCheck failures" am: 96c577c482 am: 2b5441276c
am: 4c63cd1158

Change-Id: Icae45f024a1ad25b59c450ca6d9f4b0c41ec119e
2017-08-24 18:19:54 +00:00
George Burgess IV
2b5441276c Merge "tests: explain how to debug FileCheck failures"
am: 96c577c482

Change-Id: Ie7b823205860b047c36148fdf73434b3a8a4b58f
2017-08-24 18:10:24 +00:00
George Burgess IV
c7bd90ff6f tests: explain how to debug FileCheck failures
As requested by enh@ in Ie9ed1fbcc794e14a0c9bba13b5307ad677949613.

Bug: None
Test: mma
Change-Id: I3beb97fb500faa50d79f9355898bf778ab1184bd
2017-08-24 00:36:15 +00:00
Logan Chien
7b7eea1e3d Merge "Fix wchar.wcstold_hex_floats on arm64" am: 96ba713f73 am: dbe3d36999 am: afea670564
am: 07b15a3f74

Change-Id: I6abdedc7c77a3c3a0a0b2382742f5b7652b95492
2017-08-23 07:32:58 +00:00
Logan Chien
afea670564 Merge "Fix wchar.wcstold_hex_floats on arm64" am: 96ba713f73
am: dbe3d36999

Change-Id: I356c1475adf2950988fa238ae81b8b8b833720ba
2017-08-23 07:26:57 +00:00
Logan Chien
96ba713f73 Merge "Fix wchar.wcstold_hex_floats on arm64" 2017-08-23 07:16:34 +00:00
Christopher Ferris
1f17049808 Merge "Refactor BufferOutputStream." am: 1b3fe44e3d am: a3c50668cf am: 3884fe23ba
am: 476cff09e6

Change-Id: I3a53acc5bf834792c6ddc85658bf6dc903d59c6e
2017-08-22 23:40:09 +00:00
Christopher Ferris
3884fe23ba Merge "Refactor BufferOutputStream." am: 1b3fe44e3d
am: a3c50668cf

Change-Id: Ia6d7243f1791fb47e62e67044a068e48774c180a
2017-08-22 23:21:29 +00:00
Christopher Ferris
1b3fe44e3d Merge "Refactor BufferOutputStream." 2017-08-22 22:50:32 +00:00
Christopher Ferris
9247640711 Refactor BufferOutputStream.
- Rewrite BufferOutputStream to handle 0 sized buffers and to get rid
  of an unnecessary loop.
- Add tests to verify overflow corner cases.
- Implement async_safe_format_buffer to call async_safe_format_buffer_va_list
  instead of duplicate the code.

Test: Ran new unit tests, booted on angler.
Change-Id: I7fb13e209f5b7443d212f55aab4b05ff2e0e8219
2017-08-22 13:17:28 -07:00
Logan Chien
0288dbb739 Fix wchar.wcstold_hex_floats on arm64
This commit fixes wchar.wcstold_hex_floats on arm64.  On AArch64
(ARM64), the `long double` type has 128 bits and is more precise then
`double` type (64-bit).  As a result, `1e100L` is slightly different
from `static_cast<long double>(1e100)`.

This commit fixes the regression by adding 'L' after the floating point
literals.  This should work because casting from a higher precision
to lower precision won't lose any precisions.

Test: adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests \
  --gtest-filter=wchar.wcstold_hex_floats
Test: adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests
Test: adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests

Change-Id: Ibd7b6a5d46c38338b4ca56838d9d272c710b32f6
2017-08-22 17:52:02 +08:00
George Burgess IV
d9e9dcc559 Merge "Disable FORTIFY on ASAN builds" am: 7ac99d3ff6 am: 411814e0a9 am: 8060209ab2
am: a07c6a9680

Change-Id: I6db0200a35221a24067780b38caead5f69060b5f
2017-08-18 23:05:11 +00:00
George Burgess IV
8060209ab2 Merge "Disable FORTIFY on ASAN builds" am: 7ac99d3ff6
am: 411814e0a9

Change-Id: Ia5ef40f1402fedb6946654033b5c2c4e8ef2c4e3
2017-08-18 23:00:10 +00:00
George Burgess IV
411814e0a9 Merge "Disable FORTIFY on ASAN builds"
am: 7ac99d3ff6

Change-Id: Ib469956edc364bd0d4af59dc5a79439528bf5efd
2017-08-18 22:58:12 +00:00
George Burgess IV
d9551db089 Disable FORTIFY on ASAN builds
FORTIFY's *_chk functions mess with ASAN's library function
interceptors, which can apparently result in false-positives.

Since adding even more complexity to every run-time check condition in
FORTIFY doesn't seem like a great idea, and the majority of our builds
will still use FORTIFY anyway, turning FORTIFY off here seems
reasonable.

Bug: 63104159
Test: checkbuild on internal master + CtsBionicTestCases. No new
failures.

Change-Id: Id32e551e28ee70a9815ad140c3253b86f03de63f
2017-08-18 13:33:45 -07:00
Evgenii Stepanov
115e0e785a [cfi] Export __cfi_shadow_size.
__cfi_shadow_size returns the size of the CFI shadow mapping, or 0 if
CFI is not (yet) used in this process. This can be used to adjust
RLIMIT_AS setting.

Test: device bionic tests
Bug: 64293803

(cherry picked from commit 97c16f8dca)

Change-Id: Ia82152f568e3a80deb902d02fa400e88e3f556bc
2017-08-17 17:34:52 -07:00
Evgenii Stepanov
fbf9c064ad Merge changes from topic "cfi-shadow-size" am: fc89237b77 am: 62adbbf5e8 am: b502d57d7f
am: 0730f0ce6d

Change-Id: Ib33ab43015edefb91c930b4a0a3453aeb905fe78
2017-08-17 00:54:07 +00:00
Evgenii Stepanov
b502d57d7f Merge changes from topic "cfi-shadow-size" am: fc89237b77
am: 62adbbf5e8

Change-Id: I8efeadc018b296b6875f3837e62bdbd8fab2f75d
2017-08-17 00:42:14 +00:00
Evgenii Stepanov
62adbbf5e8 Merge changes from topic "cfi-shadow-size"
am: fc89237b77

Change-Id: I34c706c542e338616d07035e5209d727a43c69bb
2017-08-17 00:37:59 +00:00
Treehugger Robot
fc89237b77 Merge changes from topic "cfi-shadow-size"
* changes:
  Revert "Revert "arm64: expand CFI shadow to cover 48-bit virtual addresses""
  [cfi] Export __cfi_shadow_size.
2017-08-17 00:16:56 +00:00
George Burgess IV
0f2f92c5c8 Merge "libc fortify: error on realpath(NULL, foo)" am: 6beab08440 am: 87fcfefe26 am: ff69b4fefc
am: fdc35cb9f4

Change-Id: I553b2237a1c4b949d9e4741506fdf4980776212c
2017-08-15 18:12:04 +00:00
George Burgess IV
ff69b4fefc Merge "libc fortify: error on realpath(NULL, foo)" am: 6beab08440
am: 87fcfefe26

Change-Id: I289b496e80533d3fe45781f9b86d000e25c5dfbd
2017-08-15 17:50:31 +00:00
George Burgess IV
87fcfefe26 Merge "libc fortify: error on realpath(NULL, foo)"
am: 6beab08440

Change-Id: I50cf25955d28df10661e08579fac001f7abdab5f
2017-08-15 17:45:01 +00:00
George Burgess IV
95bd4884b5 libc fortify: error on realpath(NULL, foo)
I've half a mind to make this a warning instead, since this sort of
call isn't UB. That said:
- if the user really wants this (I can't imagine why they would), they
  can just put NULL in a non-const variable,
- we're slowly moving to -Werror ~everywhere anyway, and
- it's presumably easier to change this from an error to a warning than
  the other way around

Bug: 12231437
Test: m checkbuild on bullhead internal master. No new
CtsBionicTestCases failures.

Change-Id: Ie8bf5a3455f663686fda4a7450fb35d147fa745e
2017-08-14 14:48:55 -07:00
Elliott Hughes
68ab54444a Fix the sysconf _SC_2_VERSION test.
Not sure how this ended up broken. Too many branches!

Bug: http://b/64565873
Test: ran tests

(cherry picked from commit 6c135f4c41)

Change-Id: Ie7078541d2a75fb2fbcf03e78a49707307b674c0
2017-08-10 14:33:15 -07:00
Dan Albert
f95cedade4 Merge changes I36924c4b,Ib6bdd09e am: 32f719ad1a am: 2104cf6795 am: 12dc66bceb
am: e5ba6f1adb

Change-Id: I3ef7554da3689455877a0f51e1bb92d73206bf06
2017-08-10 02:20:56 +00:00
Dan Albert
12dc66bceb Merge changes I36924c4b,Ib6bdd09e am: 32f719ad1a
am: 2104cf6795

Change-Id: I863c54ec6efa981c0cb6c9478bfa7937ed011cc9
2017-08-10 02:15:25 +00:00
Dan Albert
2104cf6795 Merge changes I36924c4b,Ib6bdd09e
am: 32f719ad1a

Change-Id: I5da04c1304ca69e9fbae4d1a559c2b6ccf428b1b
2017-08-10 02:12:57 +00:00
Treehugger Robot
32f719ad1a Merge changes I36924c4b,Ib6bdd09e
* changes:
  Expand swprintf tests.
  Expand wcsto* tests.
2017-08-10 02:07:34 +00:00
Dan Albert
cfd192bbcb Merge "Fix include to be file-relative." am: e8658b3022 am: e7c0abea6b am: 1d5d31ebdf
am: e3d5208a67

Change-Id: Ib4071bc85162ff245a5526c0d5381e39502a6851
2017-08-10 00:30:13 +00:00
Dan Albert
1d5d31ebdf Merge "Fix include to be file-relative." am: e8658b3022
am: e7c0abea6b

Change-Id: I571b71a579795c21a735900ae4851acab41073a7
2017-08-09 22:39:42 +00:00
Dan Albert
e7c0abea6b Merge "Fix include to be file-relative."
am: e8658b3022

Change-Id: I6eb9aee12056817ee656cc54b0e36ac07fe415fe
2017-08-09 22:31:49 +00:00
Dan Albert
9601f162f4 Expand swprintf tests.
Test: bionic unit tests
Bug: None
Change-Id: I36924c4bdd2fa2c25e50ef7fef5500a365721a05
2017-08-09 14:59:33 -07:00
Dan Albert
6805c2db39 Expand wcsto* tests.
Test: bionic unit tests
Bug: None
Change-Id: Ib6bdd09ea2b30274f5312d2edd63ba9e727e9b9c
2017-08-09 14:55:27 -07:00
Dan Albert
b2ca03140d Fix include to be file-relative.
Discovered while trying to build this with the NDK.

Test: make checkbuild
Bug: None
Change-Id: Id5289065d7a1b36f20b0963b38b6ef4dc1d461b9
2017-08-07 16:28:13 -07:00
Tom Cherry
1342527b57 Remove a check for AIDs in the OEM range. am: c2c36b661c
am: fe1dc33b28

Change-Id: Ic2107c9550f368db0ada5cc3f680bf289734a812
2017-08-04 21:31:58 +00:00
Tom Cherry
fe1dc33b28 Remove a check for AIDs in the OEM range.
am: c2c36b661c

Change-Id: Ic99c543a3cf5eaad251fc07957262f144c5f7b97
2017-08-04 21:25:57 +00:00
Tom Cherry
5736dfca2e Merge "Remove a check for AIDs in the OEM range." am: f631e5a001 am: 76f68b3357 am: d85afe5f34
am: df34f7091d

Change-Id: I5ac0fc5f3ed39db739b6869f1e6f98004431a9ac
2017-08-04 20:58:10 +00:00
Tom Cherry
d85afe5f34 Merge "Remove a check for AIDs in the OEM range." am: f631e5a001
am: 76f68b3357

Change-Id: I5676fec81a02bb90acff278991743fb097c9e453
2017-08-04 20:45:26 +00:00
Elliott Hughes
b2c23b7265 Merge "With O_TMPFILE, open(2) takes a mode argument." am: 2fdefadcee am: 212ea2b74e am: ff6f1697ec
am: 06701782a2

Change-Id: I70a6e0b016abda50aafc969c2a9452b1195a9a57
2017-08-04 20:39:18 +00:00
Tom Cherry
76f68b3357 Merge "Remove a check for AIDs in the OEM range."
am: f631e5a001

Change-Id: I712af017b833facad83e9d1e21d0c691c02e9559
2017-08-04 20:38:56 +00:00
Tom Cherry
c2c36b661c Remove a check for AIDs in the OEM range.
Remove the check that AIDs in the OEM range are not defind in
android_filesystem_config, as we do not yet have a good solution for
OEMs to define custom AIDs and what OEMs are currently doing isn't
hurting anything.

Bug: b/64137613
Test: pwd.getpwent_iterate / grp.getgrent_iterate
Change-Id: If98ad4443fe9e827e3f17b3df92eca82763e6290
(cherry picked from commit a14485adde)
2017-08-04 13:30:21 -07:00
Tom Cherry
f631e5a001 Merge "Remove a check for AIDs in the OEM range." 2017-08-04 20:28:05 +00:00
Elliott Hughes
ff6f1697ec Merge "With O_TMPFILE, open(2) takes a mode argument." am: 2fdefadcee
am: 212ea2b74e

Change-Id: I17a248316365bc0872e15e3ed72915be5f3cc269
2017-08-04 20:27:13 +00:00
Elliott Hughes
212ea2b74e Merge "With O_TMPFILE, open(2) takes a mode argument."
am: 2fdefadcee

Change-Id: I5cd1f9103b4b5f20f18fd3f7f5be2511e2b1990f
2017-08-04 20:20:38 +00:00
Tom Cherry
a14485adde Remove a check for AIDs in the OEM range.
Remove the check that AIDs in the OEM range are not defind in
android_filesystem_config, as we do not yet have a good solution for
OEMs to define custom AIDs and what OEMs are currently doing isn't
hurting anything.

Bug: b/64137613
Test: pwd.getpwent_iterate / grp.getgrent_iterate
Change-Id: If98ad4443fe9e827e3f17b3df92eca82763e6290
2017-08-04 18:15:58 +00:00
Elliott Hughes
b115aefbb3 With O_TMPFILE, open(2) takes a mode argument.
Strictly, the mode isn't really meaningful unless you supply O_EXCL,
but the kernel will take it and fstat will return it even if you
never give the file a name.

Also warn for O_TMPFILE without a mode at compile time where possible.

Bug: N/A
Test: ran tests
Change-Id: I729b6d6e6190676fd017a1190b6200bf9abdbfd8
2017-08-04 10:20:18 -07:00
George Burgess IV
86e3711ea2 Merge "libc fortify: warn on open() with useless mode bits" am: cc3639b3ee am: afaabfe5ea am: 22838b563d
am: d82e094cc4

Change-Id: I0b85fbf2796d362a0236351cfe7533f89bde19c5
2017-08-04 08:02:06 +00:00
George Burgess IV
22838b563d Merge "libc fortify: warn on open() with useless mode bits" am: cc3639b3ee
am: afaabfe5ea

Change-Id: I4fe0bb7b6ab7c103f9da8c06ed35bbff7ea45381
2017-08-04 07:49:38 +00:00
George Burgess IV
afaabfe5ea Merge "libc fortify: warn on open() with useless mode bits"
am: cc3639b3ee

Change-Id: I8df1df02ef729eb79af4030c43b508ec79858def
2017-08-04 07:43:36 +00:00
Treehugger Robot
cc3639b3ee Merge "libc fortify: warn on open() with useless mode bits" 2017-08-04 07:32:27 +00:00
Jiyong Park
34a4acd801 linker: the global group is added to all built-in namespaces
With ld.config.txt, we now have multiple built-in namespaces other than
the default namespace. Libs (and their dependents) listed in LD_PRELOAD
must be visible to those additional namespaces as well.

This also adds a debugging only feature: path to the linker config file
can be customized via LD_CONFIG_FILE environment variable. This works
only for debuggable builds.

Bug: 38114603
Bug: 62815515
Test: 1. ./external/compiler-rt/lib/asan/scripts/asan_device_setup --lib
prebuilts/clang/host/linux-x86/clang-stable/lib64/clang/5.0/lib/linux
2. enable talkback shortcut
3. in the home screen, hold vol-up/down together
4. device does not reboots and talkback shortcut is toggled
Test: bionic-unit-tests and linker-unit-tests successful

Merged-In: I9a03591053f4a9caea82f0dcb23e7a3d324bb9bd
Change-Id: I9a03591053f4a9caea82f0dcb23e7a3d324bb9bd
(cherry picked from commit 02586a2a34)
2017-08-04 14:14:09 +09:00
George Burgess IV
4e37d53f29 libc fortify: warn on open() with useless mode bits
Bug: 64132680
Test: checkbuild on bullhead internal master; no new CtsBionicTestCases
fail.

Change-Id: I98762bbee0ecdd7b4ffc21135992f2eed320317f
2017-08-03 22:04:19 -07:00
Evgenii Stepanov
97c16f8dca [cfi] Export __cfi_shadow_size.
__cfi_shadow_size returns the size of the CFI shadow mapping, or 0 if
CFI is not (yet) used in this process. This can be used to adjust
RLIMIT_AS setting.

Test: device bionic tests
Bug: 64293803
Change-Id: Icd7164f96aa7115b3585c21c0f68529cd2f07c11
2017-08-03 14:04:15 -07:00
George Burgess IV
6193718340 Merge "libc fortify: make string.h use diagnose_if" am: b1b125ead1 am: 5869bbe1d0 am: eaf1c56481
am: 0a1d5ac5d4

Change-Id: Ia5b0c46f94a943899f23de3fa98fae999da21b1f
2017-08-03 03:44:13 +00:00
George Burgess IV
eaf1c56481 Merge "libc fortify: make string.h use diagnose_if" am: b1b125ead1
am: 5869bbe1d0

Change-Id: I20f3e27bdfb4e4ef7d6ff2eccae5493100009454
2017-08-03 03:33:42 +00:00
George Burgess IV
5869bbe1d0 Merge "libc fortify: make string.h use diagnose_if"
am: b1b125ead1

Change-Id: I9e4508c73a83987bbd21550538ff77d6cb65cace
2017-08-03 03:29:34 +00:00
Treehugger Robot
b1b125ead1 Merge "libc fortify: make string.h use diagnose_if" 2017-08-03 03:18:44 +00:00
Jiyong Park
d741e5ef43 Merge "linker: the global group is added to all built-in namespaces" am: c9fb66209d am: ec8c79aaa1 am: 0a51b36ad6
am: e247953f1b

Change-Id: I26521ec9cc11b9ee9ce55a61ac2bfe3152a0dd7f
2017-08-03 02:47:38 +00:00
Jiyong Park
0a51b36ad6 Merge "linker: the global group is added to all built-in namespaces" am: c9fb66209d
am: ec8c79aaa1

Change-Id: Ie74a986381fe1dc7a7a5b148511a999f828dd829
2017-08-03 02:37:38 +00:00
Jiyong Park
ec8c79aaa1 Merge "linker: the global group is added to all built-in namespaces"
am: c9fb66209d

Change-Id: I9c45ba3b6878a9a098634eae4b9cb97360161495
2017-08-03 02:32:37 +00:00
Treehugger Robot
c9fb66209d Merge "linker: the global group is added to all built-in namespaces" 2017-08-03 02:23:53 +00:00
Elliott Hughes
e21ab62ead Merge "Add some <sched.h> tests." am: 26c59f7082 am: bc6d5e9288 am: 3ba8c376e8
am: 638f94522e

Change-Id: Ibff3c123814c29cec14ebedb740eef28a2cfa4f2
2017-08-02 19:56:11 +00:00
Elliott Hughes
3ba8c376e8 Merge "Add some <sched.h> tests." am: 26c59f7082
am: bc6d5e9288

Change-Id: I5f012e6a7bd5969fd9e1120e54a711d809c7271d
2017-08-02 19:47:13 +00:00
Elliott Hughes
bc6d5e9288 Merge "Add some <sched.h> tests."
am: 26c59f7082

Change-Id: I5423c0d614e7fee238f0f2980956878111604efe
2017-08-02 19:43:58 +00:00
Elliott Hughes
26c59f7082 Merge "Add some <sched.h> tests." 2017-08-02 19:28:38 +00:00
Jiyong Park
02586a2a34 linker: the global group is added to all built-in namespaces
With ld.config.txt, we now have multiple built-in namespaces other than
the default namespace. Libs (and their dependents) listed in LD_PRELOAD
must be visible to those additional namespaces as well.

This also adds a debugging only feature: path to the linker config file
can be customized via LD_CONFIG_FILE environment variable. This works
only for debuggable builds.

Bug: 38114603
Bug: 62815515
Test: 1. ./external/compiler-rt/lib/asan/scripts/asan_device_setup --lib
prebuilts/clang/host/linux-x86/clang-stable/lib64/clang/5.0/lib/linux
2. enable talkback shortcut
3. in the home screen, hold vol-up/down together
4. device does not reboots and talkback shortcut is toggled
Test: bionic-unit-tests and linker-unit-tests successful

Change-Id: I9a03591053f4a9caea82f0dcb23e7a3d324bb9bd
2017-08-03 01:02:07 +09:00
Elliott Hughes
2950f13eef Add some <sched.h> tests.
I was intending to change our behavior to match POSIX, but reality convinced
me otherwise.

Also add missing argument names to the header file on the assumption they'll
be shown in Studio one day.

Bug: http://b/26203902
Test: ran tests
Change-Id: I2aaea48a88d408a32925033fc8f17448fb63252e
2017-08-02 09:01:42 -07:00
Elliott Hughes
762735d91c Merge "Finish <stdio_ext.h>." am: 316a44f33c am: 8f2608aba9 am: 46214ae7c1
am: e009c48b95

Change-Id: Icf5a30fc5f477ab95e53cfaddf1dd960d381784f
2017-08-02 15:21:22 +00:00
Elliott Hughes
46214ae7c1 Merge "Finish <stdio_ext.h>." am: 316a44f33c
am: 8f2608aba9

Change-Id: Ic45c4e49f90d7148e9beff562375e133b3365d0b
2017-08-02 15:13:20 +00:00
Elliott Hughes
8f2608aba9 Merge "Finish <stdio_ext.h>."
am: 316a44f33c

Change-Id: I5ec959f2a1f4090ca3852c2ec453759e5676d93c
2017-08-02 15:09:50 +00:00
Elliott Hughes
316a44f33c Merge "Finish <stdio_ext.h>." 2017-08-02 15:00:38 +00:00
George Burgess IV
f5f06d2840 Merge "libc fortify: make fcntl.h use diagnose_if" am: 5ac5a7c083 am: 96eb6cbf9a am: f7c19622a3
am: 81f733ff7c

Change-Id: I7f08342023fbb91e4ec8876e51092adadff6cd39
2017-08-02 08:26:29 +00:00
George Burgess IV
f7c19622a3 Merge "libc fortify: make fcntl.h use diagnose_if" am: 5ac5a7c083
am: 96eb6cbf9a

Change-Id: I383158d43d7cc65ef6d48c3aa8d5c9a7a264d639
2017-08-02 08:17:28 +00:00
George Burgess IV
96eb6cbf9a Merge "libc fortify: make fcntl.h use diagnose_if"
am: 5ac5a7c083

Change-Id: I2db3f6d42cbb07c703f142665fd2a0c5059f78bc
2017-08-02 08:12:28 +00:00
Treehugger Robot
5ac5a7c083 Merge "libc fortify: make fcntl.h use diagnose_if" 2017-08-02 08:06:20 +00:00
George Burgess IV
3ac2fc3f68 Merge "libc fortify: make socket.h and stdlib.h use diagnose_if" am: a821283d22 am: 1ede4abc4a am: e1ba44a473
am: b494e0b92c

Change-Id: I160fa1c1d352249b79ce88edfbdf7d562e6ae21f
2017-08-02 07:57:57 +00:00
George Burgess IV
332b8a3df2 Merge "libc fortify: make stdio.h use diagnose_if" am: 6e0de9da49 am: ced73cda27 am: 79e01ac0e6
am: 3d4a560cfd

Change-Id: Ie01ab86594beadc3e8bd81fbb38ad4efbd7b2d00
2017-08-02 07:48:57 +00:00
George Burgess IV
e1ba44a473 Merge "libc fortify: make socket.h and stdlib.h use diagnose_if" am: a821283d22
am: 1ede4abc4a

Change-Id: Iea3842667bb674cf1a9dfbec0ef3d755801d1209
2017-08-02 07:48:56 +00:00
George Burgess IV
1ede4abc4a Merge "libc fortify: make socket.h and stdlib.h use diagnose_if"
am: a821283d22

Change-Id: I818da183356943d72e96d1e2264747de6fe6a066
2017-08-02 07:43:56 +00:00
George Burgess IV
79e01ac0e6 Merge "libc fortify: make stdio.h use diagnose_if" am: 6e0de9da49
am: ced73cda27

Change-Id: I144dd0b3ad3a27394592e3ee391fbc792450a9f6
2017-08-02 07:38:56 +00:00
Treehugger Robot
a821283d22 Merge "libc fortify: make socket.h and stdlib.h use diagnose_if" 2017-08-02 07:37:46 +00:00
George Burgess IV
ced73cda27 Merge "libc fortify: make stdio.h use diagnose_if"
am: 6e0de9da49

Change-Id: Ic847d12c7822f7f8e25ec5a40e6cf7143417dad9
2017-08-02 07:33:55 +00:00
Treehugger Robot
6e0de9da49 Merge "libc fortify: make stdio.h use diagnose_if" 2017-08-02 07:27:23 +00:00
George Burgess IV
f4618c7d49 Merge "libc fortify: make poll.h and stat.h use diagnose_if" am: cff14d9e3e am: f5b6f13394 am: 910c9ec619
am: 6aee92afad

Change-Id: I8027dc2517821accf7965dfbfe5ef03602619728
2017-08-02 07:05:23 +00:00
George Burgess IV
910c9ec619 Merge "libc fortify: make poll.h and stat.h use diagnose_if" am: cff14d9e3e
am: f5b6f13394

Change-Id: I55e54e5aee89e9deb7c01f0f43fdfefe33217c45
2017-08-02 06:55:53 +00:00
George Burgess IV
f5b6f13394 Merge "libc fortify: make poll.h and stat.h use diagnose_if"
am: cff14d9e3e

Change-Id: I4cd2863d8f9d859e8441da7cc54f2fc15294b42e
2017-08-02 06:50:53 +00:00
Treehugger Robot
cff14d9e3e Merge "libc fortify: make poll.h and stat.h use diagnose_if" 2017-08-02 06:44:41 +00:00
George Burgess IV
b6300463a8 libc fortify: make string.h use diagnose_if
This also has a handful of style fixups, to make this file more
consistent. And removes __bionic_zero_size_is_okay_t, since there's a
better workaround available.

Bug: 12231437
Test: m checkbuild on bionic internal master; CtsBionicTestCases show
no new failures.

Change-Id: I75a020630dbab0ce828563502900cba14ae992d1
2017-08-01 22:41:11 -07:00
George Burgess IV
54f5d8331f libc fortify: make socket.h and stdlib.h use diagnose_if
Since realpath no longer needs to be overloaded, we can restore the
upstream source to purity. We'll be able to do this with most of the
other functions when we pull a newer clang in.

Bug: 12231437
Test: m checkbuild on bionic internal master; CtsBionicTestCases show
no new failures.

Change-Id: I484221bba0b291273fece23d2be2f5f9fd713d2c
2017-08-01 22:32:15 -07:00
George Burgess IV
23dbf82132 libc fortify: make stdio.h use diagnose_if
This also throws in some reformatting to match the GCC FORTIFY style in
this file (e.g. 4 space standard indent).

Per b/36984245, some function protos are unwrapped beyond 100 chars, as
well.

Bug: 12231437
Test: m checkbuild on bionic internal master; CtsBionicTestCases show
no new failures.

Change-Id: I6dce60ec14d5cd703d9e724699634a197ca11023
2017-08-01 22:02:31 -07:00