forked from OSchip/llvm-project
8803ebcf3b
When the FreeBSD qsort() implementation recurses, it does so using an interposable function call, so we end up calling the interceptor again and set the saved comparator to wrapped_qsort_compar. This results in an infinite loop and a eventually a stack overflow since wrapped_qsort_compar ends up calling itself. This means that ASAN is completely broken on FreeBSD for programs that call qsort(). I found this while running check-all on a FreeBSD system a ASAN-instrumented LLVM. Fix this by checking whether we are recursing inside qsort before writing to qsort_compar. The same bug exists in the qsort_r interceptor, so use the same approach there. I did not test the latter since the qsort_r function signature does not match and therefore it's not intercepted on FreeBSD/macOS. Fixes https://llvm.org/PR46832 Reviewed By: eugenis Differential Revision: https://reviews.llvm.org/D84509 |
||
---|---|---|
.. | ||
TestCases | ||
Unit | ||
android_commands | ||
ios_commands | ||
netbsd_commands | ||
CMakeLists.txt | ||
lit.common.cfg.py | ||
lit.site.cfg.py.in | ||
print_address.h | ||
sanitizer_ucontext.h |