Commit graph

716 commits

Author SHA1 Message Date
Yabin Cui
385c07a74c Merge "Fix parse of gtest_filter in bionic gtest main." 2015-01-27 22:00:35 +00:00
Yabin Cui
0bc4e9697e Fix parse of gtest_filter in bionic gtest main.
Bug: 19130330
Change-Id: Id6a60570a8aab6ae7259ff228b3801285b378f77
2015-01-27 11:22:46 -08:00
Elliott Hughes
acc06a0b74 Merge "Add a test for float registers across setjmp/logjmp." 2015-01-27 19:08:33 +00:00
Yabin Cui
4a82ede754 Rename "TIMEWARN" to "SLOW" in bionic gtest.
Bug: 19109188.
Change-Id: Idfe769ac652bf37642da24e4abb6061ca861d57e
2015-01-26 20:56:20 -08:00
Elliott Hughes
87dd503018 Add a test for float registers across setjmp/logjmp.
Change-Id: I17cc056b185755e0b91de096b5ceefee4f4e0b3a
2015-01-26 20:52:34 -08:00
Yabin Cui
0e6af17a35 Merge "Support --gtest_ouput option in bionic gtest main." 2015-01-27 01:01:05 +00:00
Yabin Cui
657b1f9bef Support --gtest_ouput option in bionic gtest main.
Bug: 19109500
Change-Id: Ib18f90ad522e66ea62dd4e02e314585d9b36e15f
2015-01-26 16:53:05 -08:00
Elliott Hughes
247cfe0382 Merge "Add <error.h>." 2015-01-26 20:38:46 +00:00
Elliott Hughes
b8a8cf0d1a Add <error.h>.
Bug: https://code.google.com/p/android/issues/detail?id=79170
Change-Id: Id91765fac45124545e2674a5b2c814707c1a448b
2015-01-26 11:57:11 -08:00
Elliott Hughes
14152b9f31 Remove obsolete BUILD_TINY_ANDROID.
Change-Id: If2fc97134340fd09ec2583b666ace2f673cbdf66
2015-01-24 19:01:58 -08:00
Elliott Hughes
e6bb5a2776 Fix optimized fread.
gcov does writes after reads on the same stream, but the bulk read optimization
was clobbering the FILE _flags, causing fwrite to fail.

Bug: 19129055
Change-Id: I9650cb7de4bb173a706b502406266ed0d2b654d7
2015-01-24 12:35:41 -08:00
Dmitriy Ivanov
31005ca4c8 Merge "Minimize calls to mprotect" 2015-01-24 00:45:25 +00:00
Dmitriy Ivanov
279a22f96e Minimize calls to mprotect
Implement refcounter based data protection guard
  to avoid unnecessary calls to mprotect when dlopen/dlclose
  is called from a constructor.

Bug: 19124318
Big: 7941716
Change-Id: Id221b84ce75443094f99756dc9950b0a1dc87222
2015-01-23 16:30:34 -08:00
Dan Albert
4ce907d2ce Allow make to set a timeout for the host tests.
Change-Id: Icc2ebf64bd1da1687bf313fe7a5640155c5795d8
2015-01-23 11:35:48 -08:00
Elliott Hughes
62284dd2cc There's no such thing as LOCAL_CXXFLAGS.
Change-Id: Iad70e6bd4cb7cec9e0ece500a540e4dadc83d92e
2015-01-22 15:36:24 -08:00
Elliott Hughes
0ed7e08cda Fix the stdio.fread_EOF test.
Another sizeof/strlen screwup caused by trying to be too clever. Use
std::string instead.

Also fix all the ASSERT_STREQ calls in this file that had the arguments
the right^Wwrong way round. If I ever see Kent Beck...

Change-Id: I47a1bdfee99cf4e7bed9b398f3158a308fbcf1e8
2015-01-22 15:28:48 -08:00
Elliott Hughes
bcb378d643 Fix fread_EOF test name.
Change-Id: I53a7f1428fd27c0b2a5c80f2e8af4845d17f5b4b
2015-01-22 14:18:35 -08:00
Elliott Hughes
8c4994bbc1 Implement __fsetlocking.
The old __isthreaded hack was never very useful on Android because all user
code runs in a VM where there are lots of threads running. But __fsetlocking
lets a caller say "I'll worry about the locking for this FILE*", which is
useful for the normal case where you don't share a FILE* between threads
so you don't need any locking.

