Commit graph

42784 commits

Author SHA1 Message Date
Ryan Prichard
d475ee45aa Merge "Revert^2 "Switch the loader to a noexcept version of libc++"" into main 2024-05-22 23:59:04 +00:00
Steven Moreland
5dd8ce7284 Merge "bionic: max_android_page_size to 16384" into main 2024-05-22 21:41:54 +00:00
Christopher Ferris
dc82bd1aae Merge "Read maps data before using and do safe reads." into main 2024-05-22 20:46:34 +00:00
Steven Moreland
8401230be6 bionic: max_android_page_size to 16384
The maximum page size Android supports
now is 16384, and Art only supports 16kB,
so we can save a bit of space.

Bug: 332556665
Test: N/A
Change-Id: I23df607bcc5cf9e96d7b6a66169413cd1a883f7e
2024-05-22 18:29:04 +00:00
Elliott Hughes
7c22b4c372 Merge "Don't leak a thread when timer_create() fails." into main 2024-05-22 11:40:39 +00:00
Satish Yalla
b5c54ac8b6 Merge "Revert "Convert Android.mk under bionic to Android.bp"" into main 2024-05-22 01:46:05 +00:00
Christopher Ferris
65e349d6c8 Read maps data before using and do safe reads.
Rather than only updating the maps when a pc can't be found, always update
the maps before using them. This avoids issues where the maps change
and it could cause a crash reading from a map that has been modified.

This assumes that executed code never gets unloaded, or that the
code is unloaded so infrequently that it doesn't matter. This happens
because the pcs for the backtraces are gathered as the program runs
and those pcs are symbolized and made into relative pcs at a later time.

Also, add safe reading of the elf data when necessary to avoid any
crashes if maps are changing while this is running.

Since the MapEntry objects can be deleted, copy the values for
the current map in the backtrace code to detect when in our own code
instead of keeping a pointer.

Bug: 340988785

Test: malloc_debug unit/system tests pass.
Test: libmemunreachable tests pass.
Change-Id: Ica2ba50a5bcf9e19c7e4033e29a5a67a1847d1a6
2024-05-21 17:41:22 -07:00
Priyanka Advani
1e32ad88ff Revert "Convert Android.mk under bionic to Android.bp"
This reverts commit 12b2042a3f.

Reason for revert: Droidmonitor triggered revert due to build breakage in b/342029467. Will be verifying through ABTD before submission.

Change-Id: I801b4999047732b86985f0be2f4aae90b9998e4a
2024-05-22 00:34:12 +00:00
Treehugger Robot
d9864c21eb Merge "Convert Android.mk under bionic to Android.bp" into main 2024-05-22 00:07:46 +00:00
Elliott Hughes
c793bc00f5 Don't leak a thread when timer_create() fails.
We do the same thing in pthread_create().

This has the nice side-effect of letting us move part of the child setup that we were doing in the parent into the child where it belongs.

Bug: https://issuetracker.google.com/340125671
Change-Id: Ibe646d5ca9066f487d08fd40f004550349e8a02e
2024-05-21 21:35:49 +00:00
Elliott Hughes
b7e98953b0 Merge "execinfo.cpp: Add a __riscv case." into main 2024-05-21 21:07:04 +00:00
Elliott Hughes
021cd6d2ca Merge "linker benchmark: our riscv64 toolchain has lga now." into main 2024-05-21 17:45:21 +00:00
Elliott Hughes
c2a4e89139 linker benchmark: our riscv64 toolchain has lga now.
This doesn't make any difference, but it does let us delete an obsolete comment.

Change-Id: Ibf81978bb7883e8c6b86c1f6c459ff70bca3f682
2024-05-21 15:37:39 +00:00
Elliott Hughes
ccc4dbf135 execinfo.cpp: Add a __riscv case.
This makes this TraceFunction() more like trace_function() in malloc_debug. I'll leave whether we can collapse these into one implementation as an open question for now...

Change-Id: I3981e4114244d49f8dbae1d3b776a7e9c32be688
2024-05-21 15:11:15 +00:00
Elliott Hughes
a13b3b32e0 Merge "Tidy and document the inline/__inline/__inline__ situation." into main 2024-05-21 11:49:20 +00:00
Elliott Hughes
e852abd1fc Merge "utils.h: quote regex match failure messages." into main 2024-05-20 18:21:27 +00:00
Elliott Hughes
0b29ce212a Merge "Add riscv64 implementation of __get_bionic_tcb_for_thread()." into main 2024-05-20 13:26:22 +00:00
Elliott Hughes
abbec338f9 utils.h: quote regex match failure messages.
This still won't be easy to read, but it should at least be "less bad".

