Commit graph

40434 commits

Author SHA1 Message Date
Nate Myren
08b0a68d6d Unmap appcompat properties in property benchmark
Otherwise, they'll leak and cause failures

Fixes: 305838406
Test: adb shell /data/benchmarktest/bionic-benchmarks/bionic-benchmarks --benchmark_filter=BM_property
Change-Id: I2d6ed4aa30012dd7aa92eed8dc564699e6505c8f
2023-11-10 11:09:46 -08:00
Nate Myren
58df4dfe9a Modify benchmark for appcompat properties, exit when init fails
The property_benchmark needs to use the `load_default_path` parameter in
when writing its test, which is necessary now. Also, the benchmark
seemed to retry infinitely when the initialization failed, so it has now
been modified to exit when the initialization fails, and send a message
as it does so.

Bug: 305838406
Test: adb shell /data/benchmarktest/bionic-benchmarks/bionic-benchmarks --benchmark_filter=BM_property
Change-Id: Idb235b0e7c119fa08ace5b814d7f7404dd0eaeb3
2023-11-07 15:20:49 -08:00
Treehugger Robot
5512532418 Merge "elf.h: add SHT_RISCV_ATTRIBUTES." into main 2023-11-04 02:19:11 +00:00
Elliott Hughes
a3f24eb6b2 elf.h: add SHT_RISCV_ATTRIBUTES.
Test: treehugger
Change-Id: I1919ae440f56c46aad0948e4535eb6fc90b10895
2023-11-03 17:25:09 -07:00
Elliott Hughes
c43ebff0a7 Merge "Remove extraneous text from header comments." into main 2023-11-02 16:09:45 +00:00
Elliott Hughes
180edefbd2 Remove extraneous text from header comments.
Test: treehugger
Change-Id: I8e27e8ac15f5f1380046accbd7875da1c3b512f2
2023-11-02 00:08:05 +00:00
Christopher Ferris
0b27d314d6 Merge "Stop fp unwinding if the pc is 0." into main 2023-11-01 19:50:33 +00:00
Christopher Ferris
85dd55530a Merge "Update to v6.6 kernel headers." into main 2023-11-01 02:14:31 +00:00
Treehugger Robot
318a1276b4 Merge "time.h: use "duration" rather than "request"." into main 2023-11-01 02:02:23 +00:00
Treehugger Robot
2e9bc49ac5 Merge "dlfcn.h: dlclose doc ~'do not use'" into main 2023-11-01 01:54:25 +00:00
Steven Moreland
f61b2b16b8 dlfcn.h: dlclose doc ~'do not use'
There are a lot of bugs about this over the years, too many to
reference here. Though, I referenced b/176065420 to understand
exactly why it's problematic and what the future direction may
be.

Fixes: 307859642
Test: N/A
Change-Id: Ida31fe622309a7f9b2cd55e5bbb3569fc5aded0e
2023-11-01 00:48:24 +00:00
Elliott Hughes
77add1bbfd time.h: use "duration" rather than "request".
This came up in a man-pages discussion. I've left the ones that take an
integer to say what _units_ they sleep in, but the ones that take a
struct seem clearest if they just say "duration".

Test: treehugger
Change-Id: I13e39855a9d2c49e1653ec2263cb09c9f239254d
2023-11-01 00:34:47 +00:00
Treehugger Robot
5f8ae9f942 Merge "Remove accidental re-addition of factored-out cruft." into main 2023-10-31 22:53:40 +00:00
Elliott Hughes
f2e04f5fbd Remove accidental re-addition of factored-out cruft.
This is in libc_defaults now.

Test: treehugger
Change-Id: I3b10c5ca4274aacb75be7ea0bedafb727881444b
2023-10-31 22:17:27 +00:00
Christopher Ferris
cfcb7b6c83 Stop fp unwinding if the pc is 0.
The android_unsafe_frame_pointer_chase keeps going even when a
frame is 0. Modify the unwind to stop when this case is found.

I found this while running the GwpAsanCrasherTest.run_gwp_asan_test
from debuggerd_test and printing the tombstone created. The
deallocated by and allocated by stack traces always ended in 0 frame.

After fixing this, the last 0 frame is no longer present.

Test: Ran the debuggerd test and printed the tombstone on a raven
Test: verifying that the last frame is non-zero.
Test: Ran the bionic unit tests.
Change-Id: I8d64679277abcf5f237e6759051db11ffaa34c2f
2023-10-31 14:14:28 -07:00
Christopher Ferris
67d1e5eb74 Update to v6.6 kernel headers.
Kernel headers coming from:

Git: https://android.googlesource.com/kernel/common/
Branch: android-mainline
Tag: android-mainline-6.6

