cbcfe28f9d
This causes problems when using ASAN with a runtime older than 12.0 since the intercept does not expect qsort() to call itself using an interposable function call. This results in infinite recursion and stack exhaustion when a binary compiled with -fsanitize=address calls qsort. See also https://bugs.llvm.org/show_bug.cgi?id=46832 and https://reviews.llvm.org/D84509 (ASAN runtime patch). To prevent this problem, this patch uses a static helper function for the actual qsort() implementation. This prevents interposition and allows for direct calls. As a nice side-effect, we can also move the qsort_s checks to the top-level function and out of the recursive calls. Reviewed By: kib Differential Revision: https://reviews.freebsd.org/D28133 |
||
---|---|---|
.. | ||
jemalloc | ||
_Exit.c | ||
a64l.3 | ||
a64l.c | ||
abort.3 | ||
abort.c | ||
abs.3 | ||
abs.c | ||
alloca.3 | ||
at_quick_exit.3 | ||
atexit.3 | ||
atexit.c | ||
atexit.h | ||
atof.3 | ||
atof.c | ||
atoi.3 | ||
atoi.c | ||
atol.3 | ||
atol.c | ||
atoll.c | ||
bsearch_b.c | ||
bsearch.3 | ||
bsearch.c | ||
cxa_thread_atexit_impl.c | ||
cxa_thread_atexit.c | ||
div.3 | ||
div.c | ||
exit.3 | ||
exit.c | ||
getenv.3 | ||
getenv.c | ||
getopt_long.3 | ||
getopt_long.c | ||
getopt.3 | ||
getopt.c | ||
getsubopt.3 | ||
getsubopt.c | ||
hcreate_r.c | ||
hcreate.3 | ||
hcreate.c | ||
hdestroy_r.c | ||
heapsort_b.c | ||
heapsort.c | ||
hsearch_r.c | ||
hsearch.h | ||
imaxabs.3 | ||
imaxabs.c | ||
imaxdiv.3 | ||
imaxdiv.c | ||
insque.3 | ||
insque.c | ||
l64a.c | ||
labs.3 | ||
labs.c | ||
ldiv.3 | ||
ldiv.c | ||
llabs.3 | ||
llabs.c | ||
lldiv.3 | ||
lldiv.c | ||
lsearch.3 | ||
lsearch.c | ||
Makefile.inc | ||
memory.3 | ||
merge.c | ||
mergesort_b.c | ||
ptsname.3 | ||
ptsname.c | ||
qsort_r.c | ||
qsort_s.c | ||
qsort.3 | ||
qsort.c | ||
quick_exit.3 | ||
quick_exit.c | ||
radixsort.3 | ||
radixsort.c | ||
rand.3 | ||
rand.c | ||
random.3 | ||
random.c | ||
random.h | ||
reallocarray.3 | ||
reallocarray.c | ||
reallocf.3 | ||
reallocf.c | ||
realpath.3 | ||
realpath.c | ||
remque.c | ||
set_constraint_handler_s.3 | ||
set_constraint_handler_s.c | ||
strfmon.3 | ||
strfmon.c | ||
strtod.3 | ||
strtoimax.c | ||
strtol.3 | ||
strtol.c | ||
strtold.c | ||
strtoll.c | ||
strtonum.3 | ||
strtonum.c | ||
strtoq.c | ||
strtoul.3 | ||
strtoul.c | ||
strtoull.c | ||
strtoumax.c | ||
strtouq.c | ||
Symbol.map | ||
system.3 | ||
system.c | ||
tdelete.c | ||
tfind.c | ||
tsearch_path.h | ||
tsearch.3 | ||
tsearch.c | ||
twalk.c |