Commit graph

26754 commits

Author SHA1 Message Date
Elliott Hughes
9e02e20878 Merge "Revert "Retire GCC FORTIFY.""
am: 758051f058

Change-Id: I8d274ed369f0ea90ce6cf4dc5fe69fa8aa3b9d9e
2018-07-24 12:40:01 -07:00
Elliott Hughes
0d1a8a5b0b Reland "Retire GCC FORTIFY."
This reverts commit 4dbe8fc22f.

The angler/bullhead builds are now dead, so this can go in.

Bug: https://issuetracker.google.com/74404306
Change-Id: I130cdcd6375b6125cb8a1e63a4a540b0dbe41ceb
2018-07-24 19:36:51 +00:00
Elliott Hughes
758051f058 Merge "Revert "Retire GCC FORTIFY."" 2018-07-24 19:35:27 +00:00
Elliott Hughes
4dbe8fc22f Revert "Retire GCC FORTIFY."
This reverts commit 067bdc9546.

The angler/bullhead builds still use GCC, so I'll wait until they're turned down.

Bug: https://issuetracker.google.com/74404306
Change-Id: I777b08dd6ab5250d532b4b5cc56e9a790c13db20
2018-07-24 18:54:16 +00:00
Elliott Hughes
e90a2850e9 Merge "Retire GCC FORTIFY."
am: 85e84f1117

Change-Id: Id6cc44abc552ca453fe8a8a7cf6394fe27384663
2018-07-24 11:21:48 -07:00
Treehugger Robot
85e84f1117 Merge "Retire GCC FORTIFY." 2018-07-24 18:08:33 +00:00
Elliott Hughes
ab52807685 Update to FreeBSD libm r336665.
This reverts commit 253a830631 and moves
us forward to a revision that contains fixes for the problem with the
previous attempt.

This also makes sincos(3)/sincosf(3)/sincosl(3) available to `_BSD_SOURCE`
as well as `_GNU_SOURCE`.

The new FreeBSD libm code requires the FreeBSD `__CONCAT` macro, and all
our existing callers are FreeBSD too, so update that.

There's also an assumption that <complex.h> drags in <math.h> which isn't
true for us, so work around that with `-include` in the makefile. This
then causes clang to recognize a bug -- returning from a void function --
in our fake (LP32) sincosl(3), so fix that too.

Bug: http://b/111710419
Change-Id: I84703ad844f8afde6ec6b11604ab3c096ccb62c3
Test: ran tests
2018-07-24 10:36:00 -07:00
Josh Gao
fe380887c8 fdsan: improve diagnostics.
Generate a tombstone instead of just a log message when warning. Also,
don't use async_safe_fatal_va_list when we're not calling abort, as
this will permanently set the abort message.

Test: bionic_unit_tests
Test: setprop debug.fdsan warn; crasher fdsan_file
Change-Id: I2fe271da9004c8fd1f50ad3d8280be254eeaf656
2018-07-23 18:36:16 -07:00
Elliott Hughes
067bdc9546 Retire GCC FORTIFY.
NDK r18 (which removes GCC) is about to ship. We don't need this any more.

The immediate motivation for removing this right now is that the test
fails whenever we add Clang-only flags to the build system.

While we're here, clean up <stdatomic.h> too.

Bug: https://issuetracker.google.com/74404306
Test: ran tests
Change-Id: Iaad5d634d1ba76f0b6f19ad32cc27b2533771a4a
2018-07-23 17:22:58 -07:00
Elliott Hughes
70c102e536 Merge "libm: add tests that would have caught the recent regression."
am: 94ab04c17a

Change-Id: I8d3766ef3dc2ea3759b121ade24bcd1d1293e1a3
2018-07-23 16:41:36 -07:00
Treehugger Robot
94ab04c17a Merge "libm: add tests that would have caught the recent regression." 2018-07-23 23:30:11 +00:00
Elliott Hughes
505ecd6909 libm: add tests that would have caught the recent regression.
Bug: http://b/111710419
Test: ran tests
Change-Id: I00ec8ef24fb4c2cfef7c9cef311bbd6c755993e1
2018-07-23 14:25:36 -07:00
Andreas Gampe
3c52f4adb0 Merge "Revert "Update to FreeBSD libm r336523.""
am: ee213170db

Change-Id: Ib7640307d6f5a92c09e63f48f5e675c5c49b8c49
2018-07-21 17:08:51 -07:00
Treehugger Robot
ee213170db Merge "Revert "Update to FreeBSD libm r336523."" 2018-07-21 21:13:21 +00:00
Andreas Gampe
253a830631 Revert "Update to FreeBSD libm r336523."
This reverts commit f86ee10278.

