Commit graph

17160 commits

Author SHA1 Message Date
Christopher Ferris
6e45d37dec Add unwind information for r7 in arm syscalls.
It turns out that clang can emit code where the sp is saved in the r7
register on arm. Unfortunately, a lot of our syscalls overwrite that
value while the syscall is executing, so unwinding through that syscall
fails.

Update the syscall generation code to add unwinding information for
these uses.

Bug: 28411713
Change-Id: Id51a5d43c058631bb50834527f93fa299bbcf759
2016-04-27 18:31:02 -07:00
Neil Fuller
f3158b94ab Update timezone data to 2016d
Changes affecting future time stamps

    America/Caracas switches from -0430 to -04 on 2016-05-01 at 02:30.
    (Thanks to Alexander Krivenyshev for the heads-up.)

    Asia/Magadan switches from +10 to +11 on 2016-04-24 at 02:00.
    (Thanks to Alexander Krivenyshev and Matt Johnson.)

    New zone Asia/Tomsk, split off from Asia/Novosibirsk. It covers
    Tomsk Oblast, Russia, which switches from +06 to +07 on 2016-05-29
    at 02:00.  (Thanks to Stepan Golosunov.)

  Changes affecting past time stamps

    New zone Europe/Kirov, split off from Europe/Volgograd.  It covers
    Kirov Oblast, Russia, which switched from +04/+05 to +03/+04 on
    1989-03-26 at 02:00, roughly a year after Europe/Volgograd made
    the same change.  (Thanks to Stepan Golosunov.)

    Russia and nearby locations had daylight-saving transitions on
    1992-03-29 at 02:00 and 1992-09-27 at 03:00, instead of on
    1992-03-28 at 23:00 and 1992-09-26 at 23:00.  (Thanks to Stepan
    Golosunov.)

    Many corrections to historical time in Kazakhstan from 1991
    through 2005.  (Thanks to Stepan Golosunov.)  Replace Kazakhstan's
    invented time zone abbreviations with numeric abbreviations.

Bug: 28240832
Change-Id: If11e29f064f074f8b5812d397996322d007ab1d2
2016-04-21 15:06:48 +01:00
Pierre Imai
21bf063727 DO NOT MERGE Add new info functions to resolver for use by Netd.
android_net_res_stats_get_info_for_net returns the current name servers, search
domains, parameters and stats for the given network ID.

android_net_res_stats_aggregate provides statistics such as errors counts from
the raw stats data reported by android_net_res_stats_get_info_for_net.

android_net_res_stats_get_usable_servers uses the data returned by
android_net_res_stats_aggregate to determine which of the servers are
considered valid or broken by the resolver.

BUG: 25731675
Change-Id: I6059b68e5e8b809027a4d3135f6081588bee8a7d
2016-04-21 14:25:10 +09:00
Pierre Imai
589afca92c DO NOT MERGE Store DNS server count in resolv_cache.
Instead of keeping a sentinel after nameservers[], nsaddrinfo[] and
nstats[], store the server count in the structure, freeing up memory and
eliminating the need to enumerate the server count every time
_resolv_is_nameservers_equal_locked() is invoked.

Also increase MAXNS from 3 to 4.

BUG: 28153323
Change-Id: I11a7257af695157c9e32019cd00c67b535b63c75
(cherry picked from commit fff356786f)
2016-04-21 14:16:01 +09:00
Christopher Ferris
7a0224a66b Change pointer to allocation in unit tests.
I changed the output from "pointer" to "allocation" for allocation
mismatches. I forgot to update the tests.

Bug: 28218530

(cherry picked from commit 97fd7d95f5)

Change-Id: I4076e4ddb5d2385e786e3ebca187d1e84e3c172c
2016-04-20 17:51:45 -07:00
Christopher Ferris
2b876a6307 Add malloc debug documentation.
Bug: 27902359
Bug: 28218530

(cherry picked from commit 713a8e36f8)

Change-Id: I63c0cc53287d414ae6accd03c191f3474c02fc82
2016-04-19 11:04:00 -07:00
Christopher Ferris
258abf70f9 Small fixes to malloc debug.
- Change the printed name from pointer to allocation to be explicit about
  what is wrong.
- Change the signal to be SIGRTMAX - 19 instead of SIGRTMIN. This should
  prevent problems if we have to reserve other real time signals.

Bug: 28218530

(cherry picked from commit ea26b33248)

