Commit graph

25501 commits

Author SHA1 Message Date
Elliott Hughes
17d64a91de Merge "Move sigprocmask into its own file." am: a9050686c4
am: b140900c89

Change-Id: I0cf97c5ea0f75a89cb8db4dbe9b8a12979a3bcc1
2018-02-27 06:07:29 +00:00
Elliott Hughes
b140900c89 Merge "Move sigprocmask into its own file."
am: a9050686c4

Change-Id: Ib5e7e8f8c8fd6333e1fb5a211890abd301ce1470
2018-02-27 06:01:39 +00:00
Elliott Hughes
a9050686c4 Merge "Move sigprocmask into its own file." 2018-02-27 05:49:46 +00:00
Elliott Hughes
7ae39129e1 Move sigprocmask into its own file.
Otherwise clang inlines it into pthread_sigmask(3), which breaks libsigchain.

Bug: http://b/73344857
Test: ran tests, plus the app this broke
Change-Id: Ie4a1dc8f9c6ba58d1a2fa69aeff961c70b74767d
2018-02-26 16:59:37 -08:00
Ryan Prichard
a40a9dc262 Merge changes Idc5da0f8,I64223714 am: 9c85408d95
am: 75cb71c510

Change-Id: Id81b2ba62db1c3de7a0bd1b688e7b4897f54c076
2018-02-22 07:20:30 +00:00
Ryan Prichard
75cb71c510 Merge changes Idc5da0f8,I64223714
am: 9c85408d95

Change-Id: Iee95450f21eeea98e31565bc54edb945298eb28a
2018-02-22 07:12:27 +00:00
Treehugger Robot
9c85408d95 Merge changes Idc5da0f8,I64223714
* changes:
  Reject exit-time destructors in libc
  Remove non-trivial constructors/destructors from SystemProperties
2018-02-22 06:48:12 +00:00
Ryan Prichard
8f419579ed Reject exit-time destructors in libc
Test: m libc
Bug: b/73485611
Change-Id: Idc5da0f8a21e3f58fc68085577fa5fca40057276
2018-02-21 15:10:24 -08:00
Tom Cherry
ee8e3dd67c Remove non-trivial constructors/destructors from SystemProperties
With the goal of disallowing exit time destructors, SystemProperties's
non-trivial destructor needs to be removed.  This means replacing the
union hack with yet another hack as we don't want to allocate anything
despite relying on some polymorphism.

Bug: 73485611
Test: boot bullhead
Change-Id: I64223714c9b26c9724bfb8f3e2b0168e47b56bc8
2018-02-21 15:10:17 -08:00
Tom Cherry
cf1df7ee4f Merge changes Ibcd45e9b,I1ff5c0fa am: 44c7b6ad0a
am: 9fa8caa815

Change-Id: I6dde2e647715f3b954b9be04eaab61e8d66aed13
2018-02-21 05:01:02 +00:00
Tom Cherry
9fa8caa815 Merge changes Ibcd45e9b,I1ff5c0fa
am: 44c7b6ad0a

Change-Id: If8e462a66adea805e1a44f4441c7a0b07d9e835b
2018-02-21 04:53:08 +00:00
Tom Cherry
44c7b6ad0a Merge changes Ibcd45e9b,I1ff5c0fa
* changes:
  Do not munmap in MmapFile::~MmapFile
  Build bionic/tests with cpp_std experimental.
2018-02-21 04:41:21 +00:00
Tom Cherry
31e1890d15 Merge "Fix mmap leak in MmapFile" am: d27a3d7853
am: 9104a702bc

Change-Id: I9533ebdb6762d9dca19e80bc115f535ad82a7fa2
2018-02-21 02:28:44 +00:00
Tom Cherry
9104a702bc Merge "Fix mmap leak in MmapFile"
am: d27a3d7853

Change-Id: I8309fc4cd9889857e1b3ed813ec9b374b3ce5e4d
2018-02-21 02:20:40 +00:00
Treehugger Robot
d27a3d7853 Merge "Fix mmap leak in MmapFile" 2018-02-21 02:14:21 +00:00
Tom Cherry
5fe73268f3 Do not munmap in MmapFile::~MmapFile
Having any destructor with a global variable in bionic is causing
some issues. Since we don't actually need to munmap in this case, we
remove the destructor to work around that issue.

A small class is used to still munmap during tests.

Bug: 73485611
Test: bionic unit tests
Change-Id: Ibcd45e9b1ab22d187ecfc2738bb87244250d81ea
2018-02-20 16:02:13 -08:00
Tom Cherry
cb4d42173e Fix mmap leak in MmapFile
If the mmap'ed file doesn't end in a new line, previously we'd leak
the mmap'ed region.  This change now munmap's the region.

