Commit graph

1789 commits

Author SHA1 Message Date
Hans Boehm
590a410d29 Fix compare_exchange_weak tests to allow spurious failure
Test: Ran bionic unit tests on angler.

Bug: 36869788
Change-Id: Ic1e0e4e409ac719d5b426391a771b4858a6149ee
2017-04-05 16:12:09 -07:00
George Burgess IV
bd3d2088d9 libc: add const-correct string.h overloads
libcxx provides const-correct overloads for a few string.h functions.
These overloads use clang's enable_if attribute, so they're preferred
over our FORTIFY'ed equivalents.

This weakens _FORTIFY_SOURCE=2 when used with some of these functions,
since clang needs to see __pass_object_size in order to pass an accurate
result for __builtin_object_size(s, 1) at a callsite. Since those
functions don't have __pass_object_size on their params, clang can't do
that. This makes LLVM lower the __builtin_object_size calls, which means
we get the same result as __builtin_object_size(s, 0).

We have to provide all of the overloads in Bionic, since enable_if is
only used to disambiguate overloads with (otherwise) the same type. In
other words:

// overload 1
char *strchr(const char *, int s) __attribute__((enable_if(1, "")));
// overload 2
char *strchr(char *, int s);

void foo() {
  char cs[1] = {};
  strchr(static_cast<const char *>(cs), '\0'); // calls overload #1.
  strchr(cs, '\0'); // calls overload #2.
}

Bug: 34747525
Test: m checkbuild on bullhead internal master + AOSP. vts -m
BionicUnitTests passes on both. Surprisingly, the only code that this
seems to break is contained in Bionic.

Change-Id: Ie406f42fb3d1c5bf940dc857889876fc39b57c90
2017-04-05 13:17:07 -07:00
Dimitry Ivanov
e3f66625e3 Merge "Fix lookup logic for linked namespaces"
am: 6a2c7f5a68

Change-Id: I6af8cccc6ca6a18ced2f4843621563319fdc29f5
2017-04-02 02:20:13 +00:00
Treehugger Robot
6a2c7f5a68 Merge "Fix lookup logic for linked namespaces" 2017-04-02 02:14:47 +00:00
Josh Gao
bcf3b3d868 Merge "Add more ptrace process resumption tests."
am: ccec0f4c11

Change-Id: Ia951508d38a146fb879e3a7aa34e3b1bc4d6169f
2017-03-30 01:40:54 +00:00
Josh Gao
ccec0f4c11 Merge "Add more ptrace process resumption tests." 2017-03-30 01:33:58 +00:00
Elliott Hughes
5b35e2b9c2 Merge "Fix x86 system calls made from ELF preinit."
am: 12a07044db

Change-Id: I6377f5bcc5edfc725c923b596490aa74e55ea224
2017-03-29 23:14:56 +00:00
Elliott Hughes
12a07044db Merge "Fix x86 system calls made from ELF preinit." 2017-03-29 23:08:18 +00:00
Dimitry Ivanov
d3e7d08845 Fix lookup logic for linked namespaces
When looking for already loaded libraries include
linked namespaces to the search, but check if
the library is accessible from the main namespace.

Bug: http://b/36008422
Bug: http://b/35417197
Bug: http://b/34052337
Bug: http://b/36660652
Bug: https://issuetracker.google.com/36636090
Test: run bionic-unit-tests --gtest_filter=dl*:Dl*
Change-Id: Ic7c1d48114da3ca5dc6512ef03f595dd17b6ed17
2017-03-29 15:36:40 -07:00
Josh Gao
bc055cae45 Add more ptrace process resumption tests.
Add tests to verify that ptrace unlink happens immediately for unreaped
processes.

Test: /data/nativetest/bionic-unit-tests/bionic-unit-tests --gtest_filter="Ptrace*"
Test: /data/nativetest64/bionic-unit-tests/bionic-unit-tests --gtest_filter="Ptrace*"
Change-Id: I9803ee5be2a0686c21556598ecf17348df09f601
2017-03-29 15:02:18 -07:00
Elliott Hughes
eb04ed506f Fix x86 system calls made from ELF preinit.
Used by CFI, so broke cfi_test#early_init@x86, but I've added a specific
test for this (and a similar test for getauxval from preinit, which this
patch does not fix).

Bug: http://b/35885875
Test: ran tests
Change-Id: I43885bedfb88c0a26b4474bd3c27a87dec7bbc97
2017-03-29 13:48:02 -07:00
Dimitry Ivanov
72aed61800 Merge "Disable compat_elf_hash_and_relocation_tables test for x86"
am: fe96db819b

Change-Id: I6ff32babeeb514cd00704e797a713ac4149dc868
2017-03-24 23:06:39 +00:00
Dimitry Ivanov
fe96db819b Merge "Disable compat_elf_hash_and_relocation_tables test for x86" 2017-03-24 23:02:56 +00:00
Dimitry Ivanov
fc32dcb128 Disable compat_elf_hash_and_relocation_tables test for x86
Bug: http://b/36571076
Test: run bionic-unit-tests on fugu
Change-Id: I2f901bc99e55f15b06fe6a5b0d7a125d1b8241a8
2017-03-24 10:58:23 -07:00
Christopher Ferris
ab39630cef Merge "Verify at least 2 frames out of signal handler."
am: 8f804d71d0

Change-Id: I101d82f95345ebda7d385142301e5fa3e35daeed
2017-03-23 19:15:50 +00:00
Christopher Ferris
ac2f3dd5cb Verify at least 2 frames out of signal handler.
Modify the test slightly to make sure that the unwinder properly unwinds
through at least 2 frames outside of the signal handler. This guarantees
that if the first frame outside of the handler happens to be garbage,
this test will fail.

Bug: 34468756

Test: Ran the unit tests on fugu, angler (both 32 bit and 64 bit).
Change-Id: I6b76ac9fc1df9ed6fd5bbcc6f5fa4bf458354dff
2017-03-23 09:45:10 -07:00
Dimitry Ivanov
b1a44366b8 Merge "Use libbase for realpath and dirname"
am: e0561cb0c9

Change-Id: I7fe096792674724641548d62c9c6e7041ebce85b
2017-03-16 20:42:01 +00:00
Dimitry Ivanov
5b2cd3a358 Use libbase for realpath and dirname
Test: run bionic-unit-tests
Bug: http://b/31396973
Change-Id: Ie8dc60348b9c57892a77be6a24dadb42241f6b62
2017-03-16 11:47:08 -07:00
Josh Gao
96be725d4b Merge "Split up the stack space tests into their own noinline functions."
am: b2882dd429

