Commit graph

24896 commits

Author SHA1 Message Date
Yabin Cui
57a4006c10 Improve pty unit test to catch the bug more easily.
Bug: http://b/69260651
Test: run bionic-unit-tests.

Change-Id: Ifb89cc2952508b6e5a093c57053fb93cb61cd28c
2017-11-21 18:04:15 -08:00
Yabin Cui
6c7651f380 Merge "Fix support for typed tests and parameterized tests."
am: f40402a39f

Change-Id: I22d108267a6de4fb8d92cb9e53557de7691f3f0f
2017-11-17 02:54:34 +00:00
Treehugger Robot
f40402a39f Merge "Fix support for typed tests and parameterized tests." 2017-11-17 02:40:35 +00:00
Chih-Hung Hsieh
c24a5b12ed Merge "Use -Werror in bionic/tests"
am: e070051254

Change-Id: I0185c176163b05792d17d613d02551939b67c955
2017-11-17 00:26:21 +00:00
Yabin Cui
5e235c85bb Fix support for typed tests and parameterized tests.
Bug: http://b/69425095
Test: run bionic_unit_tests --bionic-selftest
Change-Id: Ifa23288f2ad84978b7748da0ea93d650fae926a8
2017-11-16 16:20:28 -08:00
Treehugger Robot
e070051254 Merge "Use -Werror in bionic/tests" 2017-11-17 00:19:33 +00:00
Chih-Hung Hsieh
38997e4aed Use -Werror in bionic/tests
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I64a0458c787054a0694c736be20dc53772ff3781
2017-11-16 13:51:17 -08:00
Elliott Hughes
ff279d0f7a Merge "Change ARG_MAX/_SC_ARG_MAX back to a constant."
am: 8c75675ec6

Change-Id: I87d269067bd40e600dbb4e804ed952fdce861473
2017-11-16 21:49:11 +00:00
Elliott Hughes
8c75675ec6 Merge "Change ARG_MAX/_SC_ARG_MAX back to a constant." 2017-11-16 21:46:49 +00:00
Christopher Ferris
7090e0c0a5 Merge "Update to kernel headers v4.14."
am: e0dfad4504

Change-Id: I039c92a8eef289a11660ef09730ef857070c19bb
2017-11-16 19:31:12 +00:00
Christopher Ferris
e0dfad4504 Merge "Update to kernel headers v4.14." 2017-11-16 19:28:13 +00:00
Elliott Hughes
e5ff4dee46 Merge "Simplify the posix_spawn sigdefault logic."
am: c3f1b6a23d

Change-Id: I2d2e05a7d0177e28f583097c33c07029ee93291e
2017-11-16 00:13:47 +00:00
Elliott Hughes
c3f1b6a23d Merge "Simplify the posix_spawn sigdefault logic." 2017-11-16 00:08:31 +00:00
Elliott Hughes
baed51ee3a Change ARG_MAX/_SC_ARG_MAX back to a constant.
As per the lkml thread https://lkml.org/lkml/2017/11/1/946.

Bug: http://b/65818597
Test: ran tests
Change-Id: I7a0610e6903e6761f2b31416e2f5017bd7a60659
2017-11-15 15:14:35 -08:00
Elliott Hughes
1a24e07da9 Merge "Reduce unnecessary quoting for --gtest_filter."
am: de5f9a1c54

Change-Id: I8e35d3796e880a60e73f3dfe18ec412eacfded3c
2017-11-15 22:49:07 +00:00
Elliott Hughes
de5f9a1c54 Merge "Reduce unnecessary quoting for --gtest_filter." 2017-11-15 22:38:30 +00:00
Tom Cherry
fe21bf5e18 Merge "Only use uids and gids for which we've allocated AIDs"
am: 966f659d7f

Change-Id: I502117ac5afcd828ba74a23469718ae68867c99d
2017-11-15 21:47:44 +00:00
Tom Cherry
966f659d7f Merge "Only use uids and gids for which we've allocated AIDs" 2017-11-15 21:19:56 +00:00
Christopher Ferris
1308ad3ab3 Update to kernel headers v4.14.
Remove the hiding of the kernel structure binder_fd_array_object. This
structure now matches the structure used in the binder code.

Load the libclang_android.so shared library directly for parsing.
This file changed name in a recent update to the prebuilts.