Test: unit tests
Change-Id: If28d3d9a6b1b9c54123beecb3bbbe8ed984ca81d
2018-02-20 15:50:04 -08:00
Tom Cherry
60ddedff0b Build bionic/tests with cpp_std experimental.
Test: bionic unit tests still pass.
Change-Id: I1ff5c0fa391ae111ac19e863ef0f7f29868406e6
2018-02-20 15:40:02 -08:00
dimitry
298b6ef913 Merge "Fix RTLD_NEXT/DEFAULT lookup" am: e510d9c369
am: 068ea4563a

Change-Id: I2a249c2af977323fdacb28a09b076dcca8a478a6
2018-02-20 22:38:39 +00:00
dimitry
068ea4563a Merge "Fix RTLD_NEXT/DEFAULT lookup"
am: e510d9c369

Change-Id: I5b525fbbb6bcff3e368cc11f2624d4d92c095213
2018-02-20 22:32:04 +00:00
Treehugger Robot
e510d9c369 Merge "Fix RTLD_NEXT/DEFAULT lookup" 2018-02-20 22:24:37 +00:00
dimitry
153168c855 Fix RTLD_NEXT/DEFAULT lookup
RTLD_NEXT/DEFAULT lookup should not skip handle lookup
in the case when the load group is RTLD_GLOBAL.

Note that there is a difference between load group is local group.
The local group includes externally referenced libraries where
the load group does not. The external reference in this context is a
DT_NEEDED library that belongs to a previously loaded group.

Bug: http://b/72237367
Test: bionic-unit-tests --gtest_filter=dl*
Change-Id: I8997cc961c13a5396f1756161798b45ed1cab16c
2018-02-20 17:10:00 +01:00
Elliott Hughes
ab98ba92be Merge "Remove obsolete debuggerd32/debuggerd64 hack." am: 0da2523570
am: 10f60624f7

Change-Id: Iff6185e5650bfb01d19812540f67e606289cd8ae
2018-02-16 23:56:38 +00:00
Elliott Hughes
10f60624f7 Merge "Remove obsolete debuggerd32/debuggerd64 hack."
am: 0da2523570

Change-Id: I218a0f61e4cc0c8d71dcf8085fb35c0d25e8a25d
2018-02-16 23:49:33 +00:00
Elliott Hughes
3eac85f681 Merge "The VDSO soname varies by architecture." am: e2d6c1e76c
am: 2bc42e9664

Change-Id: Ia66562e9a98abf2afab667fd8ff2accc337d0dff
2018-02-16 23:36:08 +00:00
Treehugger Robot
0da2523570 Merge "Remove obsolete debuggerd32/debuggerd64 hack." 2018-02-16 23:34:35 +00:00
Elliott Hughes
2bc42e9664 Merge "The VDSO soname varies by architecture."
am: e2d6c1e76c

Change-Id: I0836e5064db05b624d494248b6f5fe5716c45450
2018-02-16 23:19:59 +00:00
Elliott Hughes
e2d6c1e76c Merge "The VDSO soname varies by architecture." 2018-02-16 21:51:54 +00:00
Elliott Hughes
4e6bf9e9fa Remove obsolete debuggerd32/debuggerd64 hack.
Bug: N/A
Test: builds
Change-Id: I159eea4e1c0d88e5e51184479ed020e7597390ba
2018-02-16 10:53:03 -08:00
Elliott Hughes
da1bb11340 The VDSO soname varies by architecture.
From http://man7.org/linux/man-pages/man7/vdso.7.html:

       user ABI   vDSO name
       ─────────────────────────────
       aarch64    linux-vdso.so.1
       arm        linux-vdso.so.1
       ia64       linux-gate.so.1
       mips       linux-vdso.so.1
       ppc/32     linux-vdso32.so.1
       ppc/64     linux-vdso64.so.1
       s390       linux-vdso32.so.1
       s390x      linux-vdso64.so.1
       sh         linux-gate.so.1
*      i386       linux-gate.so.1
*      x86-64     linux-vdso.so.1
       x86/x32    linux-vdso.so.1

Note that Android "x86" is Linux's "i386", which is the odd one out
amongst Android's supported architectures.

Bug: http://b/72831787
Test: ran tests
Change-Id: I0a28127af042e2fd7673f24bbb30f8a50556cf96
2018-02-16 10:05:08 -08:00
Elliott Hughes
c58caf7120 Merge "Add __fseterr." am: d5172fced0
am: 52d10ed272

Change-Id: Ie5175743e8a970a929406bee92b8e62da0b0bcd2
2018-02-15 02:52:49 +00:00
Elliott Hughes
52d10ed272 Merge "Add __fseterr."
am: d5172fced0