Incorrect result for fmodf(3.0f, 0f) = 1.0f breaks ART tests.

Bug: 111710419
Test: art/test/testrunner/testrunner.py -b -t 436-rem-float --target
Change-Id: I7eae68fb92740db33415d16418447bcbbd98ecba
2018-07-21 12:23:03 -07:00
Josh Gao
c3ea86bc21 Merge "Mark fdsan functions as __attribute__((weak))."
am: 1d79043430

Change-Id: I7d5d6014273494e75dc86e3212aee160d687c1b7
2018-07-20 17:10:26 -07:00
Treehugger Robot
1d79043430 Merge "Mark fdsan functions as __attribute__((weak))." 2018-07-20 23:09:27 +00:00
Josh Gao
e899e798b8 Mark fdsan functions as __attribute__((weak)).
Make it so that users can check for availability of fdsan at runtime.

Bug: http://b/110100358
Test: treehugger
Test: make libjnitest
Change-Id: Ief3054161f3e255d048370975f7dd90cf7ad3687
2018-07-20 13:51:28 -07:00
Elliott Hughes
0009712f96 Merge "Update to FreeBSD libm r336523."
am: 170540398a

Change-Id: I8bf28afb02491abadd14a3cbed7cc6a6ecf82f94
2018-07-20 13:33:30 -07:00
Treehugger Robot
170540398a Merge "Update to FreeBSD libm r336523." 2018-07-20 20:21:33 +00:00
Josh Gao
4ea429628d Merge "Introduce api to track fd ownership in libc."
am: 402ca1130b

Change-Id: I5ff8039aba2fb28358a38d20c8ff0a62c115ceeb
2018-07-19 16:50:37 -07:00
Treehugger Robot
402ca1130b Merge "Introduce api to track fd ownership in libc." 2018-07-19 23:43:37 +00:00
Elliott Hughes
f86ee10278 Update to FreeBSD libm r336523.
This includes an ld128 powl, plus the clog* and cpow* families.

Also teach the NOTICE generator to strip SPDX-License-Identifier lines.

Bug: N/A
Test: ran tests
Change-Id: Ic8289d1253666a19468a4088884cf7540f1ec66d
2018-07-19 16:17:06 -07:00
Josh Gao
f6e5b58260 Introduce api to track fd ownership in libc.
Add two functions to allow objects that own a file descriptor to
enforce that only they can close their file descriptor.

Use them in FILE* and DIR*.

Bug: http://b/110100358
Test: bionic_unit_tests
Test: aosp/master boots without errors
Test: treehugger
Change-Id: Iecd6e8b26c62217271e0822dc3d2d7888b091a45
2018-07-19 14:28:54 -07:00
Florian Mayer
bba8a9f83d Merge "Fix malloc_hooks for hooks_write_malloc_leak_info."
am: 24ded2df58

Change-Id: I2292a15a1ea3fd811c6aaebec8f960e06169d28e
2018-07-19 02:21:28 -07:00
Florian Mayer
24ded2df58 Merge "Fix malloc_hooks for hooks_write_malloc_leak_info." 2018-07-19 09:10:56 +00:00
Elliott Hughes
a412015cbd Merge "setjmp is a macro."
am: ad596bf4fc

Change-Id: Ie4eba60ed009c36d71c2c8ca50c3642fd6215ecc
2018-07-18 17:53:12 -07:00
Elliott Hughes
aa3ce57149 Merge "Update libc status documentation."
am: 4502c4060a

Change-Id: I4e2bfe7a1a1b105698d8d6891cdc8963c54e94c3
2018-07-18 17:52:46 -07:00
Treehugger Robot
ad596bf4fc Merge "setjmp is a macro." 2018-07-19 00:42:54 +00:00
Treehugger Robot
4502c4060a Merge "Update libc status documentation." 2018-07-19 00:42:47 +00:00
Elliott Hughes
6094704eb6 Merge "Add C11 timespec_get."
am: 76221401ed

Change-Id: I4d2691c302e8863b0d104a739d4a60fb350947d2
2018-07-18 16:28:02 -07:00
Treehugger Robot
76221401ed Merge "Add C11 timespec_get." 2018-07-18 23:16:24 +00:00
Elliott Hughes
30340d2ad0 Merge "Expose __res_randomid."
am: 99a8caf2b8