Test: Builds and bionic unit tests pass on raven.
Test: Able to log in to an Android GO 32 bit device.
Change-Id: Ib5ff5a23f382721d98d1e428a295c6794b190d8d
2023-10-31 13:36:37 -07:00
Treehugger Robot
d0f5e4cf8a Merge "sys_msg_test: Fix msgsnd() argument passing" into main 2023-10-31 16:56:08 +00:00
Prashanth Swaminathan
b2570535c0 Merge "Temporarily fall back to non-V memcmp" into main 2023-10-31 15:46:06 +00:00
Treehugger Robot
0207a6a186 Merge changes from topic "appcompat_override" into main
* changes:
  Move __system_properties_reload to LIBC from LIBC_PLATFORM
  Write appcompat_override system properties
2023-10-31 02:29:57 +00:00
Christopher Ferris
35aaed9e1b Merge "Add android_mallopt M_GET_DECAY_TIME_ENABLED." into main 2023-10-31 02:26:02 +00:00
Prashanth Swaminathan
a4d7102cf2 Temporarily fall back to non-V memcmp
Investigation revealed that the vector instructions in the assembly
implementation of memcmp seem to be putting QEMU into a bad state. This
code sometimes results in a SIGILL.

Temporarily disable the vector instructions for just this function.

Bug: 306514350
Test: Verified boot on AOSP CF image.
Change-Id: I184762354092b4b500c78a29a10db18cef0dab90
2023-10-30 18:04:20 -07:00
Christopher Ferris
b4e560ed7c Add android_mallopt M_GET_DECAY_TIME_ENABLED.
The bionic benchmarks set the decay time in various ways, but
don't necessarily restore it properly. Add a new method for
getting the current decay time and then a way to restore it.

Right now the assumption is that the decay time defaults to zero,
but in the near future that assumption might be incorrect. Therefore
using this method will future proof the code.

Bug: 302212507

Test: Unit tests pass for both static and dynamic executables.
Test: Ran bionic benchmarks that were modified.
Change-Id: Ia77ff9ffee3081c5c1c02cb4309880f33b284e82
2023-10-30 15:30:16 -07:00
Elliott Hughes
0db95a4f23 Merge "riscv64: fix ODR violations." into main 2023-10-30 14:48:03 +00:00
Kevin Brodsky
3cc6ae0144 sys_msg_test: Fix msgsnd() argument passing
msgsnd() takes the following arguments:
1. msqid: the message queue ID
2. msgp: a pointer to a struct whose first member is the message
   type (long) and the second the message itself (char array).
3. msgsz: the size of the message
4. msgflg: optional flags

sys_msg.smoke does not correctly specify msgsz, as it provides the
size of the whole struct instead of its message (data) member.
sys_msg.msgsnd_failure does not provide a pointer to a full struct
as msgp. In both cases, this results in the kernel reading garbage
on the stack.

Fix both issues by providing the appropriate size and struct
pointer.

Test: run bionic-tests --gtest_filter=sys_msg.*
Change-Id: Iaa005e259d3ecfa28484dd66222ed6c4584ffc08
2023-10-30 09:45:38 +00:00
Elliott Hughes
7d13666b53 riscv64: fix ODR violations.
Rather than do the work to fix the ODR violations while preserving non-V,
let's just remove the non-V code. Android will require V anyway, and
anyone trying to work on a non-V system in the meantime already needs
a bunch of patches to the build system and ART, so one more shouldn't
hurt too much.

Test: treehugger
Change-Id: Iab43d8a80d99a4d045b0008dbea4e7e8696d1167
2023-10-27 16:42:52 -07:00
Treehugger Robot
f971dc6b4a Merge "Fix riscv64 stpcpy()." into main 2023-10-27 15:11:16 +00:00
Elliott Hughes
1b2e844745 Fix riscv64 stpcpy().
We were copying the data fine, but the return value was one vector
length too far (but also not taking into account the actual number of
bytes in the last transfer).

Also move the stpcpy() tests to EXPECT_EQ() so we get all the details
of the failure at once.

Test: treehugger
Change-Id: I76bf02c8a31f40722acb7c9fd8e301d50e405bf8
2023-10-26 17:50:16 -07:00
Treehugger Robot
19346eaaec Merge "Explain why system(3)'s argument is marked _Nonnull." into main 2023-10-26 23:46:52 +00:00
Elliott Hughes
cc87eec645 Explain why system(3)'s argument is marked _Nonnull.
Change-Id: I566f982148c58e74db55ccbd762e0e4ca9fad240
2023-10-26 21:28:58 +00:00
Nate Myren
0ab0615f8c Move __system_properties_reload to LIBC from LIBC_PLATFORM
The zygote cannot have visiblity to LIBC_PLATFORM methods. Therefore,
move __system_properties_reload to LIBC, and rename it
__system_properties_zygote_reload, and indicate in comments that it
should not be used by non-zygote apps

Bug: 291814949
Test: atest CtsBionicRootTestCases
Change-Id: Iee8fa0c76b740543c05a433393f2f4bef36d6d3d
2023-10-25 17:41:33 -07:00
Treehugger Robot
4cc96c1d1e Merge "Improve comment about glibc behavior difference." into main 2023-10-25 21:25:35 +00:00
Elliott Hughes
2520ce694b Merge "linker: add the L3 cache auxv constants." into main 2023-10-25 20:44:03 +00:00
Dan Albert
ac243733a5 Improve comment about glibc behavior difference.
I was re-reading this comment and thought I'd gotten my interpretation
backward, but it's actually just very nuanced. Elaborate a bit so I
hopefully don't reinterpret this again in a few more months.

