Commit graph

887 commits

Author SHA1 Message Date
Dmitriy Ivanov
5624a6a1e5 Move pthread_atfork_dlclose test out of static lib
Bug: http://b/20858755
Change-Id: I0d84e8b43dc33902d75af18db6b7c8e0b619d718
2015-05-06 14:15:28 -07:00
Christopher Ferris
64a8698809 Modify test to avoid race condition.
automerge: 3da136a

* commit '3da136aa47e2d1608b98abb2580f024b36f92831':
  Modify test to avoid race condition.
2015-05-04 16:45:13 +00:00
Elliott Hughes
9a2744df30 Merge "Fix POSIX timer thread naming." 2015-04-25 18:01:18 +00:00
Elliott Hughes
d1aea30b2a Fix POSIX timer thread naming.
Spencer Low points out that we never actually set a name because the constant
part of the string was longer than the kernel's maximum, and the kernel
rejects long names rather than truncate.

Shorten the fixed part of the string while still keeping it meaningful. 9999
POSIX timers should be enough for any process...

Bug: https://code.google.com/p/android/issues/detail?id=170089
Change-Id: Ic05f07584c1eac160743519091a540ebbf8d7eb1
2015-04-25 10:05:24 -07:00
Dmitriy Ivanov
2c256a0f09 Merge "Unregister pthread_atfork handlers on dlclose()" 2015-04-25 05:36:07 +00:00
Dmitriy Ivanov
e91e66f223 Use bfd linker for x86/x86_64 targets
ld.gold in current toolchain for x86_64
 does not support -z global.

Change-Id: Iea2b192f0f0aa998a02adb356fd4eec4e10a1739
2015-04-24 21:05:49 -07:00
Dmitriy Ivanov
ea295f68f1 Unregister pthread_atfork handlers on dlclose()
Bug: http://b/20339788
Change-Id: I874c87faa377645fa9e0752f4fc166d81fd9ef7e
2015-04-24 17:57:37 -07:00
Dmitriy Ivanov
6612d7a347 Enable dlsym_df_1_global test for arm/arm64
Change-Id: I1fdebced93175cb14053e2239e79f97239fc2dc2
2015-04-24 16:26:03 -07:00
Dimitry Ivanov
094f58fb2a Revert "Unregister pthread_atfork handlers on dlclose()"
The visibility control in pthread_atfork.h is incorrect.
 It breaks 64bit libc.so by hiding pthread_atfork.

 This reverts commit 6df122f852.

Change-Id: I21e4b344d500c6f6de0ccb7420b916c4e233dd34
2015-04-24 03:46:57 +00:00
Dmitriy Ivanov
6df122f852 Unregister pthread_atfork handlers on dlclose()
Change-Id: I326fdf6bb06bed12743f08980b5c69d849c015b8
2015-04-22 19:19:37 -07:00
Daniel Micay
42281880a8 add fortified readlink/readlinkat implementations
Change-Id: Ia4b1824d20cad3a072b9162047492dade8576779
2015-04-17 18:49:12 -04:00
Dmitriy Ivanov
3875744f89 Merge "Support symbol versioning" 2015-04-17 03:57:46 +00:00
Dmitriy Ivanov
2a81536144 Support symbol versioning
Bug: http://b/20139821
Change-Id: I64122a0fb0960c20b2ce614161b7ab048456b681
2015-04-16 17:57:30 -07:00
Daniel Micay
e7e1c875b0 add fortified implementations of pread/pread64
Change-Id: Iec39c3917e0bc94371bd81541619392f5abe29b9
2015-04-16 10:33:35 -04:00
Dmitriy Ivanov
a40cb0ca7f Merge "Call __cxa_thread_finalize for the main thread." 2015-04-16 08:06:03 +00:00
Yabin Cui
2587c6a2f0 Merge "Change on handling of SIGEV_THREAD timers." 2015-04-16 01:08:25 +00:00
Yabin Cui
95f1ee235a Change on handling of SIGEV_THREAD timers.
1. Don't prevent calling callback when SIGEV_THREAD timers are disarmed by timer_settime.
As in POSIX standard: The effect of disarming or resetting a timer with pending
expiration notifications is unspecified. And glibc didn't prevent in this situation, so I
think it is fine to remove the support.
2. Still prevent calling callback when SIGEV_THREAD timers are deleted by timer_delete.
As in POSIX standard: The disposition of pending signals for the deleted timer is unspecified.
However, glibc handles this (although that is not perfect). And some of our tests in
time_test.cpp depend on this feature as described in b/18039727. so I retain the support.
3. Fix some flaky test in time_test.cpp, and make "time*" test pass on bionic-unit-tests-glibcxx.

