David Justo
2dc22615fd
[ASan] Honor allocator_may_return_null when set through user-function and fix large alloc edge case ( #117929 )
...
**Related:** #117925
**About this PR:**
This PR performs 3 small but related fixes for ASan users on Windows:
1. It ensures that the `allocator_may_return_null` flag is honored when
set through the user function `__asan_default_options`. For more
details, please see: #117925
2. It adds a missing `AllocatorMayReturnNull()` check inside
`InternalAlloc` that's needed to avoid error'ing out when the allocator
_correctly_ returns `null` when `allocator_may_return_null` is set.
3. In `sanitizer_win`'s `ReturnNullptrOnOOMOrDie`, it allows returning
`null` when the last error is set to `ERROR_INVALID_PARAMETER` which may
be set by `VirtualAlloc` on WIndows when attempting to allocate
exceedingly large memory.
I've added test cases that should cover these new behaviors. Happy to
take on any feedback as well. Thank you :-)
---------
Co-authored-by: David Justo <dajusto@microsoft.com>
2024-12-11 10:21:35 +01:00
..
2024-09-09 13:41:08 -07:00
2023-04-21 21:25:49 +08:00
2024-12-11 10:21:35 +01:00
2023-04-21 21:25:49 +08:00
2023-04-21 21:25:49 +08:00
2024-05-22 17:47:20 -07:00
2023-04-21 21:25:49 +08:00
2023-04-21 21:25:49 +08:00
2024-05-22 17:47:20 -07:00
2024-05-22 17:47:20 -07:00
2024-05-22 17:47:20 -07:00
2023-04-10 23:21:16 +08:00
2023-04-21 21:25:54 +08:00
2024-10-20 22:56:41 +03:00
2023-04-21 21:49:05 +08:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2024-08-23 23:29:09 -07:00
2024-03-15 10:42:21 -07:00
2024-03-15 10:42:21 -07:00
2023-05-29 22:49:34 +03:00
2023-05-25 17:54:50 +02:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2024-03-15 10:42:21 -07:00
2024-03-15 10:42:21 -07:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2024-08-23 23:29:09 -07:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2024-09-09 13:41:08 -07:00
2023-12-01 22:28:12 +00:00
2024-09-09 13:41:08 -07:00
2022-09-06 13:25:15 -07:00
2023-04-21 21:25:49 +08:00
2023-04-21 21:25:49 +08:00
2024-08-23 23:29:09 -07:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2023-04-21 21:25:49 +08:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2023-04-21 21:25:49 +08:00
2023-04-21 21:25:49 +08:00
2023-04-21 21:25:49 +08:00
2023-05-25 17:54:50 +02:00
2024-03-13 16:11:21 -07:00
2023-04-21 21:25:49 +08:00
2024-03-13 15:34:12 -07:00
2023-05-25 11:17:05 +02:00
2024-09-09 13:41:08 -07:00
2024-09-09 13:41:08 -07:00
2024-09-09 13:41:08 -07:00
2024-08-08 00:17:19 -07:00
2023-04-21 21:25:49 +08:00
2023-12-01 22:28:12 +00:00
2023-12-01 22:28:12 +00:00
2023-12-01 22:28:12 +00:00
2023-12-01 22:28:12 +00:00
2023-12-01 22:28:12 +00:00
2023-12-01 22:28:12 +00:00
2023-12-01 22:28:12 +00:00
2023-12-01 22:28:12 +00:00
2023-04-21 21:25:49 +08:00
2024-09-09 13:41:08 -07:00
2024-09-09 13:41:08 -07:00
2024-09-09 13:41:08 -07:00
2023-05-16 19:53:49 +08:00
2023-04-02 15:37:27 +08:00
2024-08-08 00:17:19 -07:00
2024-08-23 23:29:09 -07:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2023-05-16 19:53:49 +08:00
2023-04-21 21:25:49 +08:00
2023-04-21 21:25:54 +08:00
2023-04-21 21:25:49 +08:00
2023-04-21 21:25:49 +08:00
2023-04-21 21:25:49 +08:00
2023-05-16 19:53:49 +08:00
2024-09-09 13:41:08 -07:00
2023-04-21 21:25:49 +08:00
2023-04-21 21:25:49 +08:00
2023-04-21 21:25:49 +08:00
2023-04-21 21:25:49 +08:00
2023-04-21 21:25:49 +08:00
2023-04-21 21:25:49 +08:00
2024-09-09 13:41:08 -07:00
2024-09-09 13:41:08 -07:00
2023-05-16 19:53:49 +08:00
2023-04-21 21:25:49 +08:00
2023-12-01 22:28:12 +00:00
2023-04-21 21:25:49 +08:00