Change-Id: I707d5200c1804bdbf45fc46de0f2565016c48a82
2016-04-18 17:20:09 -07:00
Neil Fuller
28a63edc68 Update timezone data to 2016c
Changes affecting future time stamps

    Azerbaijan no longer observes DST.  (Thanks to Steffen Thorsen.)

    Chile reverts from permanent to seasonal DST.  (Thanks to Juan
    Correa for the heads-up, and to Tim Parenti for corrections.)
    Guess that future transitions are August's and May's second
    Saturdays at 24:00 mainland time.  Also, call the period from
    2014-09-07 through 2016-05-14 daylight saving time instead of
    standard time, as that seems more appropriate now.

  Changes affecting past time stamps

    Europe/Kaliningrad and Europe/Vilnius changed from +03/+04 to
    +02/+03 on 1989-03-26, not 1991-03-31.  Europe/Volgograd changed
    from +04/+05 to +03/+04 on 1988-03-27, not 1989-03-26.
    (Thanks to Stepan Golosunov.)

Bug: 27826144
Change-Id: I4353fa075e6cc0f277a72c928442a63835ec4d97
2016-04-18 09:21:42 +01:00
Neil Fuller
7718dd5c18 Merge "Update timezone data to 2016b" into nyc-dev 2016-04-18 08:09:57 +00:00
Dimitry Ivanov
ff8cd0e712 Revert "Temporary move __udivdi3 back to LIBC for x86"
This reverts commit bc02fb964a.

Bug: http://b/26406724
Bug: http://b/26423217
Change-Id: I8e3186fc76502d6818753e5d76a7c145207ed9a3
(cherry picked from commit 9f39326a74)
2016-04-15 18:31:16 -07:00
Dimitry Ivanov
0551c1d47b Remove dangling links in secondary namespaces
linker didn't remove link to the soinfo from shared
namespaces on soinfo_unload, because it didn't keep
record of all namespaces the library is added to.

This change adds test for this and also fixes the
problem by introducing list of secondary namespaces
to soinfo, which is used to remove soinfo in
soinfo::remove_all_links().

Bug: http://b/28115950
Change-Id: Ifbf6e54f92fa6e88f86b6a8dd6dc22d4553afd22
(cherry picked from commit aca299ac47)
2016-04-14 12:51:55 -07:00
Dimitry Ivanov
7095da8d3c Move linker-namespace functions to LIBC_PLATFORM
Bug: http://b/28174921
Change-Id: I089dbeeea813fc2128b9c2f6268a578d23a1954a
2016-04-13 15:01:37 -07:00
Dimitry Ivanov
79abce4214 linker: unload RTLD_NODELETE libraries when loading fails
Linker was not unloading libraries marked with RTLD_NODELETE
even when there was a error on load. For example when one of
dt_needed libraries was not found.

Bug: http://b/27911891
Change-Id: Ibc0bf110aa41fbfdc9f327ad8c364f2e3600af71
2016-04-13 11:46:59 -07:00
Dimitry Ivanov
8e3a3fb4f2 Add libgui.so to the grey-list
Bug: http://b/28151000
Change-Id: I7ba8f78df7dbf32de4839cc5a95ef10e8444715c
2016-04-12 14:53:06 -07:00
Dimitry Ivanov
5981d5beaf Add libexpat.so to the grey-list
Bug: http://b/28071598
Change-Id: I5545a06edfd8e0ab5b011392860ddccd6c04677f
2016-04-08 09:49:07 -07:00
Pierre Imai
e4e4e9da72 DO NOT MERGE: Reduce the amount of logging in Bionic's resolver.
Change-Id: I3b7b5ef5a5ee6ba3ad8654f792400d42d5ecd4b9
2016-04-06 11:30:02 +09:00
Pierre Imai
8b50d08e82 DO NOT MERGE: Fix off-by-one error in res_cache.c
(cherry picked from commit 03844d8cdb)

Change-Id: Ib5fff46ac9211716a1577ee25bb22461c489ea9f
2016-04-06 10:44:00 +09:00
Pierre Imai
4d8e740b08 DO NOT MERGE: Ignore unreliable DNS servers.
Collect statistics about DNS query success state and delay. Ignore
servers that have been tried at least five times and have a success rate
of < 0.25. Retry these servers once every 180s.

Bug: 25731675

(cherry picked from commit 6b3f0d65f2)

Change-Id: Id989404b14fd885fb31a5a4de36a4186be1c9ad1
2016-04-06 10:41:07 +09:00
Elliott Hughes
6f90c1ac59 Fix the stack-protector test for x86/x86-64.
Built for fugu this was working fine, but built for generic x86/x86-64
the compiler was (a) optimizing out all the stack writes and (b) inserting
enough padding on x86-64 for the canary to be safely out of the way.

While here, let's tighten up this test so we test that it's sufficient to
only overwrite the buffer by one byte...