Bug: 17154740
Bug: 18593728
Change-Id: I2a8dddc29d3edff39a3d7d793387f2253608a68d
2015-01-21 10:33:30 -08:00
Elliott Hughes
c053a42831 Merge "Optimized fread." 2015-01-21 00:11:31 +00:00
Elliott Hughes
75b99387dd Optimized fread.
This makes us competitive with glibc for fully-buffered and unbuffered reads,
except in single-threaded situations where glibc avoids locking, but since
we're never really single-threaded anyway, that isn't a priority.

Bug: 18593728
Change-Id: Ib776bfba422ccf46209581fc0dc54f3567645b8f
2015-01-20 15:59:17 -08:00
Yabin Cui
516eb53113 Remove testcase time printing in bionic-unit-tests.
Bug: 19075565
Change-Id: Icccb60657a2985e96abb1703673f0ebe2199586a
2015-01-20 14:46:03 -08:00
Yabin Cui
6104eb9fa7 Add target libbionic_gtest_main for cts test.
Bug: 17589740
Change-Id: I37f2d3fe72870b9dc867407fa1619c9a6fcd5cbb
2015-01-20 14:32:07 -08:00
Elliott Hughes
1d7b3f3ccc Merge "Improve <stdio_ext.h> testing." 2015-01-20 18:07:37 +00:00
Elliott Hughes
df8f1a42d1 Improve <stdio_ext.h> testing.
I almost fixed a non-bug. Add a test to prevent me from doing that.

Change-Id: I4a1dc13e603a7a377bdaee2e78132015087f7107
2015-01-16 16:40:55 -08:00
Yabin Cui
cfe7e75fc1 Merge "Make sys_resource test more robust." 2015-01-16 21:52:11 +00:00
Yabin Cui
4853f40f3f Make sys_resource test more robust.
"ulimit -c xxx" command may run before bionic-unit-tests.
Make sure sys_resource test fails gently in that case.

Change-Id: Ic3b5ed8b20acba56df8c5ef082c88e5050e761aa
2015-01-16 13:28:43 -08:00
Yabin Cui
19e246dda6 Fix possible leak in pthread_detach.
If pthread_detach() is called while the thread is in pthread_exit(),
it takes the risk that no one can free the pthread_internal_t.
So I add PTHREAD_ATTR_FLAG_ZOMBIE to detect this, maybe very rare, but
both glibc and netbsd libpthread have similar function.

Change-Id: Iaa15f651903b8ca07aaa7bd4de46ff14a2f93835
2015-01-15 10:45:25 -08:00
Yabin Cui
deab11acd7 Merge "Make bionic-unit-tests default run isolate mode." 2015-01-15 18:10:30 +00:00
Yabin Cui
a35cd8cdc2 Test that ip6-localhost exists in etc/hosts.
Addition change: make netdb_test pass on host.

Bug: 18791191
Change-Id: I7a9e29aa559ff6557288b47323d8a436379201a2
2015-01-13 17:30:51 -08:00
Yabin Cui
be837360c3 Make bionic-unit-tests default run isolate mode.
Fix bug of handling signal terminated tests.

