Commit graph

38572 commits

Author SHA1 Message Date
Treehugger Robot
83f9b28792 Merge "Nullability check for system_properties module." 2023-05-18 18:38:17 +00:00
Christopher Ferris
3cf1f484b1 Merge "Use AndroidLocalUnwinder object." 2023-05-18 18:24:58 +00:00
Christopher Ferris
e2f58a3f03 Use AndroidLocalUnwinder object.
Using the AndroidLocalUnwinder object allows unwinding interpreter
and JIT'd frames by default. In addition, it simplifies the code.

Test: Forced interpreter on all of the time and forced fdtrack on
Test: and verified unwind includes dex frames.
Test: Forced JIT on all of the time and forced fdtrack on
Test: and verified unwind includes dex frames.
Test: Unit tests pass.
Change-Id: Icae17e83c9aaa04750b07471243550a7829524f7
2023-05-17 18:45:25 -07:00
Florian Mayer
e20c5fa4ac Merge "Revert "Add debug logging for memtag level"" 2023-05-18 01:06:23 +00:00
Florian Mayer
dd44378da7 Revert "Add debug logging for memtag level"
This reverts commit b3f3e86878.

Reason for revert: This created spam in tombstones.

Change-Id: Ia7b8285a6abd6f89d49859a981be1c9cfa104f81
2023-05-17 20:59:14 +00:00
zijunzhao
a505b2d37a Nullability check for system_properties module.
Bug: b/245972273
Test: adb shell
Change-Id: I3a55b8107898014fe74fd1a6f442f1ec00e08790
2023-05-17 20:43:51 +00:00
Treehugger Robot
ad333b6161 Merge "riscv64: say "x3" rather than "gp" in shadow call stack assembler." 2023-05-17 16:51:16 +00:00
Elliott Hughes
c35a0dc08e riscv64: say "x3" rather than "gp" in shadow call stack assembler.
Neither is great, but "gp" seems actively misleading (and setjmp.S
says x3 every time, so we should be consistent if nothing else).

Bug: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/379
Test: treehugger
Change-Id: Ibccda74d4794caa770b82e7ba2e31ce7b645b83f
2023-05-16 16:09:30 -07:00
Treehugger Robot
b167b90b4c Merge "Nullability check for time module." 2023-05-16 18:28:57 +00:00
zijunzhao
2067ec5967 Nullability check for time module.
Bug: b/245972273
Test: adb shell
Change-Id: I61f69f48f3428ef1f544dd01e573ff078a9eab17
2023-05-16 00:17:36 +00:00
Elliott Hughes
d93f594d78 Merge "riscv64: don't use jalr when we can just say call." 2023-05-12 22:45:19 +00:00
Elliott Hughes
a198c71752 Merge "printf unification: floating point." 2023-05-12 20:15:02 +00:00
Elliott Hughes
1bfe534274 riscv64: don't use jalr when we can just say call.
We don't actually care about the length of this jump, and lld will relax
it to a jal when possible anyway. Better to have people copy & paste
call and tail than jal and j.

Test: treehugger
Change-Id: I889044b95fbb5567189a0d6ef31f81df0e0383cd
2023-05-12 12:56:54 -07:00
Shreshta Manu
56dba096a2 Merge "Revert "Nullability check for inet module."" 2023-05-12 18:20:56 +00:00
Zijun Zhao
07a2b29dd6 Revert "Nullability check for inet module."
This reverts commit 53dbd78ae0.

Reason for revert: Break build https://android-build.googleplex.com/builds/submitted/10125312/test_suites_x86_64_coverage/latest/view/logs/build_error.log?legacy