Bug: http://b/27815668
Change-Id: I80a646de4b30fd5c78df20fdaa7e3eb163585caf
2016-04-01 14:58:40 -07:00
Elliott Hughes
38b88a4a64 Use consistent quoting in linker messages.
Using single quotes can be more convenient -- because there's no need to
escape -- but the vast majority of existing quoting was done with double
quotes, so move in that direction.

Bug: http://b/27524191
Change-Id: I8f58593120e4c8aeaec45e16fc0178e9c162454d
2016-04-01 10:10:54 -07:00
Yabin Cui
78a3d39aa9 Merge "CloseArchive() to free memory when OpenArchive fails." into nyc-dev 2016-03-30 19:29:21 +00:00
Yabin Cui
b3ee859bbd CloseArchive() to free memory when OpenArchive fails.
Bug: 26962895
Change-Id: I42418eee320ddae857b42572690316c53f638e85
(cherry picked from commit 722072d65a)
2016-03-30 11:20:04 -07:00
Pierre Imai
9b331089db Merge "Copy the entire zero-separated DNS seach domain string." into nyc-dev 2016-03-30 07:38:26 +00:00
Yabin Cui
26e33ec1b9 Merge "Fix test getauxval.arm_has_AT_HWCAP2." into nyc-dev 2016-03-30 01:24:13 +00:00
Josh Gao
89c41d68ed Add a checksum to jmp_buf on x86_64.
Bug: http://b/27856501
Bug: http://b/27417786
Change-Id: I541f5a7ce4972ef56b3f69e73927ca7df362609a
(cherry picked from commit 686e5f6f69)
2016-03-29 18:07:32 -07:00
Josh Gao
95e789a307 Delete lies from x86_64 setjmp implementation.
Previously, the implementation of setjmp on x86_64 claimed that
sigprocmask would write to two longs' worth of bytes.

Bug: http://b/27856501
Change-Id: I9f32b40ac773a0cd91a976aace5bfba6e67fb0f8
(cherry picked from commit c244fcb8a3)
2016-03-29 18:07:32 -07:00
Josh Gao
7af64bd083 Add a checksum to jmp_buf on x86.
Bug: http://b/27856501
Bug: http://b/27417786
Change-Id: Id5a0a81fc38e311bff678cbc7dc2219bc0074503
(cherry picked from commit 9260785393)
2016-03-29 18:07:32 -07:00
Yabin Cui
dbf6f82e87 Fix test getauxval.arm_has_AT_HWCAP2.
Bug: 27874785
Change-Id: Ibb39087c5353a0cca7783d39498b370e478fe91c
(cherry picked from commit 78f5eb0498)
2016-03-29 16:51:47 -07:00
Mingwei Shi
9ce09e423f libc: implement kernel vdso syscalls for i386
This patch uses __kernel_vsyscall instead of "int 0x80"
as the syscall entry point. AT_SYSINFO points to
an adapter to mask the arch specific difference and gives a
performance boost on i386 architecture.

Bug: http://b/27533895
Change-ID: Ib340c604d02c6c25714a95793737e3cfdc3fc5d7
Signed-off-by: Mingwei Shi <mingwei.shi@intel.com>

(cherry picked from commit be91052932)
2016-03-29 08:46:32 -07:00
Pierre Imai
9db1f3efa8 Copy the entire zero-separated DNS seach domain string.
The DNS search string contains zeros as domain separator. The resolver
code erroneously used strlcpy(), which resulted in only the first domain
to be copied. The code uses pointers into this string to access the
individual domains. Since the structure is zero-initialized, this bug only
resulted in zero-length domains instead of accessing unitialized memory.

BUG: 27312811
Change-Id: Ia9d066c405dfcc5e82d6766d93ead2ce574e7b0d
(cherry picked from commit 0967fc7e59)
2016-03-29 12:29:24 +09:00
Dimitry Ivanov
79e9228224 Merge "linker: hide the pointer to soinfo" into nyc-dev 2016-03-28 23:36:40 +00:00
Dimitry Ivanov
cba377acac Merge changes Idd0fb06a,Ia17dd540,I96c6592a,I0eacb3f0,I8e2895ec, ... into nyc-dev
* changes:
  Do not add linker the _r_debug.r_map on link_image
  Improvements to dynamic linker messages
  Move gdb support functions to a separate file
  Use insert_link_map_into_debug_map for executable
  Update a comment for init_linker_info_for_gdb
  Initialize linker link_map for gdb directly
2016-03-28 22:39:39 +00:00
Dimitry Ivanov
ae74e8750b linker: hide the pointer to soinfo
Handle no longer is a pointer to soinfo of
a corresponding library. This is done to
prevent access to linker internal fields.