Bug: 18263854

Change-Id: I8ced184eacdbfcf433fd81b0c69c38824beb8ebc
2015-04-15 17:36:01 -07:00
Dmitriy Ivanov
163ab8ba86 Call __cxa_thread_finalize for the main thread.
Bug: http://b/20231984
Bug: http://b/16696563
Change-Id: I71cfddd0d404d1d4a593ec8d3bca9741de8cb90f
2015-04-15 16:24:21 -07:00
Dmitriy Ivanov
66aa0b61f7 Hide emutls* symbols in libc.so
Also make thread_local in test static to avoid ld.bfd
 warning for arm64.

Change-Id: I09a3f2aa9b73a4fafa3f3bbc64ddc2a128ad50ee
2015-04-15 14:23:00 -07:00
Yabin Cui
8f3f04184a Merge "Prevent using static-allocated pthread keys before creation." 2015-04-14 20:35:08 +00:00
Yabin Cui
5ddbb3f936 Prevent using static-allocated pthread keys before creation.
Bug: 19993460

Change-Id: I244dea7f5df3c8384f88aa48d635348fafc9cbaf
2015-04-14 13:32:09 -07:00
Dmitriy Ivanov
de88974120 Merge "Fix dl* tests to run-on-host" 2015-04-11 00:28:05 +00:00
Dmitriy Ivanov
ef25592f14 Fix dl* tests to run-on-host
Bug: http://b/20121152
Change-Id: I1e1f41d885c75dbb26f91565a53a15d62ef72ce6
2015-04-09 14:56:26 -07:00
Yabin Cui
9f2c2f53d3 Merge "Provide writer preference option in rwlock." 2015-04-09 17:19:44 +00:00
Yabin Cui
76615dae93 Provide writer preference option in rwlock.
Previous implementation of rwlock contains four atomic variables, which
is hard to maintain and change. So I make following changes in this CL:

1. Add pending flags in rwlock.state, so we don't need to synchronize
between different atomic variables. Using compare_and_swap operations
on rwlock.state is enough for all state change.

2. Add pending_lock to protect readers/writers waiting and wake up
operations. As waiting/wakeup is not performance critical, using a
lock is easier to maintain.

3. Add writer preference option.

4. Add unit tests for rwlock.

Bug: 19109156

Change-Id: Idcaa58d695ea401d64445610b465ac5cff23ec7c
2015-04-08 13:11:13 -07:00
Dmitriy Ivanov
1dce3ed249 Fix x86_64 build
Change-Id: Id81c059bf3ecdb9cc84d04d16ffda34baaadc5a1
2015-04-06 19:05:58 -07:00
Dmitriy Ivanov
8a1007dbab Merge "Add realpath for soinfo" 2015-04-07 00:14:57 +00:00
Dmitriy Ivanov
aae859cc3c Add realpath for soinfo
This change adds realpath to soinfo and
  extends limit on filenames from 128 to PATH_MAX.

  It also removes soinfo::name field, linker uses
  dt_soname instead.

Bug: http://b/19818481
Bug: https://code.google.com/p/android/issues/detail?id=80336
Change-Id: I9cff4cb5bda3ee2bc74e1bbded9594ea7fbe2a08
2015-04-06 21:15:43 +00:00
Elliott Hughes
67de2593b3 Merge "Add a test for getdelim(3) on a directory." 2015-04-06 19:36:13 +00:00
Elliott Hughes
694fd2d880 Add a test for getdelim(3) on a directory.
Apparently uClibc has a bug here. We don't, but let's keep it that way.

Bug: http://landley.net/notes.html#21-03-2015
Change-Id: If406df963db9bee47921d7a1c116ebcab08d96bf
2015-04-05 10:51:56 -07:00
Yabin Cui
4bd8f9637d Merge "Fix bug for recursive/errorcheck mutex on 32-bit devices." 2015-04-04 19:31:55 +00:00
Yabin Cui
f796985923 Fix bug for recursive/errorcheck mutex on 32-bit devices.
Bug: 19216648
Change-Id: I3b43b2d18d25b9bde352da1e35f9568133dec7cf
2015-04-03 19:01:17 -07:00
Dmitriy Ivanov
45c57131d2 Add libdl dependency for target libraries
Fixed x86_64 target build with gcc 4.9