Bug: 17589740
Bug: 18951146
Change-Id: I4803382b26cd5454693090202b3ba38e3dbe66e5
2015-01-08 20:34:58 -08:00
Elliott Hughes
c62a4b5a7a Fix freeaddrinfo(NULL).
Bug: https://code.google.com/p/android/issues/detail?id=13228
Change-Id: I5e3b126d90d750a93ac0b8872198e50ba047e603
2015-01-08 17:28:46 -08:00
Yabin Cui
917d390510 Make pthread stack size match real range.
Bug: 18908062
Change-Id: I7037ac8273ebe54dd19b1561c7a376819049124c
2015-01-08 14:27:24 -08:00
Dmitriy Ivanov
bfa15e464e Set linux 32bit personality for 32 bit processes
Bug: 18069809
Change-Id: Ie143d56b0f8f03510dc451649291067e1add1d2f
2015-01-07 16:32:05 -08:00
Yabin Cui
597800f1d7 Merge "better gtest runner for bionic" 2015-01-02 22:38:41 +00:00
Yabin Cui
541b0b187d Merge "Reserve enough user request stack space in pthread_create." 2015-01-02 22:37:56 +00:00
Yabin Cui
6a7aaf4675 Reserve enough user request stack space in pthread_create.
Bug: 18830897
Change-Id: I1ba4aaeaf66a7ff99c5d82ad45469011171b0a3b
2015-01-02 14:33:48 -08:00
Elliott Hughes
ba09edcb41 Merge "Fix nan output in the printf family." 2014-12-21 02:54:06 +00:00
Elliott Hughes
1b18aff9ba Fix nan output in the printf family.
Bug: https://code.google.com/p/android/issues/detail?id=82452
Change-Id: I51f226c8b033de6e81baeea5e6db3de6ed196f73
2014-12-20 18:53:08 -08:00
Yabin Cui
370a3e573d Merge "Sync with upstream for gethnamaddr.c." 2014-12-18 01:06:10 +00:00
Yabin Cui
58d33a51f3 Sync with upstream for gethnamaddr.c.
Bug: 18566967
Change-Id: I37e7410226b49eec67614e20b2c1d5e3e47817a5
2014-12-17 16:19:27 -08:00
Dmitriy Ivanov
92b9cb2c89 Merge "Add another test for weak-reference" 2014-12-16 22:01:47 +00:00
Dmitriy Ivanov
bfa88bca5c Add another test for weak-reference
This one covers undefined weak reference in .so
  referenced via JUMP_SLOT relocation.

Bug: 17526061
Change-Id: Ib8764bd30c1f686c4818ebbc6683cf42dee908b2
2014-12-16 19:46:45 +00:00
Yabin Cui
294d1e2c9e better gtest runner for bionic
1. option to run each test in a separate forked process: "--isolate".
2. warnings about slow tests: "--warnline".
3. run multiple tests at the same time: "-j N".

Bug: 17589740
Change-Id: Ife5f4cafec43aa051ad7bd9c9b2b7e2e437db0de
2014-12-13 18:53:34 -08:00
Yabin Cui
6c238f2926 Fix pthread key num calculation.
Bug: 18723085
Change-Id: Iba2c834b350e4cdba0b2d771b221560a3e5df952
2014-12-12 17:00:08 -08:00
Yabin Cui
562ae1e6e4 make stack_protector_DeathTest work for gcc4.9
Bug: 18721888
Change-Id: I5f0b5c84319f56dbc4efb88e9d828138944667ae
2014-12-11 17:24:55 -08:00
Elliott Hughes
1510a1c1ae Fix the setjmp tests for mips.
Although the LP32 mips sigset_t is large enough to represent all signals,
their jmp_buf is too small. This test succeeded on arm and x86 because the
RT signals were never in the 'expected' sigset_t, so the equality comparison
with the 'actual' sigset_t worked fine --- everyone was blind to the RT
signal. On mips the tests fail because the 'expected' sigset_t does contain
the RT signal but the 'actual' doesn't because the jmp_buf only saves and
restores the first 32 signals.

There are 32 free bits (currently used as padding) in the LP32 mips jmp_buf,
and they might choose to use those to provide better support than the other
two platforms, but I'll leave that to them. It will be easy to just remove
the #if defined(__LP64__) from this change in that case.

For mips64 it's not to late to increase the size of the jmp_buf and fix
the setjmp family, but since there are decisions to be made here for LP32,
I'll leave it all to Imagination folks...

Bug: 16918359
Change-Id: I6b723712fce0e9210dafa165d8599d950b2d3500
2014-12-10 11:48:19 -08:00
Yabin Cui
94926f8cfa Merge "support _POSIX_REALTIME_SIGNALS" 2014-12-09 20:10:19 +00:00
Yabin Cui
b033761cbf Merge "Change _POSIX_CPUTIME macro to make it compitable with glibc." 2014-12-09 17:51:37 +00:00
Yabin Cui
725756045e Change _POSIX_CPUTIME macro to make it compitable with glibc.
Change-Id: I7a8dbb74bd622693c9fef60bd779687207517b7d
2014-12-09 09:16:11 -08:00
Yabin Cui
634816055f support _POSIX_REALTIME_SIGNALS
Bug: 18489947
Change-Id: I2e834d68bc10ca5fc7ebde047b517a3074179475
2014-12-08 21:52:43 -08:00