Bug: http://b/25593965
Change-Id: I62bff0d0e5b2dc842e6bf0babb30fcc4c000be24
(cherry picked from commit d88e1f3501)
2016-03-28 15:33:07 -07:00
Dimitry Ivanov
9acb3b747c Do not add linker the _r_debug.r_map on link_image
Bug: http://b/27533895
Change-Id: Idd0fb06a5d9f400c0608ae532cc4c575211810fa
(cherry picked from commit e97d8ed70e)
2016-03-28 14:06:20 -07:00
Dimitry Ivanov
b6ac9aa6f7 Improvements to dynamic linker messages
Error messages now include executable name,
also linker doesn't abort if called on itself.

Bug: http://b/27533895
Change-Id: Ia17dd540919544b28062ed71751a1d79ee865206
(cherry picked from commit 9f0a6954c6)
2016-03-28 14:06:14 -07:00
Dimitry Ivanov
ed70f6a2a0 Move gdb support functions to a separate file
Move gdb support functions and variables to
linker_gdb_support.h/cpp

Bug: http://b/27533895
Change-Id: I96c6592a7055715b18f1137367470fe80987263f
(cherry picked from commit 6b788eeff2)
2016-03-28 14:06:09 -07:00
Dimitry Ivanov
0f478e8b44 Use insert_link_map_into_debug_map for executable
Use insert_link_map_into_debug_map to insert the main
executable's link_map to r_debug

Bug: http://b/27533895
Change-Id: I0eacb3f030ea3eb16ed50ad2011d604beece2d03
(cherry picked from commit f3064e4bc7)
2016-03-28 14:06:03 -07:00
Dimitry Ivanov
fefb4d3dcd Update a comment for init_linker_info_for_gdb
Bug: http://b/27533895
Change-Id: I8e2895ecfcc6f77a180c3735342afc93be5923d3
(cherry picked from commit 6400129628)
2016-03-28 14:05:55 -07:00
Dimitry Ivanov
05b60b24d9 Initialize linker link_map for gdb directly
Remove unnecessary construction of soinfo when
initializing linker link_map for gdb.

Bug: http://b/27533895
Change-Id: Idf32cee56309aa9c9cf260efbd17a9deae9a756b
(cherry picked from commit 8d22dd53fe)
2016-03-28 14:05:38 -07:00
Elliott Hughes
5ca2bddae3 Don't bother insisting on AT_HWCAP2 for 32-bit devices.
Bug: http://b/27874785

(cherry picked from commit 900a4dc5a8)

Change-Id: Ia8c3543c51861030b33f8a4e0c0b88d7cca6e11e
2016-03-28 12:34:41 -07:00
Yabin Cui
0eed2827ed Fix pthread.pthread_barrier_smoke test.
pthread_barrier_smoke test uses WaitUntilThreadSleep() to wait until
BarrierTestHelper threads sleep in pthread_barrier_wait(). But this
is flaky as there a two futex_wait places in pthread_barrier_wait.
This patch modifies this test to avoid using WaitUntilThreadSleep().

Bug: 27780937
Bug: 27811377
Change-Id: I4c36b82cce9345d5088f8854b289dc5bf7a08e8c
(cherry picked from commit 81d2797e33)
2016-03-26 13:53:35 -07:00
Colin Cross
3b012b0cf3 Merge "Update Android.bp to match Android.mk" into nyc-dev 2016-03-25 19:54:27 +00:00
Elliott Hughes
2c7fdeb61c Fix the AT_HWCAP2 test.
"I have none of these capabilities" is a legitimate response, and
distinct from "I don't know what my capabilities are". It's the latter
I meant to test for.

Bug: http://b/27810985

(cherry picked from commit d4c9112490)

Change-Id: I4093948039a658e926e9b5e28d19b1344c70bd0e
2016-03-25 10:32:57 -07:00
Yabin Cui
ec9b56ee2e Adjust test to let it pass on libhoudini.
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.

(cherry picked from commit 61e4d461e5)

Bug: http://b/27815309
Change-Id: Ic714a8e633a0bb6e85b38ee0e01e3439d0a0cea5
2016-03-24 16:28:21 -07:00
Colin Cross
05545f5c8f Update Android.bp to match Android.mk
Change-Id: Ib5bbe66a398734b6db9a40d51f2849d1531853ef
2016-03-24 13:41:30 -07:00
Neil Fuller
11c7930488 Revert "Update timezone data to 2016b"
The bionic change merged down from upstream but the
external/icu one didn't.
A replacement change will be submitted along with one for
external/icu.

This reverts commit 7bcee86edc.

