We still use GCC to build the bionic unit tests into CTS, and it emits a
false positive -Wmissing-field-initializers warning for the C++11 aggregate
initialization syntax `Foo foo = {}`.
Bug: http://b/27656293
Change-Id: I016d8dae6d6cd28afe4bc19250c2a8fba908f8e6
When using libhoudini to run arm code on x86 platforms, we can't
assume the main thread allocates local variables at the stack
declared by kernel.
Change-Id: Id9457f47fc338a3103fdee25a7a6e622915e7090
The previous code assumed that returning would be sufficient to rethrow
signals like SIGSEGV. This is not true, for example, in the case where a
SIGSEGV is sent via kill(2). We were previously only sending the signal
to ourselves in some cases, because using kill(2) would lose information
in the siginfo_t argument. Use rt_tgsigqueueinfo(2) instead to preserve
its contents.
Bug: http://b/27367422
Change-Id: I1be822818d5905461979c7e12dc4e9c25049273b
Make it easier to diagnose applications mucking with the contents of
jmp_buf by checksumming its contents.
Bug: http://b/27417786
Change-Id: I9989e2ea3979a36ae0bc4c9e1bacafddbacc731b
Print properties of the namespace on "library is not accessible"
error to better diagnose problems with native library accessiblity
Bug: http://b/27406143
Change-Id: Icf3d6c604f09dfa015de863fdb1267d343930d2a
(cherry picked from commit 350bdad61c)
The old implementation was unnecessarily complex, and using the wrong ioctl
for point-to-point destination addresses.
Bug: http://b/27313259
Change-Id: I9cabd17e414ce42b115037a3f828d79843f604f9
clang depends on memcpy where src and dst are the same to actually
work. Even though this is, technically, undefined behavior,
clang is not going to change. Add a test to verify this assumption
holds true for android devices.
Change-Id: Ib575af3c14e705bb62c18fad7d57e1cc0d242899
In order to enforce this constraint:
The pointer returned if the allocation succeeds shall be suitably
aligned so that it may be assigned to a pointer to any type of object
and then used to access such an object in the space allocated.
Force all allocations on 32 bit systems to have 8 byte alignment,
and all allocations on 64 bit systems to have 16 byte alignment.
Add a test to verify that the allocator returns the correct alignments.
Bug: 26739265
Change-Id: I9af53279617408676b94e4ec6481b3ed7ffafc6a
Found by passing a bad regular expression to the Google benchmark
code (https://github.com/google/benchmark).
Change-Id: I475db71c25706bbf02091b754acabe8254062f3a
POSIX lets us return null and set errno, but that would be annoying and
surprising.
Bug: http://b/27101951
Change-Id: I320a8a14884abb806a8d30e3e6cf1ede28b49335
It turns out we don't have any bugs here, but glibc does. Found while
chasing down a toybox failure I saw on the host, but we may as well
add the test in case we ever screw up here in future.
Change-Id: Ib8dd227ed3b742dc4dab8c09dc08e6ea9a35c807
This is a common thing for people to want to do, snprintf requires
a lot of stack for itself, and PTHREAD_STACK_MIN should be usable
for realistic code.
Change-Id: Ib09cfb4e0beec1c69ee0944c3ea4c5d03a94c491
Our fopen/freopen/tmpfile are already always O_LARGEFILE, but let's add
the aliases for _LARGEFILE_SOURCE compatibility.
Bug: http://b/24807045
Change-Id: I5d99b3ef3c9f27ce70f13313f6a92e96c7f21f80
The interface name wasn't being nul-terminated for the ioctl. Also clean up
the code a bit to give more useful diagnostics on failure.
Bug: http://b/26887941
Change-Id: I30c6bdc1a32733971a27ed1fb7db9d8239b6262b
This also lets us test the EOVERFLOW behavior, which pointed out that the
fgetpos/fsetpos return on failure has always been wrong...
Bug: http://b/24807045
Change-Id: I35273eb07c8c9155af858adb27569983397580b6
This has been requested a few times over the years. This is basically
a very late rebase of https://android-review.googlesource.com/45470
which was abandoned years ago. One addition is that this version has
_FILE_OFFSET_BITS=64 support.
POSIX puts this in <unistd.h>. glibc also has it in <fcntl.h>.
Bug: http://b/13077650
Change-Id: I5862b1dc326e326c01ad92438ecc1578d19ba739
Broke the build. There's no such file as bionic_sdk_version.h anywhere in the tree.
This reverts commit 892b61d340.
Change-Id: Iec3f4588edfb1d1524bb5f16451fd05dc6ebe44a
Posix standards says sem_wait is interruptible by the delivery
of a signal. To keep compatiblity with old apps, only fix that
in newer sdk versions.
Bug: 26743454
Change-Id: I924cbb436658e3e0f397c922d866ece99b8241a3
This test didn't catch anything, but it does ensure that we exercise
the "lots of files" case.
Bug: http://b/26747402
Change-Id: I6c51c6436029572a49190d509f131eb93b808652
We've seen it take 1146us on Nexus 9 (which did have exceptionally slow
system calls).
Bug: http://b/26724042
Change-Id: I263b7e1267d58fe4a6528403d03e5b245fdcd528
dlclose used to unmap the part of the reserved region
for ANDROID_DLEXT_RESERVED_ADDRESS that was neccessary
to map PT_LOAD segments. With this change dlclose
replaces mapped PT_LOAD segments with a PROT_NONE,
MAP_ANONYMOUS | MAP_NORESERVE.
Previously caller was unmapping the reserved region after
the failed dlclose which led to race condition when someone
else reused the region freed by dlclose but before the unmap
by the chromium code.
Bug: http://code.google.com/p/chromium/issues/detail?id=568880
Change-Id: I0f5eaa2bf6641f83dde469b631c518482acc59a2