Change-Id: Ifccf22768b916d85263abb89b2b4223ae2ce5d80
2023-05-12 18:18:29 +00:00
Zijun Zhao
50d729b228 Merge "Nullability check for inet module." 2023-05-12 17:17:48 +00:00
Zijun Zhao
8e5e8ee14b Merge "Nullability check for if module." 2023-05-12 17:17:23 +00:00
Zijun Zhao
78b0558976 Merge "Nullability check for netdb module" 2023-05-12 00:21:24 +00:00
Elliott Hughes
531199c56c printf unification: floating point.
The only remaining differences between vfprintf.cpp and vfwprintf.cpp
after this are the wide/narrow conversions for %c, %m, and %s. I've used
"chars" and "bytes" for the named constants for the directions because
(a) I find -1 and 1 pretty confusing and (b) although "narrow" is the
obvious opposite of "wide", only Windows actually moved to wide
characters, so "narrow" (aka "multibyte", and probably "utf8") is the
default/normal case. Even though C confuses bytes and characters via its
`char` type, "bytes" versus "chars" seems like the appropriate
terminology (and it's what Java/Python use).

Also improve the swprintf tests assertion so failures are readable.

Test: treehugger
Change-Id: Ife8f70f65ec28d96058a7d68df353945524835d2
2023-05-11 16:51:13 -07:00
zijunzhao
53dbd78ae0 Nullability check for inet module.
Bugs: b/245972273
Test: adb shell
Change-Id: I51830ddbf5ceb7c02154bd335feb65ca1a230b66
2023-05-11 22:57:27 +00:00
zijunzhao
c741aea751 Nullability check for netdb module
Bugs: b/245972273
Test: adb shell
Change-Id: Id9b4338ca2f0fb64033c221f3bfb269ab930b79b
2023-05-11 21:31:42 +00:00
Elliott Hughes
0824e2cb84 Merge "riscv64: fix return value when errorno is 4095" 2023-05-11 17:58:00 +00:00
zijunzhao
87aae5309b Nullability check for if module.
Bugs: b/245972273
Test: adb shell
Change-Id: If6be7027e0ebdcf68ae4062c57e1c4e82a767abe
2023-05-11 17:15:57 +00:00
Mao Han
d4e662edab riscv64: fix return value when errorno is 4095
This issue was discovered by seccomp_seccomp_bpf_riscv_64 test.
Actual output:
[0]code=20 jt=00 jf=00 k=0000
[1]code=15 jt=00 jf=01 k=003F
[2]code=06 jt=00 jf=00 k=51000
[3]code=06 jt=00 jf=00 k=7FFF0000
ret=-4095, errno=0

Expected output:
[o]code=20 jt=00 jf=00 k=0000
[1]code=15 jt=00 jf=01 k=003F
[2]code=06 jt=00 jf=00 k=51000
[3]code=06 jt=00 jf=00 k=7FFF0000
ret=-1, errno=4095

Change-Id: Ieebf5f0d1e2f18e2887c463b58ef7ea05ea52898
Signed-off-by: Mao Han <han_mao@linux.alibaba.com>
Signed-off-by: haocheng.zy <zhangye@linux.alibaba.com>
2023-05-11 14:52:56 +08:00
Christopher Ferris
983292a972 Merge "Update to v6.3 kernel headers." 2023-05-10 23:28:53 +00:00
Treehugger Robot
d9fa32e99f Merge "More printf unification: FLUSH()." 2023-05-09 21:46:12 +00:00
Christopher Ferris
b7cef6d910 Update to v6.3 kernel headers.
Kernel headers coming from:

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

Test: Bionic unit tests pass.
Change-Id: I5270ef291a77343e47ef3a5fbd02b8cacf218ec5
2023-05-09 19:04:15 +00:00
Elliott Hughes
26a0ebd24b More printf unification: FLUSH().
wprintf doesn't need this (and already only has the iov stuff because
the non-wide printf implementation needs it), but we can further reduce
the diff between the two implementations by defining a no-op FLUSH() for
wide characters.

Test: treehugger
Change-Id: Ifefcb4b8474b086f995e2b0796f61558a19e2a42
2023-05-09 11:54:09 -07:00
Elliott Hughes
44befb2286 Merge "Clean up stdio snprintf()/swprintf() tests." 2023-05-09 18:15:16 +00:00
Treehugger Robot
68904aee7b Merge "Make fork equivalent to vfork when HWASan or MTE stack tagging is enabled." 2023-05-09 00:53:48 +00:00
Elliott Hughes
8fd4e96e2a Clean up stdio snprintf()/swprintf() tests.
This reduces the amount of boilerplate for these tests, and ensures that
we have a corresponding swprintf() test for every snprintf() test
(except the handful where it doesn't make sense; we have no FORTIFY for
the wide-character routine, for example).

Test: treehugger
Change-Id: I14091683494bbb414f1a72bddc9835b86ff62526
2023-05-08 17:31:40 -07:00
Peter Collingbourne
b6a592b25b Make fork equivalent to vfork when HWASan or MTE stack tagging is enabled.
Bug: 274056091
Change-Id: Iac029ca6b0e26f57f20c0a54822b75e3cae67344
2023-05-08 15:26:00 -07:00
Treehugger Robot
e60b4c7c2f Merge "Explain the header tests better." 2023-05-08 21:54:22 +00:00
Elliott Hughes
32c9572424 Explain the header tests better.
Bug: https://github.com/google/android-riscv64/issues/88
Test: N/A
Change-Id: Ia2a8673e96eb7aeb795fb7158f4814e5af9c8e94
2023-05-08 19:14:28 +00:00
Treehugger Robot
d16b682f0d Merge "doc: add desc for riscv together with other ARCHs" 2023-05-08 16:48:18 +00:00
Wang Chen
a6a9d5757e doc: add desc for riscv together with other ARCHs
Test: doc changes, no test required.

