Commit graph

375 commits

Author SHA1 Message Date
Vishwath Mohan
c94c4d269a Merge "Blacklist some vector functions for CFI." 2017-03-23 23:14:48 +00:00
Vishwath Mohan
27a7aa0f59 Blacklist some vector functions for CFI.
This CL blacklists some vector functions (construct, copy, splat,
move) that use reinterpret_cast on freshly allocated memory (where the
object doesn't exist yet). This is technically correct, but not
friendly for CFI, which enforces stricter checking to catch type
confusion errors. Blacklisting these specific functions from CFI does
not cause an appreciable coverage loss though, so this should be fine.

Bug: 36219323
Test: Builds and boots, and the reinterpret error goes away on CFI builds.
Test: All 98 libutils_tests pass
Change-Id: I4944b179116bb1e1608d92697e95e182d8c0ac9f
2017-03-23 14:37:12 -07:00
Adam Lesinski
aa1d43230c Merge "libziparchive: fix mac os breakage" am: 390f3b364c am: 7cfe1d69b0
am: cdbadafb4a

Change-Id: Ie327879eaea542911603640e36f0d867e05afd61
2017-03-23 21:12:58 +00:00
Adam Lesinski
b02d690336 libziparchive: fix mac os breakage
Add ftruncate64 to utils/Compat.h definitions for mac.

Change-Id: I82cb46927be911e867b606f4f4429a5e1b1987f7
Test: builds on mac
2017-03-23 12:02:09 -07:00
Hans Boehm
d9bcc37269 Merge "Add heuristic data race detection to sp<>" am: 04abdc6153 am: 12d6afe6f1
am: 764d347183

Change-Id: I6a27520e80c2adefe30b0d04ce7e470188d3ad99
2017-03-19 04:56:09 +00:00
Hans Boehm
7f0b2601d3 Add heuristic data race detection to sp<>
Force assignment to read the old pointer value twice, and check
that it didn't change in the interim. Previous experience with
Skia suggests that this has a high probability of correctly detecting
a data race when it occurs, instead of potentially letting the
count associated with the old pointer value get decremented twice,
and corrupting the heap.

This does increase the size of sp assignments, which seem to
commonly get inlined. For the general case, we add a third
comparison and function call.

Some code reformatting to make this consistent with modern conventions
and pass automated checks.

Test: Booted aosp build. Ran libutils tests. Looked at generated code.

Bug: 31227650

Change-Id: Id93a05c6bf10f01ee15ff1bb409611f2058f988f
2017-03-17 17:47:28 -07:00
TreeHugger Robot
6258cfee90 Merge "Formatting changes for TypeHelpers.h and Vectors.h" 2017-03-16 07:38:32 +00:00
Vishwath Mohan
fc3f57acbb Formatting changes for TypeHelpers.h and Vectors.h
This CL nukes all spurious whitespace in the two files.

Bug: 36219323
Test: Device builds and boots.
Test: All 98 libutils_tests pass
Change-Id: I8054a0f0ba5df95f5115dc06597eb9fd539da942
2017-03-15 22:48:27 -07:00
Dan Willemsen
5dfa912f03 Merge "Enable more modules on linux_bionic builds" am: 75c414d1a3 am: 5bb9220b75
am: 5e30ce0ca0

Change-Id: I8d1ba8749e9c0e6433236b42bda7da5188e5f810
2017-03-16 02:40:00 +00:00
Dan Willemsen
e0cd1e043d Enable more modules on linux_bionic builds
Bug: 31559095
Test: Enable host bionic, run soong
Change-Id: Ib4ebd909322cf464b6a40040e4b60ece7d905b6f
2017-03-15 15:44:00 -07:00
Mathias Agopian
f520b73103 Get rid of LinearTransform
It had 3 clients
- one in vendor/google_athome which was disabled
- one in a device specific folder, which will die out
- and one in frameworks/base

This reverts commit 6c942304ed.

Test: compile/run
Bug: treble cleanup

Change-Id: Ia76009d550c294198c083cf89718bc498b5c9e3e
2017-03-15 14:16:13 -07:00
Ian Pedowitz
6c942304ed Revert "get rid of LinearTransform"
This reverts commit bcd592053a.

Bug: 36206160
Test:  Fugu compiles, didn't before the revert
Change-Id: Id80fd4ce9db3fce03b049cf81f938187c7ddb8b0
2017-03-14 08:11:41 +00:00
Mathias Agopian
bcd592053a get rid of LinearTransform
it had a single client in frameworks/base

Test: compile & run
Bug: treble cleanup
Change-Id: I9a17bbffed4724f8a329c5a15d621293bb800d45
2017-03-13 12:27:35 -07:00
Steven Moreland
aa47993b23 Merge "libutils: String\d+ make std_string private" am: 76850afa52 am: 2ebb1e5404
am: 4ba3f784ef

Change-Id: I14f003992db222ef285551c6d9a8ffe71620f70d
2017-03-11 09:07:23 +00:00
Steven Moreland
2aac335128 libutils: String\d+ make std_string private
This method is still used by prebuilts, but making it private to start
the process of removing it from everywhere.

Test: pass
Bug: 35363681
Change-Id: I4d53f68d10c9abcca32023c4d930e99912afa697
2017-03-10 22:51:55 -08:00
TreeHugger Robot
decccc2e8f Merge "Remove BlobCAche from libutils" 2017-03-11 01:32:47 +00:00
Mathias Agopian
f088e4e238 Remove BlobCAche from libutils
it has moved to libEGL which was the only client.


Test: compiled & Run
Bug: vndk-stable
Change-Id: Ife18727fa1c48b1be6910058867016348b7f02c1
2017-03-10 12:27:46 -08:00
Steven Moreland
d21cfab244 Add missing includes.
Includes are transitively imported by <string> in String8.h + String16.h
but that include is being removed.

Test: pass
Change-Id: Ide5c011b40b4a4f031dd26ead08b5c8d5d299693
2017-03-10 09:05:30 -08:00
Tom Cherry
101573e3f5 Merge "Clarify that Condition::wait() can spuriously wake up" am: 514e0aa2e2 am: 675e05c48a
am: df8fc09716

Change-Id: Id99d721415d93b2d3f0539bf5a2acb1995f01000
2017-03-06 20:06:03 +00:00
Tom Cherry
514e0aa2e2 Merge "Clarify that Condition::wait() can spuriously wake up" 2017-03-06 19:26:30 +00:00
Mathias Agopian
22dbf3947f clean-up libutils includes
moved Foo.h as first include of Foo.cpp, and
removed redundant includes.

Made NativeHandle non virtual.


Test: run & compile
Bug: n/a

Change-Id: I37fa746cd42c9ba23aba181f84cb6c619386406a
2017-03-03 14:47:47 -08:00
Tom Cherry
f1147f7dde Clarify that Condition::wait() can spuriously wake up
Also, remove the clarification that Condition::signal() wakes exactly
one thread as in the presence of spurious wake ups, this clarification
does not provide a safe guarantee to developers.

Bug: 34592766
Test: Build
Change-Id: I34df02e44a70a18fe04ceda858d002ef129c1fd9
2017-03-02 12:36:45 -08:00
Colin Cross
a4ca06b3b3 Merge changes I975ba933,Ica9d211b am: a9ef4dc7a2 am: 9ece9401a4
am: f695f6e842

Change-Id: I570c55be7a7cf3ad44e32717040689a68f67ada2
2017-02-28 20:37:29 +00:00
Colin Cross
a0931ebd64 Add tests for multiton issue
Test accessing a singleton from two libraries, the second of which
depends on the first but is dlopen'd after the first is already
loaded.

Bug: 35674422
Test: out/host/linux-x86/nativetest64/libutils_tests/libutils_tests
Change-Id: I975ba933a19b941a52bdb6e9c221a6910ffb8081
2017-02-28 16:34:35 +00:00
Colin Cross
62a6b16c4b Merge "Make libutils test compile on the host" am: f5fd4888ce am: a05a666c01
am: 3bc7d607d4

Change-Id: I00ac6f6871d925c805953eff0fa0c918cee3600a
2017-02-24 21:25:24 +00:00
Colin Cross
155c983ad1 Make libutils test compile on the host
Reapply of Icd5f39ae71b57167e9b2fe7ec09c5400bcb90e78 with
RefBase_test.cpp and Looper_test.cpp removed from mac builds.

Test: out/host/linux-x86/nativetest64/libutils_tests/libutils_tests
Test: out/host/darwin-x86/nativetest64/libutils_tests/libutils_tests
Change-Id: I5979b296a8500b5697d94d64fc441363047adcea
2017-02-24 08:10:06 -08:00
Richard Uhler
2aa94cfaf9 Merge "Revert "Make libutils test compile on the host"" am: 16f4fb9c4e am: 5682e001e9
am: 0d461283ce

Change-Id: I82132fc1e9eda421ed44a65029d389fdde67d5e8
2017-02-24 11:20:20 +00:00
Richard Uhler
16f4fb9c4e Merge "Revert "Make libutils test compile on the host"" 2017-02-24 11:10:43 +00:00
Richard Uhler
26bfee52b3 Revert "Make libutils test compile on the host"
Fails mac build: "system/core/include/utils/Looper.h:25:10: fatal error: 'sys/epoll.h' file not found"

This reverts commit afa891e85e.

Change-Id: Ib558b8f5a303b55ab32a399d338d8aac0fae32b2
2017-02-24 09:36:13 +00:00
Colin Cross
23eff4621f Merge changes Icd5f39ae,I2a4e956c am: 6d795c2883 am: 92466ff6ea
am: 9cb1d219bd

Change-Id: Ic79f7efd0090a940ac1cb7be1e863c2668790bd3
2017-02-24 07:09:41 +00:00
Treehugger Robot
6d795c2883 Merge changes Icd5f39ae,I2a4e956c
* changes:
  Make libutils test compile on the host
  Fix ODR issue in StrongPointer_test.cpp
2017-02-24 06:59:11 +00:00
Colin Cross
afa891e85e Make libutils test compile on the host
Test: out/host/linux-x86/nativetest64/libutils_tests/libutils_tests
Change-Id: Icd5f39ae71b57167e9b2fe7ec09c5400bcb90e78
2017-02-23 21:25:19 -08:00
Colin Cross
fe06c63301 Fix ODR issue in StrongPointer_test.cpp
StrongPointer_test.cpp's Foo was colliding with RefBase_test.cpp's
Foo.

Test: out/host/linux-x86/nativetest64/libutils_tests/libutils_tests
      from later CL
Change-Id: I2a4e956c88a07cec72d7ce734cf06c58134a4235
2017-02-23 21:25:18 -08:00
Colin Cross
477b3fc355 Merge "Fix multiton issue" am: 78b285b367 am: 6d7751a13b
am: dafd687617

Change-Id: I7e7369361dda3df0e97169c0d06ce24c57490c7d
2017-02-24 04:12:20 +00:00
Treehugger Robot
78b285b367 Merge "Fix multiton issue" 2017-02-24 04:03:11 +00:00
Colin Cross
b0145091a7 Fix multiton issue
I385a05a3ca01258e44fe3b37ef77e4aaff547b26 broke Singleton in the
same way that 544e3e3606 had already
fixed once.  Fix it again, the next CL will add tests.

This affected cases where two libraries referenced the same singleton,
the one that was supposed to define the singleton was already loaded,
and then the second library was dlopen'd.

Bug: 35674422
Test: out/host/linux-x86/nativetest64/libutils_tests/libutils_tests
      from later CL
Change-Id: I87c64f95ed294a887e67a6c11be3072299789f01
2017-02-23 18:22:46 -08:00
Tom Cherry
917cca2f04 Merge "Make Condition use CLOCK_MONOTONIC" am: 7f932afefc am: 36ba2fbef7
am: 83f76a20a8

Change-Id: I214548f856db2826b7a4ea96a98950fee7d20a27
2017-02-23 22:09:39 +00:00
Tom Cherry
1fb04ff4e5 Make Condition use CLOCK_MONOTONIC
Changes to the REALTIME clock can cause Condition::waitRelative() to
timeout early or delayed.  This behavior is undesired and new since
https://android-review.googlesource.com/#/c/181058/ moved the
underlying pthread_cond_timedwait() implementation to use absolute
timeouts rather than relative ones.  Having Condition use
CLOCK_MONOTONIC prevents these timeout issues.

Bug: 34592766
Bug: 35678943
Test: Boot bullhead
Test: Ensure time changes do not cause Condition::waitRelative() to
timeout early or delayed

Change-Id: I3a8d7a48f9b42fe990c3c7331313b6d85aa546f9
2017-02-23 10:58:05 -08:00
Steven Moreland
870a065800 Merge "Vector.h: remove unused import <new>" am: 1a4e2dfdf5 am: c50fce7dac
am: 4fbff753ba

Change-Id: I8581d836ee94d691f7a7a6b01dd9f7f8017fe093
2017-02-17 23:51:41 +00:00
Treehugger Robot
1a4e2dfdf5 Merge "Vector.h: remove unused import <new>" 2017-02-17 23:37:06 +00:00
Steven Moreland
40c7ddfc09 Vector.h: remove unused import <new>
Test: pass
Change-Id: I9d04c909a1bc82352f1eebe36602bf095ec3ca30
2017-02-17 13:19:08 -08:00
Steven Moreland
cee1918b08 Merge "Remove unused primes.py python file." am: 325eeebc47 am: e9ce5716ce am: 72ff4d5360
am: 374ef9d1c4

Change-Id: I349611742f6ccd8e4be97b1f45b1a316e61469e8
2017-02-17 01:33:00 +00:00
Steven Moreland
16afa6a0f0 Remove unused primes.py python file.
primes.py was used to calculate primes for BasicHashTable which no
longer exists.

Change-Id: I8c6e9b7882bcb8a3832c55249be6db9421d1f771
2017-02-16 14:30:44 -08:00
Steven Moreland
5717abf233 Merge "RefBase.cpp remove unused include typeinfo" am: 141e98474e am: d253899e1e am: 1bc2c960ee
am: 878f0c6bd6

Change-Id: I8230b912145a755c7c36bd4b3f3c26784c35e19a
2017-02-16 05:35:44 +00:00
Steven Moreland
1a055a8957 RefBase.cpp remove unused include typeinfo
Test: pass
Change-Id: Iec9b9e1e9b6c974124b2043f550fb110cc22846d
2017-02-15 19:04:40 -08:00
Elliott Hughes
b7d71b7f16 Merge "Make __android_log_assert behave more like libc asserts." am: 9df286012c am: ad2927d744 am: a7063b8257
am: 5647620cef

Change-Id: Iab197b5798c8754b5b824a8e6a7663ce7e69ef5f
2017-02-07 17:10:03 +00:00
Elliott Hughes
5bae1b866d Make __android_log_assert behave more like libc asserts.
If we don't output to stderr too, not only is it annoying to shell users (who
won't see anything), it prevents us from writing better gtests that actually
make assertions about the assert message.

Bug: http://b/23675822
Test: libutils tests still pass
Change-Id: I62b3144c385cba4dde485f0b0f9b42aeaef51e9a
2017-02-06 10:54:00 -08:00
Vijay Venkatraman
a040114bcb Merge "Exporting C++ headers from system/core" am: 812b7d5d52 am: f484dd3401 am: a252f11da3
am: 5a8f555e49

Change-Id: Id449aadc3b9e6e263d351ce031b1f7f7bb4672b8
2017-01-26 02:03:45 +00:00
Vijay Venkatraman
75acc7bf81 Exporting C++ headers from system/core
Moved headers from include/libutils and include/libsysutils to
libutils/include and libsysutils/include respectively, so they can be
exported via these libs. They needed to be moved since Soong does
not allow export from external folder.

Added symlink from old locations. They are needed since Soong
includes system/core/include by default. Once all modules are
cleaned up to explicitly add the required libs, the symlinks will be
removed.

Moved headers of libutils to libutils_headers. They should be used
by modules for header-only inlines. Added libutils_headers as
dependency of libutils.

Split of C++ headers into those that have no dependency and those that
have dependency on libutils.so will be handled in a later CL.

Test: Add above libs to shared lib of local module
Change-Id: I122db72056b26b1f39bad1d9a0c2a1c5efda3550
2017-01-24 22:51:36 +00:00
Mark Salyzyn
271a1a7cda resolve merge conflicts of a45b1d6f3 to master
Test: compile
Bug: 30465923
Change-Id: I648855539df3cfa176c6ecac19b6a562ba6feaf7
2017-01-11 11:41:38 -08:00