Commit graph

1029 commits

Author SHA1 Message Date
Sijie Chen
75ed08fb0b [Berberis][CrashReporting] Add riscv case for thread local retrieve
As title.

Bug: 339287219
Test: NA
Change-Id: Ia75659330d1203f4f1fbaf019d41cb72c3986cd4
2024-05-23 17:11:47 +00:00
Treehugger Robot
e77a69d0b1 Merge "No longer require root for PermissiveMteTest" into main 2024-05-20 12:41:30 +00:00
Elliott Hughes
aed74bad41 Remove stray semicolon.
Change-Id: Ic50a84888a7e0c059b4c06716e20e5f120b9b343
2024-05-17 11:31:36 +00:00
Florian Mayer
c4b24f70e6 cleanup: PLOG(FATAL) crashes, does not need else branch
Change-Id: I49a439d444dc9f566a05bab23d8cfd06ce56d4a6
2024-05-16 22:59:16 +00:00
Treehugger Robot
57db6f453c Merge "crasher: hide xom from help when unavailable" into main 2024-05-16 22:36:33 +00:00
Florian Mayer
2df897c1fc No longer require root for PermissiveMteTest
We can now read tombstones as shell user

Change-Id: I2371360e87dc186f37c2d13ebae28b57abe76845
2024-05-16 21:33:51 +00:00
Josh Gao
3a9a989484 crasher: hide xom from help when unavailable
Test: m crasher
Change-Id: Iaf25dd650eb5cf6e8b0933f574b3d4a208b74da9
2024-05-16 13:53:02 -07:00
Sijie Chen
c8027933b3 Reland "[Berberis][CrashReporting] Dump guest thread inf..."
Guest thread information will print out follow host thread.

Revert submission 3081452-revert-3062926-CJGHTRPCBP

Reason for revert: Will make the change base on the original CLs for a reland.

Bug: b/321799516
Test: riscv64, checked tombstone file has wanted block.
https://paste.googleplex.com/6282302317658112
Added arm64 support and tested arm64 unwinding in internal repo.
https://paste.googleplex.com/6545612887818240

Change-Id: Ie54ad6f359d60283442adfcd9ee95f5a116e4b72
2024-05-14 21:28:39 +00:00
Sijie Chen
cb53fe136b Reland "[Berberis][CrashReporting] Extend ThreadInfo to ..."
Revert submission 3081452-revert-3062926-CJGHTRPCBP

Reason for revert: Will make the change base on the original CLs for a reland.

(Original CL commit message)
This CL is to get guest registers information.

Bug: b/321799516
Test: m
Testing for TLS Slot:
Manual testing by: 1. crash the jni tests to produce tombstones file 2.
get the signature field of guest state header 3. verified it is the same
value as NATIVE_BRIDGE_GUEST_STATE_SIGNATURE

Manual test the arm64 by: 1. flash build to pixel phone and verify
retrieving TLS_SLOT_THREAD_ID's tid field is the same as current thread
id.

Testing for register values:
Test and print out registers values for riscv64, looks make sense that
has null zero value slots.

Change-Id: Ieebf845bff517380ee07fac77f24b48efeb53521
2024-05-14 21:28:32 +00:00
Dimitry Ivanov
9fbd7e1026 Merge changes from topic "revert-3062926-CJGHTRPCBP" into main
* changes:
  Revert "[Berberis][CrashReporting] Extend ThreadInfo to have gue..."
  Revert "[Berberis][CrashReporting] Dump guest thread info to tom..."
2024-05-10 16:14:06 +00:00
Dimitry Ivanov
cdf499f9cd Revert "[Berberis][CrashReporting] Extend ThreadInfo to have gue..."
Revert submission 3062926

Reason for revert: We want guest state to be present in all threads - revert to be able to fix the proto field type.

Reverted changes: /q/submissionid:3062926

Change-Id: I32b745cca95a619b78bdce0a7d948ac479d42f21
2024-05-10 10:02:07 +00:00
Dimitry Ivanov
899c1bdfa1 Revert "[Berberis][CrashReporting] Dump guest thread info to tom..."
Revert submission 3062926