Change-Id: I30311d4edc12e623567b5622a65339fb61c9a5f3
Signed-off-by: Wang Chen <wangchen20@iscas.ac.cn>
2023-05-08 16:55:21 +08:00
Zijun Zhao
aaaf468370 Merge "Nullability check for uio module." 2023-05-04 20:52:09 +00:00
Elliott Hughes
e023a02cce Merge "<time.h>: change the new C23 TIME_ constants." 2023-05-04 17:35:17 +00:00
zijunzhao
d633600d1c Nullability check for uio module.
Bugs: b/245972273
Test: adb shell
Change-Id: I132f618c50f7b7a3f9b9ef26c9ac1a87a97a1b78
2023-05-04 17:13:15 +00:00
Elliott Hughes
1dff230f75 Merge "syslog.h: implement LOG_PERROR." 2023-05-04 15:09:51 +00:00
Elliott Hughes
7db0a6cc5f <time.h>: change the new C23 TIME_ constants.
Jens Gustedt suggested a better implementation last year on the musl
mailing list: https://www.openwall.com/lists/musl/2022/11/19/1

It means the constants are sparse, but in return it means we can add
future constants and they'll be backward compatible. (Sadly you'll need
to be on API level 35 before you can use anything but TIME_UTC.)

I doubt this will ever matter, because everyone should just stick to
clock_gettime()/clock_getres() anyway, and anyone who does have a
legitimate use for timespec_get() and timespec_getres() probably needs
to support non-Linux and so can't use any clocks that aren't in ISO C
anyway. But given that we don't _have_ to paint ourselves into a corner
here, we may as well take the opportunity to not do so.

Test: strace
Change-Id: I293d32fcbcf7f6703564dac0978ae2a10192a482
2023-05-03 15:37:46 -07:00
Elliott Hughes
9118450303 Merge "Add an enum for the riscv64 <sys/ucontext.h> register constants." 2023-05-03 21:43:24 +00:00
Elliott Hughes
213d943a33 syslog.h: implement LOG_PERROR.
This is the one openlog() flag that toybox uses. We should probably try
to unify toybox's POSIX logger and Android-specific log at some point,
and this will help.

Also fix our behavior with an empty format string, noticed while adding
tests.

Test: treehugger
Test: adb shell logger -s foo
Change-Id: Ic027e78a460be3db83cc4c6f9946c9efa22be6e1
2023-05-03 14:19:40 -07:00
Elliott Hughes
7fc63f2c9a Add an enum for the riscv64 <sys/ucontext.h> register constants.
That lets us have idempotent #defines to reduce namespace pollution.

Bug: http://b/279405445
Test: treehugger
Change-Id: I00312cc8911025696cf0eea2d70e3219ab361613
2023-05-03 17:45:41 +00:00
Treehugger Robot
e61cf18c3c Merge "Nullability check for get_device_api_level_inlines module." 2023-05-03 02:06:08 +00:00
Treehugger Robot
ebd654640a Merge "Implement C23 printf 'wf' length modifiers" 2023-05-02 23:44:37 +00:00
zijunzhao
136e28fa8b Nullability check for get_device_api_level_inlines module.
Bugs: b/245972273
Test: adb shell
Change-Id: I49d64a12b542c8f3723f89531c63d10b84d16d26
2023-05-02 23:36:34 +00:00
zijunzhao
1fdece95d3 Implement C23 printf 'wf' length modifiers
wfN: Specifies that a following b, d, i, o, u, x, or X conversion specifier applies to a fastest minimum-width integer argument with a specific width where N is a positive decimal integer with no leading zeros (the argument will have been promoted according to the integer promotions, but its value shall be converted to the unpromoted type); or that a following n conversion specifier applies to a pointer to a fastest minimum-width integer type argument with a width of N bits. All fastest minimum-width integer types (7.22.1.3) defined in the header <stdint.h> shall be supported. Other supported values of N are implementation-defined.

Bug: b/271903607
Test: adb shell
Change-Id: Ida36d5a50af2a46fd04cb5fe039793d8872f9f3b
2023-05-02 21:06:09 +00:00
Elliott Hughes
721b93d7ec Merge "Fix the WIFSTOPPED definition." 2023-05-02 14:40:15 +00:00
Elliott Hughes
2b8ca55d14 Fix the WIFSTOPPED definition.
Although this breaks job control in several shells (including mksh),
this has been broken since the initial commit and no-one's noticed until
now.

Bug: https://github.com/android/ndk/issues/1878
Test: treehugger
Change-Id: Id7c4805965c5e5847db99b57df1af13355adcc22
2023-05-01 19:48:12 +00:00