Change-Id: I0dd28e02231e6ebba5b61131b22889a1268a0675
2016-03-24 15:23:45 +00:00
Neil Fuller
4fc72e0230 Update timezone data to 2016b
Changes affecting future time stamps

    New zones Europe/Astrakhan and Europe/Ulyanovsk for Astrakhan and
    Ulyanovsk Oblasts, Russia, both of which will switch from +03 to +04 on
    2016-03-27 at 02:00 local time.  They need distinct zones since their
    post-1970 histories disagree.  New zone Asia/Barnaul for Altai Krai and
    Altai Republic, Russia, which will switch from +06 to +07 on the same date
    and local time.  Also, Asia/Sakhalin moves from +10 to +11 on 2016-03-27
    at 02:00.  (Thanks to Alexander Krivenyshev for the heads-up, and to
    Matt Johnson and Stepan Golosunov for followup.)

    As a trial of a new system that needs less information to be made up,
    the new zones use numeric time zone abbreviations like "+04"
    instead of invented abbreviations like "ASTT".

    Haiti will not observe DST in 2016.  (Thanks to Jean Antoine via
    Steffen Thorsen.)

    Palestine's spring-forward transition on 2016-03-26 is at 01:00, not 00:00.
    (Thanks to Hannah Kreitem.) Guess future transitions will be March's last
    Saturday at 01:00, not March's last Friday at 24:00.

  Changes affecting past time stamps

    Europe/Chisinau observed DST during 1990, and switched from +04 to
    +03 at 1990-05-06 02:00, instead of switching from +03 to +02.
    (Thanks to Stepan Golosunov.)

    1991 abbreviations in Europe/Samara should be SAMT/SAMST, not
    KUYT/KUYST.  (Thanks to Stepan Golosunov.)

The update produced (apparently benign) warnings from zic as suggested here:
http://mm.icann.org/pipermail/tz-announce/2016-March/000036.html

Bug: 27656428
Change-Id: I31c7805b6fdb458c3ee9e695b3dff7bd003d8cab
2016-03-23 15:04:42 +00:00
Neil Fuller
3be39d1db7 Update timezone data to 2016b
am: 7bcee86

* commit '7bcee86edcc8cb0f969c719fed9bc3bd04de142f':
  Update timezone data to 2016b
2016-03-22 17:30:35 +00:00
Neil Fuller
7bcee86edc Update timezone data to 2016b
Changes affecting future time stamps

    New zones Europe/Astrakhan and Europe/Ulyanovsk for Astrakhan and
    Ulyanovsk Oblasts, Russia, both of which will switch from +03 to +04 on
    2016-03-27 at 02:00 local time.  They need distinct zones since their
    post-1970 histories disagree.  New zone Asia/Barnaul for Altai Krai and
    Altai Republic, Russia, which will switch from +06 to +07 on the same date
    and local time.  Also, Asia/Sakhalin moves from +10 to +11 on 2016-03-27
    at 02:00.  (Thanks to Alexander Krivenyshev for the heads-up, and to
    Matt Johnson and Stepan Golosunov for followup.)

    As a trial of a new system that needs less information to be made up,
    the new zones use numeric time zone abbreviations like "+04"
    instead of invented abbreviations like "ASTT".

    Haiti will not observe DST in 2016.  (Thanks to Jean Antoine via
    Steffen Thorsen.)

    Palestine's spring-forward transition on 2016-03-26 is at 01:00, not 00:00.
    (Thanks to Hannah Kreitem.) Guess future transitions will be March's last
    Saturday at 01:00, not March's last Friday at 24:00.

  Changes affecting past time stamps

    Europe/Chisinau observed DST during 1990, and switched from +04 to
    +03 at 1990-05-06 02:00, instead of switching from +03 to +02.
    (Thanks to Stepan Golosunov.)

    1991 abbreviations in Europe/Samara should be SAMT/SAMST, not
    KUYT/KUYST.  (Thanks to Stepan Golosunov.)

The update produced (apparently benign) warnings from zic as suggested here:
http://mm.icann.org/pipermail/tz-announce/2016-March/000036.html

Bug: 27656428
Change-Id: Ibbf7237344c21d22a0f781f547fbc95b46623ece
2016-03-22 11:35:33 +00:00
Elliott Hughes
a65a3ad837 Add a CTS test to ensure AT_HWCAP2 is reported.
This is important for performance of 32-bit ARM crypto code in apps.

Bug: http://b/27750752

(cherry picked from commit ebb4895c68)

Change-Id: Iec69fe57b93da0480ef3bbd4c9e7882c8aa55011
2016-03-21 11:20:42 -07:00