Reason for revert: We want guest state to be present in all threads - revert to be able to fix the proto field type.

Reverted changes: /q/submissionid:3062926

Change-Id: I87b282a0d9caebe4eae2e7d8eca8ec8ebaa3eca6
2024-05-10 10:02:07 +00:00
Sijie Chen
a6e1ac8efe Merge changes from topic "berberis-crash-reporting-guest_regs" into main
* changes:
  [Berberis][CrashReporting] Dump guest thread info to tombstone file
  [Berberis][CrashReporting] Extend ThreadInfo to have guest registers
2024-05-09 22:16:44 +00:00
Sijie Chen
4c3a9dfd2f [Berberis][CrashReporting] Dump guest thread info to tombstone file
As title.

Bug: b/321799516
Test: riscv64, checked tombstone file has wanted block.
https://paste.googleplex.com/5958508322750464
Added arm64 support and tested arm64 unwinding in internal repo.
https://paste.googleplex.com/6545612887818240

Change-Id: I4e8a3414d0198de88a577ef4d5672a9ad0286fc5
2024-05-09 20:21:16 +00:00
Sijie Chen
3ff250f6d7 [Berberis][CrashReporting] Extend ThreadInfo to have guest registers
This CL is to get guest registers information.

Bug: b/321799516
Test: m
Testing for TLS Slot:
Manual testing by: 1. crash the jni tests to produce tombstones file 2.
get the signature field of guest state header 3. verified it is the same
value as NATIVE_BRIDGE_GUEST_STATE_SIGNATURE

Manual test the arm64 by: 1. flash build to pixel phone and verify
retrieving TLS_SLOT_THREAD_ID's tid field is the same as current thread
id.

Testing for register values:
Test and print out registers values for riscv64, looks make sense that
has null zero value slots.

Change-Id: Iff44ac5c2b202e44f3fb4e6909fbea141e54ae6b
2024-05-09 18:28:30 +00:00
Christopher Ferris
0455ca3e09 Merge "Clean up usage of 32 bit/64 bit checks." into main 2024-05-08 20:06:18 +00:00
Christopher Ferris
2f77c2a516 Clean up usage of 32 bit/64 bit checks.
Rather than have to create a number of #if defines for the memory
dumping parts of the tombstone, create a single function to generate
these strings for the memory tests.

Make CrasherTest.smoke use a regex that passes on 32 bit and 64 bit.

Make the tests page size agnostic.

Bug: 339017792

Test: Treehugger.
Test: Ran 32 bit and 64 bit versions of tests on a real device.
Test: Ran on the aosp_cf_x86_64_phone_pgagnostic-trunk_staging-userdebug
Change-Id: If9365061b85de23b00a1bf947d85923cde06c068
2024-05-07 15:30:47 -07:00
Devin Moore
87ff7115ef Merge "Add page size info to tombstone" into main 2024-05-07 19:55:51 +00:00
Devin Moore
4647b6b305 Add page size info to tombstone
Now that Android devices can use 16k page size, it's important that we
know what configuration the device is in when see issues.

1) If the device is in 4k mode, we see nothing new.

2) If the device is in 16k mode, we see this line in the tombstones:

Page size: 16

3) If the device is in 4k mode, but was previous in 16k mode we see:

Has been in 16kb mode: yes

Test: atest debuggerd_test
Test: atest debuggerd_test with ro.misctrl.16kb_before="1"
Test: adb shell cat /data/tombstones/tombstone_00
Bug: 335247092
Change-Id: If7ca3b0954a01070ff413758296460ca1d023ca5
2024-05-06 22:20:04 +00:00
Christopher Ferris
94c9cb6447 Merge "Replace malloc_not_svelte with malloc_low_memory." into main 2024-05-06 19:45:05 +00:00
Christopher Ferris
92e3fd78ad Merge "Make sure debuggerd_test is run on device." into main 2024-05-02 21:35:40 +00:00
Xiaohui Niu
7bfbe41714 Fix fallback signal issue.
Add signo for target thread in fallback path;
Update test for seccomp tombstone thread abort.

Bug: 336946834