Change-Id: I14ecf06ffcc54a4bb48003e8cba3b731d8a0073d
2024-05-20 13:12:09 +00:00
kellyhung
12b2042a3f Convert Android.mk under bionic to Android.bp
Bug: b/311284462
Test: m bionic-compile-time-tests1-clang++; m bionic-compile-time-tests2-clang++

Change-Id: I538dda9f56f0c85bf3779cc55f721a7e1c1fcc5a
2024-05-20 01:13:54 +08:00
Elliott Hughes
09c660bf75 Add riscv64 implementation of __get_bionic_tcb_for_thread().
Bug: http://b/339287219
Change-Id: I2b6f2603cd34e1575d575565c369663bfcdf9be1
2024-05-17 17:18:57 +00:00
Treehugger Robot
e78370e5f8 Merge "linker: update non-PIE error message." into main 2024-05-17 13:51:17 +00:00
Elliott Hughes
71abb3dcf4 linker: update non-PIE error message.
Also remove the commentary, which isn't really relevant in 2024.

Change-Id: I9d17159daddc6717a2255d956c9a90820fe4d17a
2024-05-17 12:16:16 +00:00
Elliott Hughes
bab8f345a6 Merge "linker: remove useless comments." into main 2024-05-17 12:13:04 +00:00
Elliott Hughes
322e9ecc3e linker: remove useless comments.
The API level in the code is more meaningful to more people anyway.

Change-Id: Ifc6a45fc16039881aa7863fbff09b5902e139d54
2024-05-16 21:46:24 +00:00
Elliott Hughes
88908db595 Merge "Minor <android/dlext.h> documentation improvements." into main 2024-05-16 21:21:24 +00:00
Treehugger Robot
bdba54d9c5 Merge "Update <android/api-level.h>." into main 2024-05-16 20:35:55 +00:00
Treehugger Robot
923b48c1c5 Merge "Update <system_properties.h> documentation." into main 2024-05-16 19:57:13 +00:00
Treehugger Robot
69fa31a8d5 Merge "Document <link.h>." into main 2024-05-16 19:20:36 +00:00
Elliott Hughes
c2622a5d4c Minor <android/dlext.h> documentation improvements.
Change-Id: I7ba1228c938e2fce858beb126e1e81620bba0459
2024-05-16 19:02:36 +00:00
Elliott Hughes
3772ae4f96 Update <system_properties.h> documentation.
Change-Id: I70de8dee963d00c480e0cb2faa9988d1d6c76d05
2024-05-16 18:45:03 +00:00
Elliott Hughes
d6c3a078bc Update <android/api-level.h>.
Change-Id: Id1522fdaf3041dcd3f296a716e8a2a1936c389e8
2024-05-16 18:31:47 +00:00
Elliott Hughes
72b10fc254 Document <link.h>.
I was only here to stop saying "Android R", which doesn't mean much to most app developers, but while I'm here...

Change-Id: I0ffd5d679747491d338064e36efc80b2b82e9e06
2024-05-16 18:10:23 +00:00
Treehugger Robot
03a4448dcf Merge "[MTE] cleanup: factor out BIONIC_MEMTAG_UPGRADE_SECS handling" into main 2024-05-15 19:40:01 +00:00
Christopher Ferris
f0247b6b68 Merge "Skip stack protector test on HWASan." into main 2024-05-15 17:53:50 +00:00
Florian Mayer
f3326581c0 [MTE] cleanup: factor out BIONIC_MEMTAG_UPGRADE_SECS handling
This makes __libc_init_mte easier to read.

Change-Id: I2826f62e53895093d1631d4e6c7e3ff844cf9def
2024-05-15 16:39:36 +00:00
Elliott Hughes
3469e7df9b Tidy and document the inline/__inline/__inline__ situation.
We can (and should) use `inline` in C++ but not in C headers that
need to support ANSI/C89/C90. `__inline__` works everywhere, but
traditionally we've used the BSD `__inline` in public headers.