Change-Id: Id6212e053b0f4b886146224a962fd8744d5e8eb4
2017-03-16 06:49:38 +00:00
Josh Gao
61db9ac8da Split up the stack space tests into their own noinline functions.
Prevent the compiler from being too smart and allocating a stack buffer
at the beginning of a function.

Bug: http://b/36206043
Test: 32/64-bit dynamic tests pass, static ones still don't
Change-Id: I90c575be43a9dd6c4fefc0d8b514f1ae0405b994
2017-03-15 19:53:17 -07:00
Josh Gao
0531178d46 Merge "Add tests for pthread TLS leak."
am: a4db9d6f41

Change-Id: I595112f67b875a1f8cc841adaf9adf3c10a792b4
2017-03-15 22:14:01 +00:00
Josh Gao
7d15dc388a Add tests for pthread TLS leak.
Add tests that ensure that threads don't leak memory mappings after
they exit.

Bug: http://b/36045112
Test: /data/nativetest/bionic-unit-tests/bionic-unit-tests --gtest_filter=*leak*
Test: /data/nativetest64/bionic-unit-tests/bionic-unit-tests --gtest_filter=*leak*
Change-Id: Id0c1194b5d2bb7d89947b1ade16eb0d768d8c5b7
2017-03-15 13:30:05 -07:00
Josh Gao
778751ff6f Merge changes from topic 'debuggerd_fallback'
am: cf96f35dd1

Change-Id: I875bbf95ca55919a5164752d2f49d5415ea6ded2
2017-03-09 22:08:30 +00:00
Josh Gao
415daa8cca Increase signal stack size on 32-bit to 16kB.
snprintf to a buffer of length PATH_MAX consumes about 7kB of stack.

Bug: http://b/35858739
Test: bionic-unit-tests --gtest_filter="*big_enough*"
Change-Id: I34a7f42c1fd2582ca0d0a9b7e7a5290bc1cc19b1
2017-03-08 16:43:59 -08:00
Victor Khimenko
869aed6b0f Merge "Stop using __system_property_area__"
am: 9e10b7fa44

Change-Id: I2b3add48f5d5e41e250a1024dab6fd8411447416
2017-03-01 21:51:00 +00:00
Victor Khimenko
4a92ffd302 Stop using __system_property_area__
Apparently that "backdoor" is no longer needed - the proper way is
to reinitialize properties:
    https://android-review.googlesource.com/#/c/181794/24/tests/system_properties_test.cpp

Also removes mentions of libnativehelper test (it no longer uses
__system_property_area__) and removes useless "extern" declaration
(actual use was removed long ago).

Test: refactoring CL, existsing tests still pass

BUG=21852512
BUG=34114501

Change-Id: I2223cab2fcb671ea180ad4470a7aba5c9cd20bd8
2017-03-01 20:43:42 +01:00
Dimitry Ivanov
ea7961b604 Merge "Fix greylist exception to account for linked namespaces"
am: 6e528631d1

Change-Id: I639c4ac215359a5c3caa6b19a2cd59ace1ff1ca4
2017-02-28 00:47:49 +00:00
Dimitry Ivanov
35c8e3b125 Fix greylist exception to account for linked namespaces
Do not load second copy of libraries that are supposed to
be provided by linked namespaces. Also do not print
error in the log if caller tries to open shared library
using absolute path for apps targeting N+.

Bug: http://b/35454141
Bug: http://b/26833548
Bug: http://b/35338922
Test: run bionic-unit-tests --gtest_filter=dl*
Change-Id: Icf3aeedff18d287d2ba0b3df3808b100f3ef5f7a
2017-02-27 14:16:04 -08:00
Elliott Hughes
383efd5f2e Merge "Add tests for <endian.h>."
am: 78e6c4ec7c

Change-Id: I3593c8f899707d5e45fad839733b0dcbcc945df0
2017-02-25 03:14:15 +00:00
Treehugger Robot
78e6c4ec7c Merge "Add tests for <endian.h>." 2017-02-25 03:10:19 +00:00
Dimitry Ivanov
566d200680 Merge "loader: set PT_INTERP to itself"
am: 0b87362f53

Change-Id: I505616f5b4223dcd6cdad396db340c81b61a87b5
2017-02-25 02:31:13 +00:00
Dimitry Ivanov
2a6955e040 loader: set PT_INTERP to itself
Some versions of kernel set AT_BASE to 0
if dynamic loader does not have PT_INTERP
set.

Bug: http://b/30739481
Test: run /system/bin/linker64 and /system/bin/linker
Change-Id: I1b67777166fe917d3ee1a97277045ca6f5db0084
2017-02-24 16:56:38 -08:00
Elliott Hughes
ba267f45d6 Add tests for <endian.h>.
Also, for the stuff that's also in <netinet/in.h> as real functions,
check that they're there too (and as functions rather than macros,
since that was historically not true).

Bug: http://b/28432448
Test: ran tests
Change-Id: I7e4ae926f7e02de3b6dd38d1953e5b3b43d44f74
2017-02-24 16:19:53 -08:00
Pavel Labath
8c8ce57d77 Merge "Silence a compiler warning due to unused variable on mips"
am: 3678078440

Change-Id: I789328684c5a5253b515c42a9dbdc6714272b9c1
2017-02-24 10:27:10 +00:00
Pavel Labath
fb5a6396dc Silence a compiler warning due to unused variable on mips
oops, I did it again.

Test: lunch mips && cd bionic && mma
Change-Id: I1fe2cb847d0698b34766869f9626398dbcf81960
2017-02-24 10:20:54 +00:00
Pavel Labath
df6f95b8a0 Merge "Add "imprecise" watchpoint ptrace test"
am: a936199ce0

Change-Id: I4fbf4ce77868d3483d5ea34c51b3d6f51cfb1b4d
2017-02-24 09:21:06 +00:00
Pavel Labath
3dad8d5d07 Add "imprecise" watchpoint ptrace test
This tests for the presence of a kernel bug that meant that the kernel
would sometimes fail to report the watchpoint hit if the hardware
reported a address which did not exactly match the address range being
watched (which it is allowed to do per ARM spec if the instruction
accesses a larger block of memory than the region being watched). This
bug was fixed in linux kernel 4.9, and has been backported to older
android kernels.

Bug: 30802222
Bug: 30919905
Test: bionic-unit-tests --gtest_filter="sys_ptrace.*"
Change-Id: I80c35b29eaf28e2dbacb9e8ee5317fdea653fc87
2017-02-24 09:16:06 +00:00
Dimitry Ivanov
6a1ce9cc3d Merge "Add test for a greylisted library"
am: 3f76dadf15