Test: debuggerd_test
Test: Send fatal signal to process with NO_NEW_PRIVS
Change-Id: Ie9d77a93da9cd89ab7093b8949f311e03d96ec50
2024-04-30 21:22:31 +08:00
Christopher Ferris
1c46a00865 Replace malloc_not_svelte with malloc_low_memory.
The malloc_not_svelte variable name is confusing and makes the
low memory config the default. Change this so that the default is
the regular allocator, and that Malloc_low_memory is used to enable
the low memory allocator.

Update blueprint rules so that scudo is the default action.

Test: Verified scudo config is used by default.
Test: Verfified Android GO config uses the jemalloc low memory config.
Change-Id: Ie7b4b005a6377e2a031bbae979d66b50c8b3bcdb
2024-04-26 13:33:26 -07:00
Christopher Ferris
c76a8937b0 Make sure debuggerd_test is run on device.
Tests starting failing on aarch64, so force presubmit to run the
debuggerd tests on device to close this coverage hole.

Test: Treehugger and verify tests are run on device.
Change-Id: Ie40eab35e46cefd3cebc132d9c0a3d1ebdb0d766
2024-04-25 13:57:52 -07:00
Florian Mayer
2d45331a9e Avoid confusing main_thread name
It is not in fact the main thread of the process, but the thread that crashed

Change-Id: I3af6d0ffc6c0617526a9cbeb36b2a3286aaeb6f6
2024-04-22 23:43:59 +00:00
Florian Mayer
9216490321 Temporarily disable mte_illegal_setjump
Change-Id: I39a770196a79488160b50d7de4c3baa39dd1c57e
2024-04-10 20:24:56 +00:00
Mitch Phillips
b8a10dca87 Merge "[GWP-ASan] [debuggerd] Change test to handle default recoverable" into main 2024-04-10 09:30:58 +00:00
Mitch Phillips
a2f5335b84 [GWP-ASan] [debuggerd] Change test to handle default recoverable
Test: atest debuggerd_test
Bug: N/A
Change-Id: I01d79b0058c5c2b5ff0697be69b252728d46a82e
2024-04-09 15:59:12 +02:00
Elliott Hughes
dbb87ec8a7 Fix typo in comment.
Change-Id: I1d7e061cf7578d88987d16aa1684d94967af09f7
2024-04-03 16:44:22 +00:00
Peter Collingbourne
7285c0d1bb tombstoned: Rename proto tombstone before text tombstone.
Because the log message "Tombstone written to: $NAME" is written
before renaming the proto tombstone, it is possible that a tool that
automatically downloads new proto tombstones by watching for this
log message will fail to download the tombstone. For the tool that
I am developing, this occurs < 0.1% of the time. Fix the issue by
renaming the proto tombstone first.

Bug: 328531087
Change-Id: I5b751585f2fce897ca7eb76c0466a0c33a93d851
2024-03-21 18:28:08 -07:00
Mitch Phillips
da9ec0cd05 Merge "[MTE] Implement permissive (recoverable) MTE for apps" into main 2024-03-19 19:06:13 +00:00
Florian Mayer
effe539c30 Merge "Do not chmod ANRs" into main 2024-03-19 18:25:42 +00:00
Elliott Hughes
0fee60a79a Merge "Use _Fork()." into main 2024-03-19 14:48:20 +00:00
Mitch Phillips
31407917f8 [MTE] Implement permissive (recoverable) MTE for apps
Extends the recoverable native crash handling support to also allow for
MTE crashes to be recovered from in apps. Backs onto the existing
GWP-ASan recoverable handling.

At least for system/core, I've renamed the (now) generic "recoverable
crash" variables to remove the notion of GWP-ASan.

Permissive MTE should no longer crash an app, and crashes are still
visible in the AppExitInfo API and tombstones.

Test: atest CtsTaggingHostTestCases
Bug: 328793166
Change-Id: I4c6ffa85af0e0d9b72d0ccd606bb6e1ca464cfff
2024-03-19 11:26:02 +01:00
Florian Mayer
e95d781041 Do not chmod ANRs
The code was only meant for native tombstones. It might be a good idea
to make ANRs also readable by shell / adb, but in that case we have to
do more changes to make sure all files in /data/anr are. We can revert
if we implement that