Test: Compiles arm/arm64/x86/x86_64.
Test: Boots on hikey and boots on a sailfish.
Test: Ran bionic unit tests on hikey and sailfish.
Change-Id: I141a4b93ac3511cd58f4d12bb3c0d4efaa4c2742
2017-11-15 12:23:56 -08:00
Tom Cherry
4362f897f7 Only use uids and gids for which we've allocated AIDs
Currently, getpwnam, getpwent, etc return successfully for any uid
from AID_APP_START (10000) to AID_USER_OFFSET (100000) for each user.
This is not correct however, as only specific ranges above
AID_APP_START are reserved as valid ranges.  This change corrects this.

This is particularly important as the newly added AID_OVERFLOWUID is
65534, which is above AID_APP_START but not in any reserved range,
collided with the faulty returned values.

Bug: 69119022
Bug: 69128408
Test: pwd/grp bionic unit tests
Change-Id: I3dae97a90597915fa30a88fe27cda88b107e9c35
2017-11-15 10:31:49 -08:00
Elliott Hughes
10ba4bd6d1 Reduce unnecessary quoting for --gtest_filter.
Use posix_spawn rather than popen, to remove a surprising extra shell.

Bug: http://b/68949647
Test: /data/nativetest64/bionic-unit-tests/bionic-unit-tests --gtest_filter=stdio.swprintf_1$ju_UINTMAX_MAX
Change-Id: Id90afab04ee799932de9f5ca7e580e61ecfde7a4
2017-11-15 09:30:16 -08:00
Elliott Hughes
2b8ab4b5da Simplify the posix_spawn sigdefault logic.
I don't think there's any observable difference, but this is certainly
simpler.

Bug: http://b/68707996
Test: ran tests
Change-Id: Id9e1a7d40533c90d073ebf391a72bbdfe79627de
2017-11-14 22:31:43 -08:00
Xin Li
74d57a37cb Merge commit 'e3d21c84af0b8e3244e4c67a873d2a16bfb85034' into HEAD
Change-Id: I09b21c2e27a0dfbef10633b20d8ee7adbedc1597
2017-11-14 13:14:23 -08:00
Tom Cherry
fe0a16fa38 Merge changes I39663cc3,Ie75ec6fe
am: 315dd896de

Change-Id: Ieec9084c2f9b2daee095180c8ff6a0c817dea98c
2017-11-14 21:04:36 +00:00
Tom Cherry
315dd896de Merge changes I39663cc3,Ie75ec6fe
* changes:
  Remove some globals from system_properties
  Split system_properties.cpp into its component pieces
2017-11-14 20:55:13 +00:00
Tom Cherry
f76bbf5384 Remove some globals from system_properties
pa_size should be static to prop_area, so make it so.

__system_property_area__ was reused for various purposes, but
realistically is a deprecated symbol and this finally separates us
from it.

Bug: 36001741
Test: boot bullhead, system property unit tests
Change-Id: I39663cc3b613093fa4c728b21d8ba58754f8e105
2017-11-14 08:55:27 -08:00
Tom Cherry
fd44b9f8d8 Split system_properties.cpp into its component pieces
system_properties.cpp is a little bit unmanageable in its current
form, and is overdue for a refactoring into more clearly defined
components.

Of particular interest, is creating of a Contexts interface that
handles mapping of system property name -> SEContext and its
associated prop_area, and creating two classes that implement the
current and legacy functionality.  This is needed as there will likely
be a third even newer way to do this mapping.

Bug: 36001741
Test: boot bullhead, system property unit tests
Change-Id: Ie75ec6fea1a95f90813918f54669d533e51327c6
2017-11-14 08:50:52 -08:00
Elliott Hughes
4ccc650c66 Merge "Remove more trivial char/wchar_t printf differences."
am: 40a5cfa8d1

Change-Id: I2ffe7058aa5dc40f095f9d86eaa5edb6b77688a6
2017-11-14 01:08:36 +00:00
Elliott Hughes
40a5cfa8d1 Merge "Remove more trivial char/wchar_t printf differences." 2017-11-14 00:58:04 +00:00
Elliott Hughes
b70576b048 Remove more trivial char/wchar_t printf differences.
Bug: http://b/67371539
Test: ran tests
Change-Id: I899458af92517dc21f874519716fa3f3a0f0e3d6
2017-11-13 11:10:05 -08:00
Elliott Hughes
97da26384a Merge "Yet more printf de-duplication."
am: 0793e3dd07