Change-Id: I4a3d7a723a67e0d02e524fd37988e4eddf22d42c
2018-07-18 10:15:57 -07:00
Treehugger Robot
99a8caf2b8 Merge "Expose __res_randomid." 2018-07-18 17:06:28 +00:00
Florian Mayer
2d6030b2f5 Fix malloc_hooks for hooks_write_malloc_leak_info.
Change-Id: I99f9ee0221bc7bbb5e7dd173ae5a6007f0fa871d
2018-07-18 15:25:45 +01:00
Tao Bao
1fba67ff11 Merge "The --gtest_color flag should take a priority."
am: 944fcb53c1

Change-Id: Ib6bd087be0bdef051f8ae77537235b2a226b6b44
2018-07-17 21:15:40 -07:00
Tao Bao
944fcb53c1 Merge "The --gtest_color flag should take a priority." 2018-07-18 04:08:46 +00:00
Tao Bao
afacaaba8c The --gtest_color flag should take a priority.
This along with commit c1ef5eb034 should
get back to the initial behavior prior to the change in commit
83b6379783.

Fixes: 111396376
Test: `adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests --gtest_color=yes`
      shows colored output.
Test: `adb shell -t /data/nativetest64/bionic-unit-tests/bionic-unit-tests --gtest_color=no`
      doesn't add color escapes.
Change-Id: I88530e8b264cd0c259c16b09bdf867cdd2e88224
2018-07-17 19:08:13 -07:00
Elliott Hughes
bf74815b52 setjmp is a macro.
POSIX says it's unspecified whether setjmp is a macro or a function,
but C11 says it's a macro, and the C standard always wins.

Bug: https://github.com/android-ndk/ndk/issues/744
Test: ran tests
Change-Id: I4a1abc37724f8e9d9498f2093ef3c1f3b8253949
2018-07-17 13:55:36 -07:00
Elliott Hughes
a7119af33e Update libc status documentation.
Bug: N/A
Test: N/A
Change-Id: Ied9659f0388a4affa65f0948b3e4a58d0dca5605
2018-07-17 13:26:14 -07:00
Elliott Hughes
f98d87b831 Add C11 timespec_get.
Bug: https://github.com/android-ndk/ndk/issues/744
Test: ran tests
Change-Id: Iad9514946e06d55b6a3aa0f945d9a63bff900881
2018-07-17 13:21:05 -07:00
Elliott Hughes
3a5fd0014c Expose __res_randomid.
I don't think this will help the original submitter, because <resolv.h>
is mostly useless on Android. One day we might have a deprecation and
removal policy for the NDK, but until then we should probably maintain
this header.

Bug: https://github.com/android-ndk/ndk/issues/739
Test: ran tests
Change-Id: I2db859abfdebc3824c997462fa6133d5b355a8dd
2018-07-17 13:02:52 -07:00
Haibo Huang
eeb0210cf0 Merge "Only use color in supported terminal."
am: 9842db42e9

Change-Id: Id7970786ad9b17847cc8085bf44c25dc47f5178a
2018-07-16 17:43:03 -07:00
Treehugger Robot
9842db42e9 Merge "Only use color in supported terminal." 2018-07-17 00:34:34 +00:00
Haibo Huang
c1ef5eb034 Only use color in supported terminal.
Test: compile
Change-Id: Ibb962597e065ebb90a53dd8bc62c4b774a2e4f10
2018-07-16 22:53:49 +00:00
Christopher Ferris
29f80a8ed5 Merge "Disable malloc debug intercepts when exiting."
am: a9713035ba

Change-Id: If7ef67cf0d7864e91b107deb41b0761de2ddf538
2018-07-13 11:46:37 -07:00
Christopher Ferris
a9713035ba Merge "Disable malloc debug intercepts when exiting." 2018-07-13 18:15:59 +00:00
Ryan Prichard
1872c21ad5 Merge "Call __emutls_unregister_key on dlclose"
am: 2e457f5128

Change-Id: Ic4d5d66b811a518adff95c96ef05b1f6b9797136
2018-07-11 22:53:58 -07:00
Treehugger Robot
2e457f5128 Merge "Call __emutls_unregister_key on dlclose" 2018-07-12 04:33:19 +00:00
Christopher Ferris
97b4747102 Disable malloc debug intercepts when exiting.
There is a hang when enabling leak_track since the dumping of the
leak data can wind up doing an allocation.

Add new system unit test to make sure this doesn't happen again.

Bug: 111146059

Test: Test program that leaks does not hang forever.
Test: Unit tests pass.
Change-Id: Icf99be58ba5db98ee124a471b957a086045f5870
2018-07-11 15:23:00 -07:00