Test: m
Bug: 329827513
Change-Id: Ic98c452ca500fe766a70173bef4ac1ea57438989
2024-03-18 17:19:51 -07:00
Florian Mayer
c923ea5a6d Merge "Update test for more accurate memtag_handle_longjmp" into main 2024-03-12 18:12:46 +00:00
Florian Mayer
1fef1b1359 Update test for more accurate memtag_handle_longjmp
Change-Id: Ie5482d343c37ee8cf57a8ce105a0c8a363e5761e
2024-03-07 17:12:57 -08:00
Treehugger Robot
98c2d78b4f Merge "Revert^2 "Add TEST_MAPPING for debuggerd CTS"" into main 2024-03-05 18:55:59 +00:00
Florian Mayer
e6462f91c2 Add test for invalid setjmp in MTE
BYPASS_INCLUSIVE_LANGUAGE_REASON=man is for manpage

Test: atest debuggerd_test
Change-Id: I774095b79baadb4f692f4b97b47df80e635e3a1c
2024-03-04 12:17:19 -08:00
Florian Mayer
b7e9941744 Revert^2 "Add TEST_MAPPING for debuggerd CTS"
This reverts commit aa48834485.

Reason for revert: fixed in https://r.android.com/2985051

Change-Id: I76a53df9fb585d90778019e74472ad294963a91c
2024-03-01 01:52:23 +00:00
Elliott Hughes
06053405e9 Use _Fork().
POSIX issue 8 has a standard way to avoid pthread_atfork() handlers.

Change-Id: I801c55dc3fb9e14cc03f854992d60872c5468ab5
2024-02-29 23:02:38 +00:00
Ryan Prichard
bc227038c0 debuggerd_test: fix invalid regexs
\(fault address prefixed with --->)

should be

    \(fault address prefixed with --->\)

Test: debuggerd_test
Bug: 175635923
Bug: 327668317
Change-Id: I03bf8969e9818956ae79b916ab852efaf4f2f78a
2024-02-29 14:40:57 -08:00
Oluwarotimi Adesina
aa48834485 Revert "Add TEST_MAPPING for debuggerd CTS"
This reverts commit d059478ee1.

Reason for revert: Potential culprit for b/327525776- verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: I4b713aa46b2869a677a210cfce6ae880366b045e
2024-02-29 15:10:09 +00:00
Florian Mayer
d685442133 Merge "Add TEST_MAPPING for debuggerd CTS" into main 2024-02-29 02:29:09 +00:00
Florian Mayer
d059478ee1 Add TEST_MAPPING for debuggerd CTS
Change-Id: I3bba97e7a0a2b053c6d5577496efa2dca29035d4
2024-02-28 11:12:58 -08:00
Elliott Hughes
77a80d1744 Merge "Remove support for Linux before 3.11 (without O_TMPFILE)." into main 2024-02-27 16:14:52 +00:00
Elliott Hughes
aa1d18a59b Remove support for Linux before 3.11 (without O_TMPFILE).
We don't support kernels that old any more.

Test: treehugger
Change-Id: Ia664de6921901dec54644cff9f51e8514258e257
2024-02-27 16:14:12 +00:00
Christopher Ferris
2bf7db3de0 Format all of the blueprint files.
I'm tired of seeing the bpfmt warning, so fix this for all debuggerd
blueprint files.

Test: Compiles
Change-Id: I3b25365a7272aebe9cbac28455cf8b9b86b04c6e
2024-02-26 13:34:38 -08:00
Florian Mayer
d3fb7a6355 Merge "Make tombstones 664." into main 2024-02-26 21:12:25 +00:00
Florian Mayer
877d1f6694 Make tombstones 664.
They are still restricted by SELinux, and apps still cannot open them
because they don't have `open` SELinux permission.

Bug: 312740614
Change-Id: I83b7e6ed39f5af64f161af3b3e8e33af0d125b20
2024-02-23 15:31:30 -08:00