This shows up when you're doing make HOST_SANITIZE=address
Test: mmma bionic && out/host/linux-x86/bin/bionic_tests_zipalign (compare before and after)
Change-Id: Ia94790496327f3818d5fdb7b5ad07e14e60bcae1
The parsefloat routines -- which let us pass NaNs and infinities on to
strto(f|d|ld) -- come from NetBSD.
Also fix LP64's strtold to return a NaN, and fix all the architectures
to return quiet NaNs.
Also fix wcstof/wcstod/wcstold to use parsefloat so they support hex
floats.
Lots of new tests.
Bug: http://b/31101647
Change-Id: Id7d46ac2d8acb8770b5e8c445e87cfabfde6f111
Times before 1901-12-13 *underflow* on LP32, making the year 1900 a bad
choice for success case.
Bug: http://b/31305222
Change-Id: I20d4885c80b57707225580db044abc8948a55fdc
Move libraries used in bionic-unit-tests out of system partition to
/data/nativetests../bionic-loader-test-libs
Bug: http://b/22182538
Test: build bionic and run bionic-unit-tests
Change-Id: I170177bef782839d0b4970ae4418bf54d0a77836
Make these compile as static libraries by properly declaring their
dependencies.
I turned off the shared version of libBionicTests because it produces
this linker warning (treated as error):
external/libcxx/include/sstream:859: warning: relocation refers to
discarded section
Change-Id: I2e1448b47a441b273d208ebd068d0d22e340a0ff
On actual devices, we have a lot of slow tests. Warnings about those
cause cause the failed tests to scroll off the display.
Also replace the made-up word "warnline".
Change-Id: I6b579521a21b56da8a1add08cd34888fc902646e
Use non-empty $(module)_install_to_out_data_dir as indication
of custom target dir for a library.
Bug: http://b/22182538
Test: build and run bionic-unit-tests --gtest_filter=dl*:Dl*
Change-Id: Ibfc87f45084a6fe2f487ca1b17a7625a8d8ec707
The test relies on the fact/assumes that CPU 0 is available to the
test process. This is not necessarily the case. Instead of allocating
CPU 0 to the main thread, find the first available CPU and use that
instead.
BUG=b/29991929
TEST=All Bionic unit tests pass
(cherrypick of 766275e7f697c30164678e1fed55b2a2fcbf8546.)
Change-Id: I36b311cdba57112d663d652757fd5114183fc780
The special case for absolute paths wasn't handling ENOEXEC.
Also add more extensive tests for execvpe.
Also switch to manually doing the fork in ExecTestHelper::Run because
ASSERT_EXIT doesn't actually return, meaning we were only running the
first part of each test.
Bug: http://b/31073104
Change-Id: I7a4640afc6d290c51ba2e66fc1b9bb6b0fc174f7
Also fix <sys/ipc.h>.
Not useful except to systems/bringup folks for testing. Trivial tests
added, and double-checked under strace to see that things look right.
x86 -- which works differently to everything else -- tested on the host.
Bug: http://b/27952303
Change-Id: I328534e994ae9e90755f545478fba03038c0bb94
Group of libtest_invalid* libraries does not exists for mips architecture,
so disable relevant tests.
Change-Id: I3a4fef94933eb33654c4274aa249ea5d61d6cf9b
Make sure linker does not crash when dlopening
elf-file with odd section header offset.
Bug: http://b/30795430
Bug: http://b/30687964
Test: bionic-unit-tests --gtest_filter=dlfcn.dlopen_invalid*
Change-Id: If59cb6da85b8752a69dc5687de85f9a9b74c92b4
No mapped segment from the elf file can be writable and
executable at the same time. This commit adds a check
for malformed PT_LOAD segments in the elf-files.
Bug: http://b/30146890
Test: run bionic-unit-tests --gtest_filter=dlfcn.*
Change-Id: Ia23acbe5a48780b65d7e4a50bbe024cd528079f4
We already had implementations of some of the functions, and I didn't
bother rewriting them when we added sysinfo(2). Ross Anderson said in
https://www.lightbluetouchpaper.org/2016/07/29/yet-another-android-side-channel/
that we should "simply disable access to all procfs files", which made
me curious how many places we use /proc in bionic. This is the one that's
obviously unnecessary. The others I'm not aware of alternative APIs for.
Change-Id: Ia64f36b76f29a7a1dd67845270a5472e121aae10
This assumes that it's more likely we're unlinking a file than a directory,
though even if that's not true, as long as a failed unlink(2) is cheaper
than a successful lstat(2) -- which seems likely since there's no data to
copy -- we still win.
Change-Id: I0210e9cd3d31b8cf1813c55c810262ef327382ed
__STDC_VERSION__ isn't defined for __cplusplus, so we've been removing
such checks. Some got missed.
Stop defining __func__ and just use the __PRETTY_FUNCTION__ GCC extension
in <assert.h>. Also fix the #if there so that C++ gets __assert2 rather
than __assert, and rewrite the cast to work with -I rather than -isystem.
Also remove __restrict and just always use the __restrict GCC extension.
Add a trivial test for <assert.h>.
Bug: http://b/30353757
Change-Id: Ie49bb417976293d3a9692b516e28fe3c0ae0a6d9
Test: ran bionic unit tests.