Change-Id: I920e0a1f5fcd01cf8ddd89240ef66b25c50378d7
2024-05-15 16:06:07 +00:00
Yi Kong
3c0173d988 Merge "Use vmov.f64 for SET_FREG" into main 2024-05-15 13:56:47 +00:00
Yi Kong
11f696ad00 Use vmov.f64 for SET_FREG
When implemented using fcpyd, Clang sometimes generates redundant vmovs
after SET_FREGS on ARM32 and touches registers set, causing the test to
fail. Use vmov.f64 instead and that avoids the issue.

Test: atest CtsBionicTestCases:setjmp#setjmp_fp_registers -- --abi armeabi-v7a
Test: atest CtsBionicTestCases:setjmp#setjmp_fp_registers -- --abi arm64-v8a
Bug: 337903801
Change-Id: Ibd89b120f8a3cc80c34905069469fd244a902d1e
2024-05-15 15:29:29 +09:00
Christopher Ferris
0e0d600523 Skip stack protector test on HWASan.
On HWASan, it's not really possible to test scribbling on the
stack protector, so skip the test in this case.

Bug: 339529777

Test: Verified stack protector test is skipped.
Change-Id: I541416f8a84f649f83868574907b1e445d990aa0
2024-05-14 17:31:27 -07:00
Treehugger Robot
d47975728d Merge "Revert "Use inline keyword without underscores consistently"" into main 2024-05-15 00:18:01 +00:00
Dan Albert
2237fcf1fa Revert "Use inline keyword without underscores consistently"
This reverts commit 58f06e1112.

Bare `inline` is not ANSI C compatible, and NDK users may be using
that.

Test: treehugger
Change-Id: I82c5424522142001cd59da63ef3fd440014451ad
2024-05-14 17:55:54 +00:00
Treehugger Robot
d06e2e7b29 Merge "Rename GWP-ASan android_mallopt() arguments" into main 2024-05-09 17:29:34 +00:00
Jiyong Park
3aa32e2c81 Merge "Export capability.h as a filegroup" into main 2024-05-07 02:17:26 +00:00
Florian Mayer
d29fcf6e37 Merge "[MTE] update ring buffer when enabling stack trace collection" into main 2024-05-07 00:41:10 +00:00
Florian Mayer
c6d1e23b3f [MTE] update ring buffer when enabling stack trace collection
A change in scudo changed to lazy allocation of the ring buffer,
so we need to update the globals once we enable stack trace collection

Bug: 339020123
Test: sanitizer test app
Change-Id: Ideda7b761e75052d09df27de1f6b04aeb9a03dc2
2024-05-06 14:46:32 -07:00
Christopher Ferris
5fa285da96 Merge "Change malloc_not_svelte to malloc_low_memory." into main 2024-05-06 19:45:06 +00:00
Mitch Phillips
ebc2ac934f Rename GWP-ASan android_mallopt() arguments
The previous names were difficult to decipher. Now, let's change this
all to be more clear as it's actually one android_mallopt() call
depending on where it's called from, rather than the intended behaviour.

Also updated the comments so it's clear what happened across different
versions of Android.

Test: atest bionic-unit-tests CtsGwpAsanTestCases
Bug: N/a
Change-Id: I0582cab0b74aa09f4af54f9fbe5ba22697f82082
2024-05-03 13:20:45 +02:00
Jiyong Park
35a280d818 Export capability.h as a filegroup
... so that it can be used by fs_config_[dirs|files] genrules.
Previously, the fs_config_* were created by Android.mk and capability.h
was referenced directly from there. Since Soong doesn't allow that,
let's export the file explicitly.

Bug: 337993745
Test: m
Change-Id: I2777a4dbe6b977bc64c5f6defe748fa7993e578e
2024-05-03 16:53:39 +09:00
Ryan Prichard
0bac1cb8b9 Revert^2 "Switch the loader to a noexcept version of libc++"
This CL reverts commit 698ca39c9e.

Bug: 332594828
Test: treehugger
Change-Id: I4b107e4bdd3b3bef25f531fcaa58d2ae8b8270f9
2024-05-03 01:18:17 +00:00
Treehugger Robot
b1f23829ee Merge "Update the _FORTIFY_SOURCE documentation." into main 2024-05-02 22:27:12 +00:00