Change-Id: Ia5bb595314b154bca36d816f30b640eaf20c6cd7
2017-02-23 17:13:34 +00:00
Dimitry Ivanov
1862314dd4 Add test for a greylisted library
Test: bionic-unit-tests --gtest_filter=dlext.ns*
Bug: http://b/35338922
Change-Id: I2f4895cb1ec458c2f565a7e4d06f7a1f6200e7aa
2017-02-23 00:03:42 -08:00
Elliott Hughes
d57cfaf631 Merge "Cope with argv[0] being null in the dynamic linker."
am: c84e8a507c

Change-Id: I9d864e07d907a5090266658e074953cca119678a
2017-02-23 03:32:49 +00:00
Elliott Hughes
30a36273ab Cope with argv[0] being null in the dynamic linker.
Somewhat unsurprisingly, very few commands are happy to be run like this,
in particular multiplexed commands like toybox. But that's no reason for
the linker to get in the way too.

Bug: http://b/33276926
Test: new test
Change-Id: I6dd71ea0183f4da83571039c2198ebb6ed38520e
2017-02-22 17:37:52 -08:00
Elliott Hughes
39cacfe03f Merge "Add timeout support to __system_property_wait."
am: c9a840ac76

Change-Id: Ifaa6521599c8d36386cee6e980d0e10a7a6c1ef9
2017-02-22 01:47:53 +00:00
Treehugger Robot
c9a840ac76 Merge "Add timeout support to __system_property_wait." 2017-02-22 01:43:31 +00:00
Elliott Hughes
145e1f2ec7 Merge "Downgrade the special case of pthread_t(0) to a warning."
am: 2cb4fb033f

Change-Id: If4f963995645b9d57666d0cef0661aa96d8aa2a1
2017-02-22 00:42:11 +00:00
Elliott Hughes
40c885a4d1 Add timeout support to __system_property_wait.
Bug: http://b/35201172
Test: ran tests
Change-Id: I3a78813bf3cd50d1b308ecb3c742f923606c0cc4
2017-02-21 14:36:24 -08:00
Elliott Hughes
6ce686c48b Downgrade the special case of pthread_t(0) to a warning.
So far this is the only issue we've hit in vendor code, and we've hit
it several times already. Rather than try to fix bullhead (the current
problem), let's just admit that the special case of 0 is a lot less
worrying.

Also fix the test expectations to correspond to the new abort message.

Bug: http://b/35455349 (crashes on 0)
Bug: http://b/35622944 (tests)
Test: ran tests
Change-Id: Iec57011fa699a954ebeaec151db2193e36d1ef35
2017-02-21 14:21:43 -08:00
Josh Gao
5abca780c9 Merge "Add tests for ptrace resumption behavior." am: d11584665c
am: d4233fbc5e

Change-Id: Id0ee86d392268211501183e67600bcb9c7fde1d9
2017-02-17 19:46:25 +00:00
Josh Gao
d11584665c Merge "Add tests for ptrace resumption behavior." 2017-02-17 19:35:59 +00:00
Josh Gao
5e3fe9506c Add tests for ptrace resumption behavior.
Add tests that ensure that the kernel behaves properly w.r.t.
resumption of ptraced processes when the tracer dies.

Bug: http://b/34516140
Test: /data/nativetest/bionic-unit-tests/bionic-unit-tests --gtest_filter="PtraceResumption*"
Change-Id: Id35e069a7e5edd6964637dd3f6358ad59db19792
2017-02-16 14:15:42 -08:00
Daniel Micay
86ddf58f52 Merge "add fortified implementations of send/sendto" am: c54937b972 am: 0a4fb394c8
am: 63e9cd65f3

Change-Id: I23328cb633a50a5821ae7d29dc68b8abeaa06228
2017-02-15 18:41:25 +00:00
Treehugger Robot
c54937b972 Merge "add fortified implementations of send/sendto" 2017-02-15 18:26:50 +00:00
Daniel Micay
95b59c520b add fortified implementations of send/sendto
Bug: None
Test: Bullhead builds+boots; CtsBionicTestCases passes.
Change-Id: I2f137a100f679f7f2145d84b2f29ddd3e96a36ae
2017-02-14 15:50:28 -08:00
Elliott Hughes
509aa29afa Merge "Be more strict about using invalid pthread_ts." am: 0370905502 am: a18e9f88c8
am: daa5c8afa9

Change-Id: Ifd6fb9a24635b7f1cb32178247fd0e16a00502ea
2017-02-14 19:08:18 +00:00
Elliott Hughes
0370905502 Merge "Be more strict about using invalid pthread_ts." 2017-02-14 18:32:18 +00:00
Elliott Hughes
ddaba4fb59 Merge "Add __system_property_wait and return the serial in __system_property_read_callback." am: ade3be476f am: c9df674347
am: 520814a223

Change-Id: Id98cf76455a07eae901ea28aef2c273480722c70
2017-02-14 03:56:24 +00:00
Treehugger Robot
ade3be476f Merge "Add __system_property_wait and return the serial in __system_property_read_callback." 2017-02-14 03:48:26 +00:00
Elliott Hughes
11859d467c Be more strict about using invalid pthread_ts.
Another release, another attempt to remove the global thread list.

But this time, let's admit that it's not going away. We can switch to using
a read/write lock for the global thread list, and to aborting rather than
quietly returning ESRCH if we're given an invalid pthread_t.

This change affects pthread_detach, pthread_getcpuclockid,
pthread_getschedparam/pthread_setschedparam, pthread_join, and pthread_kill:
instead of returning ESRCH when passed an invalid pthread_t, if you're
targeting O or above, they'll abort with the message "attempt to use
invalid pthread_t".

Note that this doesn't change behavior as much as you might think: the old
lookup only held the global thread list lock for the duration of the lookup,
so there was still a race between that and the dereference in the caller,
given that callers actually need the tid to pass to some syscall or other,
and sometimes update fields in the pthread_internal_t struct too.

(This patch replaces such users with calls to pthread_gettid_np, which
at least makes the TOCTOU window smaller.)

We can't check thread->tid against 0 to see whether a pthread_t is still
valid because a dead thread gets its thread struct unmapped along with its
stack, so the dereference isn't safe.