Change-Id: Id3b1e9286c2bcbb8e3ac117bcef957304db7cfd3
2015-04-03 15:17:52 -07:00
Dmitriy Ivanov
aea165cb03 Merge "Add ANDROID_DLEXT_FORCE_LOAD flag" 2015-04-03 19:45:24 +00:00
Dmitriy Ivanov
9b82136b98 Add ANDROID_DLEXT_FORCE_LOAD flag
This flag allows to force loading of the library
  in the case when for some reason multiple ELF files
  share the same filename (because the already-loaded
  library has been removed and overwritten, for example).

Change-Id: I798d44409ee13d63eaa75d685e99c4d028d2b0c1
2015-04-03 10:50:48 -07:00
Dmitriy Ivanov
06b6e3c51d Merge "Look into local group on dlsym with RTLD_DEFAULT" 2015-04-02 21:55:01 +00:00
Dmitriy Ivanov
76ac1acdac Look into local group on dlsym with RTLD_DEFAULT
Fix dlsym to look into local group when called with
  RTLD_DEFAULT and RTLD_NEXT.

Bug: 17512583
Change-Id: I541354e89539c712af2ea4ec751e546913027084
2015-04-02 14:12:45 -07:00
Yabin Cui
00d1101cc1 Merge "Refactor pthread_mutex to support 32-bit owner_tid on 64-bit devices." 2015-04-02 20:27:40 +00:00
Christopher Ferris
618935d267 Merge "gtest_repeat should allow negative values." 2015-04-02 19:19:38 +00:00
Christopher Ferris
119cb55d43 gtest_repeat should allow negative values.
If you pass in a negative value to gtest_repeat, it should run forever.
The new runner didn't allow this, now it does.

Change-Id: Ie0002c12e2fdad22b264adca37c165cfcfe05c7a
2015-04-02 12:16:00 -07:00
Yabin Cui
e69c24543d Refactor pthread_mutex to support 32-bit owner_tid on 64-bit devices.
Bug: 19216648
Change-Id: I765ecacc9036659c766f5d1f6600e1a65364199b
2015-04-01 21:12:22 -07:00
Elliott Hughes
0ad256c1b2 Fix ftw tests when run as non-root.
Root can create subdirectories inside non-writable directories, but
other users can't.

Change-Id: I102fe610d1bd2733aebf184b544e58612465287d
2015-04-01 12:22:40 -07:00
Elliott Hughes
6170693e28 Make ThreadLocalBuffer a class rather than a macro.
Bug: 19995392
Change-Id: I497c512648fbe66257da3fb3bcd5c9911f983705
2015-03-31 10:56:58 -07:00
Dmitriy Ivanov
947adedebc Add test for thread_local keyword.
For gcc only for the time being.

Bug: 19800080
Bug: 16696563
Change-Id: Ifaa59a131ca2d9030554cee7ce631dcb1d081938
2015-03-27 12:05:36 -07:00
Yabin Cui
8f3eb5a4e5 Merge "Revert "Cause Fatal error when invalid pthread_id is detected."" 2015-03-26 18:14:23 +00:00
Yabin Cui
220b99bdc1 Revert "Cause Fatal error when invalid pthread_id is detected."
Some code like in https://buganizer.corp.google.com/u/0/issues/19942911 need to change first.

This reverts commit 03324780aa.

Change-Id: I13ff1e5b3d0672bae9cde234ffba32fbbf33d338
2015-03-26 18:13:07 +00:00
Dmitriy Ivanov
f2d153f836 Merge "Initial implementation of __cxa_thread_atexit_impl" 2015-03-26 17:50:23 +00:00
Dmitriy Ivanov
df79c330d8 Initial implementation of __cxa_thread_atexit_impl
This is initial implementations; does not yet handle
  dlclose - undefined behavior, needs linker support to
  handle it right.

Bug: 19800080
Bug: 16696563
Change-Id: I7a3e21ed7f7ec01e62ea1b7cb2ab253590ea0686
2015-03-25 18:07:59 -07:00
Yabin Cui
17393b06ba Hide internal of pthread_mutex_t.
Bug: 19249079
Change-Id: Iffb79c8d861b698d474f212dc80c638fc2cf1620
2015-03-25 17:54:17 -07:00
Yabin Cui
03324780aa Cause Fatal error when invalid pthread_id is detected.
This is a patch testing whether we can use abort() instead of
returning ESRCH for invalid pthread ids. It is an intermediate
step to remove g_thread_list/g_thread_list_lock.

Bug: 19636317
Change-Id: Idd8e4a346c7ce91e1be0c2ebcb78ce51c0d0a31d
2015-03-25 15:30:39 -07:00