Change-Id: I174c65106f88b25fa41691dd79d46398c8ed8c18
2017-11-13 18:10:28 +00:00
Elliott Hughes
0793e3dd07 Merge "Yet more printf de-duplication." 2017-11-13 18:04:18 +00:00
Elliott Hughes
dbc4bc4bb1 Merge "Move public scanf functions away from implementation."
am: 13e86af056

Change-Id: I09aa9459f998d92a5bbfb9149210da1f86fbedd9
2017-11-13 17:19:50 +00:00
Treehugger Robot
13e86af056 Merge "Move public scanf functions away from implementation." 2017-11-13 17:17:10 +00:00
Elliott Hughes
345b727e96 Move public scanf functions away from implementation.
Bug: N/A
Test: ran tests
Change-Id: Ifb8bd91132865f8c6d0b95baf1021af3b3b3c353
2017-11-10 16:20:43 -08:00
Elliott Hughes
bc27bdc24f Yet more printf de-duplication.
Bug: http://b/67371539
Test: ran tests
Change-Id: Iae38055426596919c0de4f5080c99eba95fac3a9
2017-11-10 15:25:49 -08:00
Tom Cherry
e2b484e290 Merge "Better test handling and logging in grp_pwd_test.cpp"
am: 1c9f04464b

Change-Id: I2ec11ad8de3a480ae61aa57092c57f0dc4c1bdff
2017-11-10 21:22:37 +00:00
Treehugger Robot
1c9f04464b Merge "Better test handling and logging in grp_pwd_test.cpp" 2017-11-10 21:11:37 +00:00
Tom Cherry
2c05c0f9b0 Better test handling and logging in grp_pwd_test.cpp
grp_pwd_test.cpp uses ASSERT_ where EXPECT_ is possible, causing
missing failures when multiple failures are present.

Also, print out the uid/gid in the _iterate tests, to make debugging
easier.

Test: these same unit tests
Change-Id: I839b74fb86232b3e896091e76ab862cc5b6b8782
2017-11-10 10:57:21 -08:00
Elliott Hughes
c3f5a89e40 Merge "Add trivial test for __memrchr_chk."
am: 843e340874

Change-Id: I6c5c24cdfa91fc160797a993041ebbb55b716f25
2017-11-10 02:00:06 +00:00
Elliott Hughes
546c416fa4 Merge "Use builtins for fma/fmax/fmin/round on arm64."
am: 9b0def7139

Change-Id: I98996cd4216643c686e985136c9edb92aa6bf397
2017-11-10 01:58:07 +00:00
Treehugger Robot
843e340874 Merge "Add trivial test for __memrchr_chk." 2017-11-10 01:57:24 +00:00
Elliott Hughes
9b0def7139 Merge "Use builtins for fma/fmax/fmin/round on arm64." 2017-11-10 01:50:17 +00:00
Elliott Hughes
9a1bb70ba0 Use builtins for fma/fmax/fmin/round on arm64.
Bug: http://b/27829506
Change-Id: Id243e3ba0041d5efce496f0760815e591a2c00a0
Test: ran tests and inspected arm64 assembler
2017-11-09 15:57:34 -08:00
Elliott Hughes
55a8cc2a0d Add trivial test for __memrchr_chk.
Bug: N/A
Test: ran tests
Change-Id: I42aefcbf1fac6b96e56a0e21f94586a3caa524dc
2017-11-09 15:46:51 -08:00
Elliott Hughes
9b0632011c Merge "Move shared parts of the two printfs out."
am: 5e186f9a8e

Change-Id: Ic4569130f374f6fc16a8d2efcea7fd1fea13f760
2017-11-09 23:28:37 +00:00
Elliott Hughes
0a20534d5a Merge "Add trivial tests for the <resolv.h> base64 functions."
am: a6092a9a75

Change-Id: Ic77e35e35c3e02bb5ad1c797e86b3e1154f10779
2017-11-09 23:28:15 +00:00
Elliott Hughes
51854ae96f Merge "Add trivial ttyname(3) test."
am: 1670e2a298

Change-Id: I96b38a7ace770563cfa8de5432b90dbf1f2babd3
2017-11-09 23:27:53 +00:00
Elliott Hughes
5e186f9a8e Merge "Move shared parts of the two printfs out." 2017-11-09 23:10:01 +00:00
Elliott Hughes
a6092a9a75 Merge "Add trivial tests for the <resolv.h> base64 functions." 2017-11-09 23:09:18 +00:00