Taking the affected functions one by one:

    * pthread_getcpuclockid and pthread_getschedparam/pthread_setschedparam
      should be fine. Unsafe calls to those seem highly unlikely.

    * Unsafe pthread_detach callers probably want to switch to
      pthread_attr_setdetachstate instead, or using
      pthread_detach(pthread_self()) from the new thread's start routine
      rather than doing the detach in the parent.

    * pthread_join calls should be safe anyway, because a joinable thread
      won't actually exit and unmap until it's joined. If you're joining an
      unjoinable thread, the fix is to stop marking it detached. If you're
      joining an already-joined thread, you need to rethink your design.

    * Unsafe pthread_kill calls aren't portably fixable. (And are obviously
      inherently non-portable as-is.) The best alternative on Android is to
      use pthread_gettid_np at some point that you know the thread to be
      alive, and then call kill/tgkill directly.

      That's still not completely safe because if you're too late, the tid
      may have been reused, but then your code is inherently unsafe anyway.

Bug: http://b/19636317
Test: ran tests
Change-Id: I0372c4428e8a7f1c3af5c9334f5d9c25f2c73f21
2017-02-13 17:59:29 -08:00
Elliott Hughes
a0d374d587 Add __system_property_wait and return the serial in __system_property_read_callback.
In order to implement android::base::WaitForProperty well, we need a way to
wait not for *any* property to change (__system_property_wait_any), but to
specifically wait for the property represented by a given `prop_info` to
change.

The android::base::WaitForProperty implementation, like attempts to cache
system properties in the past, also needs a way to keep serials and values
in sync, but the existing functions don't provide a cheap way to get a
consistent snapshot. Change the __system_property_read_callback callback's
type to include the serial corresponding to the given value.

