[llvm-dev] RFC: Extend UBSan with qsort checks

Paul Pluzhnikov via llvm-dev llvm-dev at lists.llvm.org
Wed Jan 13 23:06:30 PST 2016


On Wed, Jan 13, 2016 at 10:37 PM, Yuri Gribov <tetra2005 at gmail.com> wrote:

> I'm afraid it's even N^3 (with N=32 cap). This indeed sounds scary but
> I have not seen significant slowdowns when running instrumented
> distro.

Have you looked at how many sort invocations there are, and what their
size distribution is?

Perhaps naively, I expect very few sort()s to be performed in day to
day distro operation, and even fewer sort()s with more than 20
elements.

> Right, I thought about improving this with testing random 32 elements
> instead of the first ones.

That has its own disadvantages: it makes the failure detection
non-repeatable, and makes it harder to understand the conditions under
which the predicate is broken.

-- 
Paul Pluzhnikov


More information about the llvm-dev mailing list