Bug: None
Test: None
Change-Id: I8ca444f2fb143c46e6068f349e9f5eb574fc4b31
2023-10-25 20:31:48 +00:00
Treehugger Robot
7bdcf765fa Merge "<syslog.h>: add facilitynames[] and prioritynames[]." into main 2023-10-24 01:46:46 +00:00
Elliott Hughes
88913f8552 linker: add the L3 cache auxv constants.
I may not be likely to see these on mobile hardware, but I do see them
on qemu, and this is annoying:
```
AT_??? (46)          0
AT_??? (47)          0
```

Test: treehugger
Change-Id: I2db3e8adaecf55bce7b5046e17ec1ef7b2e3b8ea
2023-10-23 18:42:00 -07:00
Elliott Hughes
afb8e05eb3 <syslog.h>: add facilitynames[] and prioritynames[].
Test: treehugger
Change-Id: I2a65b3088fe5a28b66e7d1c2a8caa10cb4467202
2023-10-23 17:47:15 -07:00
Treehugger Robot
3a5b43c96f Merge "[NFC] Update comment explaining linker_phdr function return codes" into main 2023-10-20 14:45:17 +00:00
Mitch Phillips
117e45e6dd [NFC] Update comment explaining linker_phdr function return codes
Looks like we all copy-pasted the same comment, and the original comment was wrong. These functions all return 0 on success, and -1 on error.

Change-Id: I11e635e0895fe1fa941d69b721b8ad9ff5eb7f15
Test: N/A
Bug: N/A
2023-10-20 13:32:35 +00:00
Kalesh Singh
a05918bd83 Merge "bionic: tests: Remove PAGE_SIZE usage" into main 2023-10-20 01:03:27 +00:00
Kalesh Singh
41c8951c91 bionic: tests: Remove PAGE_SIZE usage
Instead of the hardcoded PAGE_SIZE 4096 macro, use the
real system page-size as queried from the auxillary vector.

Bug: 277272383
Bug: 300367402
Test: atest -c bionic-unit-tests
Change-Id: I2f1ad1b431e36ef45e9f53f713ced6b06e0d4f70
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2023-10-19 15:49:50 -07:00
Nate Myren
b8c87b14b0 Write appcompat_override system properties
Create a second set of system properties, that can be overlaid over the
real ones if necessary, for appcompat purposes.

Bug: 291814949
Ignore-AOSP-First: Aosp -> internal merge conflict
Test: manual, treehugger, system_properties_test

Change-Id: I541d3658cab7753c16970957c6ab4fc8bd68d8f3
Merged-In: I884a78b67679c1f0b90a6c0159b17ab007f8cc60
2023-10-19 13:35:57 -07:00
Elliott Hughes
777756d21d Merge "Use the R_RISCV_TLSDESC constant in the linker." into main 2023-10-19 18:03:22 +00:00
Treehugger Robot
b8021fbe21 Merge "Clarify one of the "missing" FreeBSD ELF constants." into main 2023-10-18 23:41:36 +00:00
Elliott Hughes
dcfd870fac Clarify one of the "missing" FreeBSD ELF constants.
Test: treehugger
Change-Id: I7173ac704e6537a4e99a976baec46aa22df751bd
2023-10-18 14:47:12 -07:00
Elliott Hughes
c6c3e8614f Use the R_RISCV_TLSDESC constant in the linker.
Bug: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/issues/94
Test: treehugger
Change-Id: I1580686c8381be7dfdb5d7684934a176e0d11d77
2023-10-18 14:12:31 -07:00
Mitch Phillips
363e743200 Merge "Use DYNAMIC entries for MTE enablement" into main 2023-10-18 10:17:37 +00:00
Edward Liaw
f2f99ec626 Merge "Add test for replacing macro arguments" into main 2023-10-17 21:29:41 +00:00
Edward Liaw
d903a736fb Add test for replacing macro arguments
Add test for aosp/2792161

Bug: 297317502
Test: cpp.py
Change-Id: I2eadd3b9371ec2f8b8c24107888cad5e3ae26f60
Signed-off-by: Edward Liaw <edliaw@google.com>
2023-10-17 20:09:42 +00:00
Edward Liaw
2f993a51bd Merge "Replace macro arguments when applying replaceTokens" into main 2023-10-17 19:59:02 +00:00
Edward Liaw
c291c39137 Replace macro arguments when applying replaceTokens
replaceTokens was only replacing tokens for cpp name clashes in the
macro body.  This change will also replace tokens in the arguments.

Bug: 297317502
Test: bionic/libc/kernel/tools/update_all.py
Change-Id: I102d000a8a4cea507b00c867df2a16106d8aed89
Signed-off-by: Edward Liaw <edliaw@google.com>
2023-10-17 17:42:40 +00:00