Add a test, slightly clean up some of the existing tests (and name them to
include the names of the functions they're testing, in our usual style).

Bug: http://b/35201172
Test: ran tests
Change-Id: Ibc8ebe2e88eef1e333a1bd3dd7f68135f1ba7fb5
2017-02-13 13:30:10 -08:00
George Burgess IV
b8b7f1397f Merge "Match __bos0 to __pass_object_size0 in FORTIFY" am: 572b1dde03 am: ae80a17b4f
am: 20c5fe3a2b

Change-Id: Iad9923bdecdf8a10686dc62c25e644071b9bda98
2017-02-13 19:52:52 +00:00
Treehugger Robot
572b1dde03 Merge "Match __bos0 to __pass_object_size0 in FORTIFY" 2017-02-13 19:39:29 +00:00
Dimitry Ivanov
ab08d41fbe Merge "Replace public library list with shared lib sonames (part 2/2)" am: 2cb4dfbb8c am: ae80d78b5b
am: f3dde6d7e9

Change-Id: Ie589574e4e49949b8384d0924f2d4647b277f1ba
2017-02-11 19:37:58 +00:00
Dimitry Ivanov
2cb4dfbb8c Merge "Replace public library list with shared lib sonames (part 2/2)" 2017-02-11 19:26:49 +00:00
Dimitry Ivanov
4eeb581192 Merge "loader: fix d-tor call order" am: c9fb1774c5 am: 636354190d
am: c78b116a5e

Change-Id: I1f4d2e5313d52adf2b1159710b2029755da51b21
2017-02-11 06:06:21 +00:00
George Burgess IV
156d5a8ae9 Match __bos0 to __pass_object_size0 in FORTIFY
pass_object_size(N) forwards the result of __builtin_object_size(param,
N) to a function. So, a function that looks like:

  size_t foo(void *const p __pass_object_size) { return __bos0(p); }
  int bar = foo(baz);

would effectively be turned into

  size_t foo(void *const p, size_t sz) { return sz; }
  int bar = foo(baz, __bos(baz)); // note that this is not __bos0

This is bad, since if we're using __bos0, we want more relaxed
objectsize checks.

__bos0 should be more permissive than __bos in all cases, so this
change Should Be Fine™.

This change also makes GCC and clang share another function's
implementation (recv). I just realized we need to add special
diagnostic-related overloads bits for clang to it, but I can do that in
another patch.

Bug: None
Test: Bullhead builds and boots; CtsBionicTestCases passes.
Change-Id: I6818d0041328ab5fd0946a1e57321a977c1e1250
2017-02-10 18:14:43 -08:00
Dimitry Ivanov
ec90e24d33 loader: fix d-tor call order
In the case when there are multiple dependencies on
the same library in the local_group the unload may
in some situations (covered now by tests) result
calling d-tors for some libraries prematurely.

In order to have correct call order loader checks if this
is last dependency in local group before adding it to BFS
queue.

Bug: http://b/35201832
Test: bionic-unit-tests --gtest_filter=dl*:Dl*
Test: bionic-unit-tests-glibc --gtest_filter=dl*
Change-Id: I4c6955b9032acc7147a51d9f09b61d9e0818700c
2017-02-10 16:11:51 -08:00
Dimitry Ivanov
36feac9da0 Merge "Replace public library list with shared lib sonames (part 1/2)" am: 132768084e am: 0e27209156
am: 9a6cd5d620

Change-Id: Id21ed632aa74f8eee75fc8cabc9748d8c2c3a3d2
2017-02-10 19:09:28 +00:00
Dimitry Ivanov
7a34b9d57a Replace public library list with shared lib sonames (part 2/2)
This commit updates interface of libdl.c.

1. android_init_namespaces is replaces with android_init_anonymous_namespace
2. added 2 arguments to android_create_namespace to specify linked namespace
   and the list of shared libraries sonames.
3. symbol lookup does not get past boundary libraries (added check and test for it).

Bug: http://b/26833548
Bug: http://b/21879602
Test: bionic-unit-tests --gtest_filter=dl*:Dl*
Change-Id: I32921da487a02e5bd0d2fc528904d1228394bfb9
2017-02-09 23:26:44 -08:00
Dimitry Ivanov
7d429d3c48 Replace public library list with shared lib sonames (part 1/2)
Replace public library list with shared lib sonames
which are property of a link between namespaces

This change does not touch any external interfaces
so from outside it behaves almost as it was before

One significant difference is that there is no longer
need to preload public libraries.

Bug: http://b/26833548
Test: bionic-unit-tests --gtest_filter=dl*:Dl*
Change-Id: I57e44e18a9b4f07dcd6556436346be52f52b79d7
2017-02-09 23:26:44 -08:00
George Burgess IV
ee67c6a203 Merge "libc: add clang FORTIFY support" am: 5ac650936f am: eeb4544186
am: 2cae2dc5d7

Change-Id: I34fc97a1a7e9354899cdf78552388cc6ed07edea
2017-02-10 02:16:03 +00:00
Treehugger Robot
5ac650936f Merge "libc: add clang FORTIFY support" 2017-02-10 02:07:28 +00:00
Dimitry Ivanov
2ea5578e0b Merge "Add test checking init/fini call order" am: 4e7ab9292d am: 915b6d8d9d
am: c46af6b708

Change-Id: Ib6459cf3652a4d56ba631629eae8920724ff020d
2017-02-10 00:33:01 +00:00
George Burgess IV
7cc779f15c libc: add clang FORTIFY support
This patch adds clang-style FORTIFY to Bionic. For more information on
FORTIFY, please see https://goo.gl/8HS2dW . This implementation works
for versions of clang that don't support diagnose_if, so please see the
"without diagnose_if" sections. We plan to swap to a diagnose_if-based
FORTIFY later this year (since it doesn't really add any features; it
just simplifies the implementation a lot, and it gives us much prettier
diagnostics)

Bug: 32073964
Test: Builds on angler, bullhead, marlin, sailfish. Bionic CTS tests
pass on Angler and Bullhead.

Change-Id: I607aecbeee81529709b1eee7bef5b0836151eb2b
2017-02-09 15:49:32 -08:00
Dimitry Ivanov
ea8f396c59 Add test checking init/fini call order
This test is checking that loader complies with the order described in
http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#init_fini

Bug: http://b/35201832
Test: bionic-unit-tests --gtest_filter=dl*:Dl*
Test: bionic-unit-tests-glibc --gtest_filter=dl*
Change-Id: I4cdf878c043112442c191e82aa9f5d5077e4d8c4
2017-02-09 14:07:05 -08:00
Elliott Hughes
5fb7f27658 Merge "Revert "Stop checking the global thread list in several trivial cases."" am: f201c704d6 am: b82f472c66
am: dcaa56e695

Change-Id: I77d870353cd9234a9a1223e2f20caefb59dbb22d
2017-02-07 21:20:40 +00:00
Elliott Hughes
bcb152903a Revert "Stop checking the global thread list in several trivial cases."
This reverts commit f5a4992b71.

Breaks OMX_ImgEnc in cameraserver (http://b/35088254).

Change-Id: I6dcf12706a184b0b8b72451584567a42dfa1bb4f
2017-02-07 21:05:30 +00:00
Elliott Hughes
dc1461dd74 Merge "Stop checking the global thread list in several trivial cases." am: 4708f435f5 am: 56209f0dd4
am: ffb2bddcb9

Change-Id: I4aaafd2e4a2e338d89f9efd9fb309974e97cdf20
2017-02-07 00:41:27 +00:00
Elliott Hughes
f5a4992b71 Stop checking the global thread list in several trivial cases.
Since removing the global thread is hard, let's take the different
groups of functions individually.

The existing code was racy anyway, because the thread might still be
on the list but have exited (leaving tid == 0).

Bug: http://b/19636317
Test: ran tests
Change-Id: Icc0986ff124d5f9b8a653edf718c549d1563973b
2017-02-06 14:09:53 -08:00
Evgenii Stepanov
d2fe2648a9 Merge "Fix CFI initialization crash on x86." am: 9886ea3e2d am: ba5e2634df
am: 3b00fcf727

Change-Id: I4eded9a2978e04d8773cc35509584ebcd70de048
2017-02-03 01:58:20 +00:00
Evgenii Stepanov
9886ea3e2d Merge "Fix CFI initialization crash on x86." 2017-02-03 01:47:15 +00:00
Evgenii Stepanov
68ecec1965 Fix CFI initialization crash on x86.
Third try.

Bug: 34752378
Test: bionic tests
Change-Id: I247c127489a8ee38404e104f28d916a704e35f36
2017-02-02 14:44:46 -08:00
David James
afd5b3b4dd Merge "Revert "Remove the global thread list."" am: a187a6f12e am: 5124a0e635
am: 91fbf754fc

Change-Id: I4d35f999d5cb689c4b2b426e2bf45992447e0f0a
2017-02-02 02:54:38 +00:00
David James
a187a6f12e Merge "Revert "Remove the global thread list."" 2017-02-02 02:46:40 +00:00
Elliott Hughes
7484c21c4c Revert "Remove the global thread list."
This reverts commit b0e8c565a6.

Breaks swiftshader (http:/b/34883464).

Change-Id: I7b21193ba8a78f07d7ac65e41d0fe8516940a83b
2017-02-02 02:41:38 +00:00
Elliott Hughes
57ab193a62 Merge "Remove the global thread list." am: 9b9d4ebc8b am: 959ef64b41
am: 7922c13fb6

Change-Id: Ia4e2e26e203dae0fb27c5f1e9a09894a667c8b99
2017-02-01 16:23:59 +00:00
Elliott Hughes
9b9d4ebc8b Merge "Remove the global thread list." 2017-02-01 16:16:41 +00:00
Evgenii Stepanov
5ef496739b Merge "Revert "Fix CFI initialization crash on x86."" am: 9586fe2744 am: 567965435f
am: f1507405ef

Change-Id: I0113d0c06622a3be669dcf458f24711d5a25802b
2017-02-01 01:24:06 +00:00
Evgenii Stepanov
beb3eb1790 Revert "Fix CFI initialization crash on x86."
Breaks aosp-master/sdk.

This reverts commit 4ccd4317f9.
2017-01-31 17:10:03 -08:00
Evgenii Stepanov
2f3da086a3 Merge "Fix CFI initialization crash on x86." am: dd76f744e7 am: 291d11c8c8
am: 8d37634f76

Change-Id: I37a31852eb38503f5e36492a95d76538cb573055
2017-02-01 00:39:05 +00:00
Evgenii Stepanov
4ccd4317f9 Fix CFI initialization crash on x86.
Second try.

Bug: 34752378
Test: bionic tests
Change-Id: I0a7453154671918b2e6e72f0bb9074c29ceb0f34
2017-01-31 13:44:55 -08:00
Alex Cheung
25dd4b9aa1 Merge "Revert "Fix CFI initialization crash on x86."" am: 9750d6b691 am: 083f79000d
am: 13af389ed3

Change-Id: I49a7f8e4ae6f7fe2c3499b63e9841258cf06de78
2017-01-31 06:34:57 +00:00
Alex Cheung
6fcd7a7d28 Revert "Fix CFI initialization crash on x86."
This reverts commit be46d3871c.

Reverting due to broken build:

https://android-build.googleplex.com/builds/branch-dashboard/aosp-master?build_id=3687823

Change-Id: I30968398edd9a094fce878839ba0a002ed487a77
2017-01-31 04:19:50 +00:00
Evgenii Stepanov
3d9eb69ef6 Merge "Fix CFI initialization crash on x86." am: a5066640cc am: e3852f36b9
am: d0b511ebbb

Change-Id: Ib44d812a8c9b41c3903f58421eb20a9ff4e2a010
2017-01-31 01:14:40 +00:00
Evgenii Stepanov
be46d3871c Fix CFI initialization crash on x86.
Bug: 34752378
Test: bionic tests
Change-Id: If8e33f76a1a2d83356d818fed506ea624f579860
2017-01-30 14:29:48 -08:00
Pavel Labath
bc5d2983f3 Merge "Silence unused variable warning in sys_ptrace_test" am: 15db5d0d29 am: f0c213da63
am: c87864aacd

Change-Id: Id853e264e46244c7c21261066d010fba676c1249
2017-01-27 14:07:42 +00:00
Pavel Labath
bb9713dd91 Silence unused variable warning in sys_ptrace_test
This fixes the mips build broken by
I7d8a7d79585477d78da1f033c85f8d2cc3b34340.

Change-Id: Ib960bdb51ac81be068f1fdf702aa7c10b183f2a0
Test: lunch mips && cd bionic && mma
2017-01-27 13:06:22 +00:00
Pavel Labath
113a2f2bbe Merge "Add hardware breakpoint ptrace test" am: 3f62787cf9 am: f464d5b5b2
am: dc6645f4fd

Change-Id: Id61e1da17fcbfd1fb1fd86754479f0c018e10bdf
2017-01-27 12:47:38 +00:00
Pavel Labath
fb082ee00c Add hardware breakpoint ptrace test
This adds a ptrace test which tests the hardware breakpoint
functionality of the ptrace api.

I've also renamed the test case to sys_ptrace to better match the naming
scheme in the other files. I've ran the tests on angler (32 and 64 bit)
and fugu.

Test: run the test
Change-Id: I7d8a7d79585477d78da1f033c85f8d2cc3b34340
2017-01-27 12:39:32 +00:00
Dimitry Ivanov
8eceb1074e Merge "Remove bionic-unit-tests-gcc" am: 55aae03a60 am: a47e3a958b
am: 9bd7d27bd8

Change-Id: I59de41967025f310146ac99220f5edce5783ebf3
2017-01-27 03:14:40 +00:00
Dimitry Ivanov
55aae03a60 Merge "Remove bionic-unit-tests-gcc" 2017-01-27 01:28:03 +00:00
Dimitry Ivanov
3c81d5b361 Remove bionic-unit-tests-gcc
Test: mm
Bug: 34747525
Change-Id: Ib17ac3535b6f3358af7098df0602d19c6e318cb7
2017-01-26 15:47:55 -08:00
Victor Khimenko
1d7b359d50 Merge "Fix bionic-unit-tests in arch with binary translator" am: 3c0363d7fd am: cfe98d3195
am: 7d3fdfe4a6

Change-Id: If11ccbf9f02d6dfe51aac0c176e1402684622e52
2017-01-26 10:23:40 +00:00
Victor Khimenko
14b9d7199c Fix bionic-unit-tests in arch with binary translator
If binary translator is involved then libc is not place in /system/lib
or /system/lib64.  It's placed into /syste/lib/arm, /system/lib/arm64,
etc.  FUGU is an example of such an architecture.

Support both cases by picking right path at runtime.

Test: run bionic-unit-tests --gtest_filter=dlfcn.dladdr_libc
Change-Id: I8345c0f6c19376ebe5106f9670fd2addeb9b9080
2017-01-25 20:57:48 +01:00
Victor Khimenko
8fbdf994b0 Merge "Fix bionic-unit-tests in some non-standard builds" am: 18c009ca96 am: dc7ec2bb8a
am: 221eef03da

Change-Id: I102cc36b84f00038e3c0d65bf777be6e76bf01ee
2017-01-25 10:13:34 +00:00
Victor Khimenko
18c009ca96 Merge "Fix bionic-unit-tests in some non-standard builds" 2017-01-25 10:05:41 +00:00
Dimitry Ivanov
9ba0428a55 Do not send 0 byte string content. am: cafd355375 am: 6fd88344a5
am: 8dba8acd6e

Change-Id: Ida48c2f6dd8a9c65a87c13bff0f67f6b597ba7fa
2017-01-25 04:04:01 +00:00
Dimitry Ivanov
ac7fdd2121 Revert "Revert "Remove limit of system property name length"" am: 16b2a4de14 am: d91e7766ec
am: c809b7a43f

Change-Id: Ic91631717fae0dea66ae970a99e67e178ffedd4f
2017-01-25 04:03:51 +00:00
Dimitry Ivanov
cafd355375 Do not send 0 byte string content.
Trying to send even 0 bytes to closed socket leads to
broken pipe error. Sometimes property service is just
quick enough and closes the socket between send(valuelen)
and send(value) in the case where valuelen is 0.

Bug: http://b/34670529
Test: adb reboot 20 times and make sure phone service did not fail
Test: run bionic-unit-tests --gtest_filter=prop*
Change-Id: I96f90ca6fe1790614e7efd3015bffed1ef1e9040
2017-01-24 14:19:03 -08:00
Victor Khimenko
65273fb630 Fix bionic-unit-tests in some non-standard builds
The binary bionic-unit-tests is linked with some shared libraries
and these libraries are found in ${ORIGIN}/../bionic-loader-test-libs
directory specified by runpath.  This makes it higly unlikely that
anyone would be run these files when ${ORIGIN}/../bionic-loader-test-libs
does not include proper files.

Bug: http://b/34681268
Test: run bionic-unit-tests --gtest_filter=dl*:Dl*

Change-Id: I52fc31339fdfa232c0fdafa218eadaeaf5551a8d
2017-01-24 22:20:03 +01:00
Dimitry Ivanov
16b2a4de14 Revert "Revert "Remove limit of system property name length""
This reverts commit 489f58b5ea.
Bug: http://b/33926793
Bug: http://b/34670529
Test: Run bionic-unit-tests --gtest_filter=prop*

Change-Id: Id4e94652dc2310a21f5b7bd3af098bf79df3f380
2017-01-24 12:58:18 -08:00
Dimitry Ivanov
5313299f01 Merge "Revert "Remove limit of system property name length"" am: 40250bb683 am: e3a684f858
am: 205bb70df8

Change-Id: Ic33f6f20210fb37dde324b79a92bcd06caad9514
2017-01-24 20:09:08 +00:00
Dimitry Ivanov
40250bb683 Merge "Revert "Remove limit of system property name length"" 2017-01-24 20:00:44 +00:00
Dimitry Ivanov
489f58b5ea Revert "Remove limit of system property name length"
This reverts commit 5c1ce278f3.
Bug: http://b/33926793
Bug: http://b/34670529

Change-Id: I0dc4a8ae55576c69b34b2958d8e664f7066b9c54
2017-01-24 18:39:04 +00:00
Dimitry Ivanov
6b497a705e Merge "Remove limit of system property name length" am: 440d6c7644 am: 87190c845e
am: eda500fdf9

Change-Id: I15823d5f19f592465f17441429635d5085080060
2017-01-24 03:00:22 +00:00
Dimitry Ivanov
440d6c7644 Merge "Remove limit of system property name length" 2017-01-24 02:54:34 +00:00
Dimitry Ivanov
4da4cb0735 Merge "Remove libc++ dependency from prebuilt test-libs" am: 8bb01c0719 am: 865ceb0c1b
am: 633c9f6999

Change-Id: I8d3839e322dedfc36d57e1e25f4dd84dfb0db258
2017-01-24 00:46:43 +00:00
Dimitry Ivanov
985c05f956 Merge "Mark ifunc tests failing on arm as known failures" am: 3685e4515f am: c3f26cb41e
am: 0fd876c9c9

Change-Id: Ibc3cb3952258a4f75968cd41fb98773a395d2fa1
2017-01-24 00:46:33 +00:00
Treehugger Robot
8bb01c0719 Merge "Remove libc++ dependency from prebuilt test-libs" 2017-01-24 00:36:00 +00:00
Dimitry Ivanov
01c888c857 Mark ifunc tests failing on arm as known failures
Bug: http://b/27930475
Test: run bionic-unit-tests on arm and arm64
Change-Id: I5084b6a5ef4b56ca9985da63a5e6896f771810f0
2017-01-23 14:52:07 -08:00
Dimitry Ivanov
bfe8680564 Remove libc++ dependency from prebuilt test-libs
Bug: http://b/27549327
Test: run bionic-unit-tests --gtest_filter=dl*:Dl* on angler
Change-Id: Ia09ed2c00213bc07bf2a4c772e675419f7a30cb3
2017-01-23 14:47:45 -08:00
Dimitry Ivanov
5c1ce278f3 Remove limit of system property name length
This change introduces new __system_property_read_callback
method to use in place of deprecated __system_property_read
__system_property_set() and get() should just work but now
do not have limit on system property names.

Bug: http://b/33926793
Test: boot device, run adb shell propget
Test: boot device with old version of init (protocol v1)
Test: run bionic-unit-tests --gtest_filter=prop*
Change-Id: I619fb5a7e27a272aac30011579665f6160888bc7
2017-01-23 11:21:18 -08:00
Evgenii Stepanov
a6711474a1 Merge "Runtime support for CFI" am: 082bec5b41 am: adcec1585b
am: 992d012f80

Change-Id: I104ec5d0a128ddfba0033b3df882c7efcb158f2e
2017-01-19 00:02:15 +00:00
Josh Gao
ba2ab9e37e Rename libdebuggerd_client to libdebuggerd_handler. am: 2a3b4fa6ec am: 3560ff90f0
am: 4a5699ab52

Change-Id: I72a704e119361d579bd2fa774b74a9d5c78413b0
2017-01-18 23:55:14 +00:00
Evgenii Stepanov
082bec5b41 Merge "Runtime support for CFI" 2017-01-18 23:39:08 +00:00
Evgenii Stepanov
0a3637d3eb Runtime support for CFI
Control Flow Integrity support in bionic.

General design:
http://clang.llvm.org/docs/ControlFlowIntegrityDesign.html#shared-library-support

This CL implements subsections "CFI Shadow" and "CFI_SlowPath" in the above document.

Bug: 22033465
Test: bionic device tests
Change-Id: I14dfea630de468eb5620e7f55f92b1397ba06217
2017-01-18 13:13:52 -08:00
Josh Gao
2a3b4fa6ec Rename libdebuggerd_client to libdebuggerd_handler.
Bug: http://b/30705528
Test: debuggerd_test
Change-Id: I625a9a2e7304d172873ba9344b74efa57ad7bdad
2017-01-17 15:11:46 -08:00
Yabin Cui
203d0232db Merge "Switch bionic-unit-tests to libc++_static." am: 37f1d11482 am: 820c7fae07
am: 5ec22b1eed

Change-Id: Ib570bc2a2e59905e69a93e72ab61afd0f8e98bac
2017-01-14 02:30:05 +00:00
Yabin Cui
1f553ea5da Switch bionic-unit-tests to libc++_static.
Bug: http://b/27549327
Test: run bionic-unit-tests, bionic-unit-tests-glibc.
Change-Id: I719899624dec83728a3d5b8169079e5c91c63c04
2017-01-13 12:34:36 -08:00
Pavel Labath
2125377c98 Merge "Beef up process_vm_readv/writev tests" am: a970ac50d1 am: 8557ee78ec
am: d779d1c037

Change-Id: Ifedc2116503c8795d3f020e2142add03d937a372
2017-01-13 10:30:16 +00:00
Pavel Labath
cc441001c0 Beef up process_vm_readv/writev tests
LLDB uses process_vm_readv quite extensively (it's an order of
magnitude faster than PTRACE_PEEKDATA). Add a bit more tests of
the function to make sure it stays working.

Change-Id: I64e17e6d56842f118a9485e3a18f42ca5e1b7577
Test: run the new test
2017-01-13 10:21:19 +00:00
Elliott Hughes
3d64b02538 Merge "localtime_r(3) should act as if it calls tzset(3)." am: 1b2975d54b am: e767a92c57
am: c9e91d1a98

Change-Id: I3ba74be33afd1b452b11e9ee99bbc303903fa1a2
2017-01-12 23:33:04 +00:00
Elliott Hughes
1b2975d54b Merge "localtime_r(3) should act as if it calls tzset(3)." 2017-01-12 23:19:50 +00:00
Josh Gao
1ed866ba57 Merge "Improve fmemopen tests." am: 27fa754287 am: bbacec3f5d
am: ab5b3c26db

Change-Id: I8de2b09c4e41148b65add0f189a975f7fb90c06f
2017-01-12 00:20:40 +00:00
Josh Gao
27fa754287 Merge "Improve fmemopen tests." 2017-01-11 23:59:02 +00:00
Elliott Hughes
ea87716696 localtime_r(3) should act as if it calls tzset(3).
See code comment.

Bug: http://b/31339449
Test: ran tests & benchmarks
Change-Id: I6b6a63750ef41664dc4698207e6a53e77cc28cdf
2017-01-11 14:56:04 -08:00
Josh Gao
674cd55bff Merge "Add support for expected failures to gtest runner." am: 94ea19895c am: 6b767b91cc
am: 7290adbdcd

Change-Id: Ib14a678a56b1e71d0ad736d3f8560bf4f0078201
2017-01-11 22:48:59 +00:00
Treehugger Robot
94ea19895c Merge "Add support for expected failures to gtest runner." 2017-01-11 22:32:18 +00:00
Josh Gao
2f06e10280 Improve fmemopen tests.
Tag fmemopen_NULL as a known failure, and make it reliably fail by
memsetting the buffer we read to.

Bug: http://b/33251022
Test: bionic-unit-tests/bionic-unit-tests64 on bullhead
Test: bionic-unit-tests-glibc --gtest_filter="*memopen*"
Change-Id: I381783282359851c9de47146dafbb5a291960c2a
2017-01-11 13:00:15 -08:00
Dimitry Ivanov
6c375b907e Merge "Hide __system_property_add/update, deprecate find_nth" am: 907fcc98b2 am: ee062c3577
am: e24dc59591

Change-Id: I56a2a4e08342dacd7c447756f559f0ecbada67a0
2017-01-11 02:12:51 +00:00
Treehugger Robot
907fcc98b2 Merge "Hide __system_property_add/update, deprecate find_nth" 2017-01-11 01:57:56 +00:00
Dimitry Ivanov
581b9f661b Hide __system_property_add/update, deprecate find_nth
These functions are supposed to be used only by the
property service.

__system_property_find_nth is deprecated and no longer part
of NDK. Call to this function will result in abort for apps
targeting Android O.

Bug: http://b/34114501
Test: bionic-unit-tests --gtest_filter=prop*
Change-Id: I9846965bf248e2ddf45cd7b293618245bbd87145
2017-01-10 13:41:27 -08:00
Josh Gao
010522229c Add support for expected failures to gtest runner.
Bug: http://b/33251022
Test: manually added tests that unexpectedly failed
Test: bionic-unit-tests/bionic-unit-tests64 on bullhead
Change-Id: Ie9aef80014b9fd6512b68f0e42abc298732a9b6e
2017-01-10 12:56:25 -08:00
Elliott Hughes
affb322c73 Revert "Revert "move android_ids into bionic"" am: 3f6eee9793 am: 45be5dfe98
am: 80a477c4ea

Change-Id: I18423a5339e7d53c38555e1cedbf9dea09b59f55
2017-01-10 01:33:26 +00:00
Elliott Hughes
45be5dfe98 Revert "Revert "move android_ids into bionic""
am: 3f6eee9793

Change-Id: I6a65710f926a76e48705fa4594f479f5d48df068
2017-01-10 01:23:26 +00:00
Elliott Hughes
940d460f59 Merge "Revert "Revert "move android_ids into bionic""" 2017-01-10 01:15:30 +00:00
Elliott Hughes
b0e8c565a6 Remove the global thread list.
Another release, another attempt to fix this bug.

This change affects pthread_detach, pthread_getcpuclockid,
pthread_getschedparam/pthread_setschedparam, pthread_join, and pthread_kill:
instead of returning ESRCH when passed an invalid pthread_t, they'll now SEGV.

Note that this doesn't change behavior as much as you might think: the old
lookup only held the global thread list lock for the duration of the lookup,
so there was still a race between that and the dereference in the caller,
given that callers actually need the tid to pass to some syscall or other,
and sometimes update fields in the pthread_internal_t struct too.

We can't check thread->tid against 0 to see whether a pthread_t is still
valid because a dead thread gets its thread struct unmapped along with its
stack, so the dereference isn't safe.

Taking the affected functions one by one:

* pthread_getcpuclockid and pthread_getschedparam/pthread_setschedparam
  should be fine. Unsafe calls to those seem highly unlikely.

* Unsafe pthread_detach callers probably want to switch to
  pthread_attr_setdetachstate instead, or using pthread_detach(pthread_self())
  from the new thread's start routine rather than doing the detach in the
  parent.

* pthread_join calls should be safe anyway, because a joinable thread won't
  actually exit and unmap until it's joined. If you're joining an
  unjoinable thread, the fix is to stop marking it detached. If you're
  joining an already-joined thread, you need to rethink your design.

* Unsafe pthread_kill calls aren't portably fixable. (And are obviously
  inherently non-portable as-is.) The best alternative on Android is to
  use pthread_gettid_np at some point that you know the thread to be alive,
  and then call kill/tgkill directly. That's still not completely safe
  because if you're too late, the tid may have been reused, but then your
  code is inherently unsafe anyway.

If we find too much code is still broken, we can come back and disable
the global thread list lookups for anything targeting >= O and then have
another go at really removing this in P...

Bug: http://b/19636317
Test: N6P boots, bionic tests pass
Change-Id: Ia92641212f509344b99ee2a9bfab5383147fcba6
2017-01-07 14:16:46 -08:00
Dimitry Ivanov
52bfd3d548 Merge "Fix bionic-unit-tests-static crash" am: 500b9be411 am: 1cfb85c199
am: fe0a303a5a

Change-Id: I873f269dab7db1593c59a3a2da52b2ec873cdd52
2017-01-07 04:11:46 +00:00
Dimitry Ivanov
462ea664cf Fix bionic-unit-tests-static crash
The crash happens because for static executables call to dlopen
results in crash. This change moves dlopen() == nullptr check
from static variable to a functions so that the dlopen crash only
affects tests calling dlopen but not the whole executable.

Also make static tests report crashes to debugerd

Test: run bionic-unit-tests-static (for arm 32 and 64)
Bug: http://b/34129417
Change-Id: I7c4d8caf2a43250234fe24496b1c95eab572769f
2017-01-06 16:16:26 -08:00
Jeff Sharkey
0e6d4f5fec Merge "Define range of GIDs for cached app data." am: 54891837a0 am: ce7c613609
am: 3ef6bb6ff1

Change-Id: I08225c7054e23e715d199441b2a542bcad6dae0a
2016-12-15 23:31:05 +00:00
Jeff Sharkey
54891837a0 Merge "Define range of GIDs for cached app data." 2016-12-15 21:46:30 +00:00
Dimitry Ivanov
9ddb6f317e Merge "Add test for elf-hash and packed relocations" am: 59dd61573f am: 488eac109b
am: e66f6b8803

Change-Id: I5fea184c15d9876f6e43f1c37dbd958a9f1664a5
2016-12-15 18:49:42 +00:00