Change-Id: I847cdaa0766f540cad474c4137650210eca14247
2018-02-15 02:47:16 +00:00
Treehugger Robot
d5172fced0 Merge "Add __fseterr." 2018-02-15 02:36:38 +00:00
Elliott Hughes
906d030390 Merge "Add remaining _l function stubs." am: 665ce210fa
am: f1589c5d14

Change-Id: If541b81060b8937ca358b1119564d33f5991e9d0
2018-02-15 01:39:36 +00:00
Elliott Hughes
f1589c5d14 Merge "Add remaining _l function stubs."
am: 665ce210fa

Change-Id: I9f0c8f4e16022730e1bc6a0387ed04201fc8fb0d
2018-02-15 01:34:03 +00:00
Elliott Hughes
665ce210fa Merge "Add remaining _l function stubs." 2018-02-15 01:26:17 +00:00
Elliott Hughes
457852666c Add __fseterr.
Trivial, obvious counterpart to the standard ferror(3) and clearerr(3),
and lets us build bison out of the box.

Bug: http://b/64273806
Test: ran tests
Change-Id: I20affabddb71210051165c41e86adfe5ae04f77f
2018-02-14 15:25:21 -08:00
Elliott Hughes
923a3ba322 Merge "Add uc_sigmask64." am: 38a78728c3
am: 55d7fcea34

Change-Id: I573a6231b0ce1852a1bdc1f380c5c19cde54286e
2018-02-14 21:48:52 +00:00
Elliott Hughes
55d7fcea34 Merge "Add uc_sigmask64."
am: 38a78728c3

Change-Id: I6c0712cfb7927f1c0f4163dd2eadc74ca7d35ea7
2018-02-14 21:42:48 +00:00
Elliott Hughes
38a78728c3 Merge "Add uc_sigmask64." 2018-02-14 21:24:11 +00:00
Elliott Hughes
3376c23dac Add remaining _l function stubs.
Bug: http://b/65595804
Test: ran tests
Change-Id: I3bea3af20b354d1f0d3e05fd35421a9045f29020
2018-02-13 23:14:12 -08:00
Elliott Hughes
5865ee9ab8 Merge "Switch the rest of our internal headers to #pragma once." am: 2d1e1011cf
am: 35549743bc

Change-Id: Ia803210dae862b74447599d45691cab942a2194c
2018-02-14 03:09:54 +00:00
Elliott Hughes
23415fc60d Add uc_sigmask64.
Added to each ucontext_t for source compatibility between platforms where
sigset_t and sigset64_t differ (arm, x86) and where they're the same
(all the rest).

Bug: http://b/72493232
Test: ran tests
Change-Id: I65a37bfa177933701bbe6c2350448885fd0f9c43
2018-02-13 19:09:04 -08:00
Elliott Hughes
35549743bc Merge "Switch the rest of our internal headers to #pragma once."
am: 2d1e1011cf

Change-Id: I694d29c8c32ef1035668e3a8ac0c18230651cf45
2018-02-14 03:05:21 +00:00
Treehugger Robot
2d1e1011cf Merge "Switch the rest of our internal headers to #pragma once." 2018-02-14 02:53:37 +00:00
Christopher Ferris
e1c4716a56 Merge "Implement malloc hooks." am: af8d54a7d7
am: 7cf17cc1b0

Change-Id: Ida768060fccf3b4bc29b2a9bc96c4b81cd48d988
2018-02-14 01:10:21 +00:00
Christopher Ferris
7cf17cc1b0 Merge "Implement malloc hooks."
am: af8d54a7d7

Change-Id: Ic89879c033b37b11c56ff557b0af3e95453dc1da
2018-02-14 01:02:59 +00:00
Christopher Ferris
af8d54a7d7 Merge "Implement malloc hooks." 2018-02-14 00:49:48 +00:00
Elliott Hughes
cbc80ba9d8 Switch the rest of our internal headers to #pragma once.
We've been using #pragma once for new internal files, but let's be more bold.

Bug: N/A
Test: builds
Change-Id: I7e2ee2730043bd884f9571cdbd8b524043030c07
2018-02-13 14:27:17 -08:00
Christopher Ferris
db478a6274 Implement malloc hooks.
Use the malloc debug framework to implement the malloc debug hooks
since it can introduce a performance issue.

Also, modify the bionic/tests/utils.h slightly to dump an error message
when the exe failed.

Bug: 30561479

Test: Ran malloc hook unit tests.
Test: Ran malloc debug unit tests.
Test: Enabled malloc hooks and ran bionic unit tests and verified no
Test: unexpected failures.
Test: Enabled malloc debug and malloc hooks and verified malloc debug wins.
Test: Enabled malloc debug using env, property, and property with name
Test: still works.

Change-Id: Ib50046a0493c5c2050cf831befb812310bdcc249
(cherry picked from commit d6a1dc2379)
2018-02-13 13:37:30 -08:00