platform_system_core/debuggerd/libdebuggerd
Christopher Ferris 98d6242dc7 Limit the number of log messages in a tombstone.
Some testing environments can have a test that is sending many
thousands of messages to the log. When this type of process crashes
all of these log messages are captured and can cause OOM errors
while creating the tombstone.

Added a test to verify the log messages are truncated. Leaving this
test disabled for now since it is inherently flaky due to having to
assume that 500 messages are in the log.

Added a test for a newline in a log message since it's somewhat
related to this change.

NOTE: The total number of messages is capped at 500, but if a message
contains multiple newlines, the total messages will exceed 500.
Counting messages this way seems to be in the spirit of the cap,
that a process logging a large message with multiple newlines does
not completely fill the tombstone log data.

Bug: 269182937
Bug: 282661754

Test: All unit tests pass.
Test: The disabled max_log_messages test passes.
Change-Id: If18e62b29f899c2c4670101b402e37762bffbec6
2023-05-24 20:10:55 +00:00
..
include/libdebuggerd Remove floating point register cruft. 2023-03-17 00:38:26 +00:00
test Fix scudo MTE tests. 2022-06-30 18:54:19 -07:00
backtrace.cpp Use the new AndroidUnwinder object. 2022-05-12 15:18:46 -07:00
gwp_asan.cpp Pass fault address to GWP-ASan's changed API. 2023-01-12 09:48:11 -08:00
open_files_list.cpp libdebuggerd: decode fdsan owner tags. 2018-08-28 13:48:08 -07:00
scudo.cpp Handle scudo_ring_buffer_size = 0 2023-01-12 16:06:10 -08:00
tombstone.cpp Remove unnecessary logging. 2022-10-27 17:56:27 -07:00
tombstone_proto.cpp Limit the number of log messages in a tombstone. 2023-05-24 20:10:55 +00:00
tombstone_proto_to_text.cpp Print number of frames 2023-04-06 23:38:40 +00:00
utility.cpp Remove floating point register cruft. 2023-03-17 00:38:26 +00:00