Adhemerval Zanella
c8e73a1492
stdlib: Fix qsort memory leak if callback throws (BZ 32058)
...
If the input buffer exceeds the stack auxiliary buffer, qsort will
malloc a temporary one to call mergesort. Since C++ standard does
allow the callback comparison function to throw [1], the glibc
implementation can potentially leak memory.
The fixes uses a pthread_cleanup_combined_push and
pthread_cleanup_combined_pop, so it can work with and without
exception enables. The qsort code path that calls malloc now
requires some extra setup and a call to __pthread_cleanup_push
anmd __pthread_cleanup_pop (which should be ok since they just
setup some buffer state).
Checked on x86_64-linux-gnu.
[1] https://timsong-cpp.github.io/cppwp/n4950/alg.c.library#4
Reviewed-by: DJ Delorie <dj@redhat.com >
2025-04-02 18:01:55 +00:00
..
2025-01-01 11:22:09 -08:00
2022-01-17 23:18:27 +00:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-03-02 15:37:33 +01:00
2023-05-01 13:36:14 +02:00
2020-01-04 19:37:53 +01:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-02-10 01:39:17 +01:00
2025-02-10 01:39:17 +01:00
2025-02-10 01:39:17 +01:00
2025-02-10 01:39:17 +01:00
2025-02-10 01:18:17 +01:00
2025-02-10 01:39:17 +01:00
2025-02-10 01:18:56 +01:00
2025-02-10 01:39:17 +01:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-03-02 15:37:33 +01:00
2025-02-16 23:43:04 +01:00
2025-02-16 23:42:38 +01:00
2025-02-16 23:43:03 +01:00
2025-02-16 23:08:54 +01:00
2025-02-16 23:08:54 +01:00
2025-02-16 23:08:54 +01:00
2025-02-16 22:59:34 +01:00
2025-02-16 22:59:34 +01:00
2025-02-16 23:08:54 +01:00
2025-02-16 23:08:54 +01:00
2025-02-16 22:59:16 +01:00
2025-02-16 22:59:25 +01:00
2025-02-16 22:59:07 +01:00
2025-02-16 22:59:25 +01:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2021-06-24 10:04:41 -03:00
2025-02-16 23:08:54 +01:00
2025-01-01 11:22:09 -08:00
2025-04-02 18:01:55 +00:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-01 11:22:09 -08:00
2025-01-29 02:32:36 +01:00
2025-01-01 11:22:09 -08:00
2024-03-23 22:48:44 +01:00