3 Commits

Author SHA1 Message Date
Christopher Ferris
1949f7d6c9
[scudo] Clean up string handling (#86364)
Do not abort if a vector cannot increase its own capacity. In that case,
push_back calls silently fail.

Modify the ScopedString implementation so that it no longer requires two
passes to do the format. Move the helper functions to be private member
functions so that they can use push_back directly. This allows the
capacity to be increased under the hood and/or silently discards data if
the capacity is exceeded and cannot be increased.

Add new tests for the Vector and ScopedString for capacity increase
failures.

Doing this so that if a map call fails, and we are attempting to write
an error string, we can still get some of the message dumped. This also
avoids crashing in Scudo code, and makes the caller handle any failures.
2024-03-26 14:47:48 -07:00
Fabio D'Urso
558ab65325 [scudo] Select stricter atomic memory_order in MemMapFuchsia
Previously, all operations were relaxed except for the
atomic_compare_exchange call, which was implicitly acquire (but did not
compile anymore because of the changes in commit
3ef766addadd8324f58c0fda0301edcde2185cb3).

In addition to making MemMapFuchsia compile again, this CL selects
memory_order values that better express the intent of the code.

Reviewed By: Chia-hungDuan

Differential Revision: https://reviews.llvm.org/D157097
2023-08-04 18:22:44 +02:00
Fabio D'Urso
3003da7154 [scudo] Implement Fuchsia backend for the new MemMap API
Reviewed By: Caslyn, Chia-hungDuan

Differential Revision: https://reviews.llvm.org/D153888
2023-07-05 14:07:37 +02:00