rustc SIGILL since qsort_r patches

Florian Weimer fweimer@redhat.com
Fri Nov 17 13:57:25 GMT 2023


* Florian Weimer:

> * Adhemerval Zanella Netto:
>
>> Indeed introsort is slower than the previous mergesort, but are you sure
>> is is quadratic?  Could you share the input that is triggering wrong 
>> behavior, I will try to improve testing to catch it.
>
> Try this input array:
>
> 0, 94, 2, 50, 4, 74, 6, 52, 8, 86, 10, 54, 12, 76, 14, 56, 16, 92, 18,
> 58, 20, 78, 22, 60, 24, 88, 26, 62, 28, 80, 30, 64, 32, 96, 34, 66, 36,
> 82, 38, 68, 40, 90, 42, 70, 44, 84, 46, 72, 48, 1, 3, 5, 7, 9, 11, 13,
> 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49,
> 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85,
> 87, 89, 91, 93, 95, 97, 98, 99
>
> I count 2645 comparisons.
>
> This is unrelated to the heapsort bugs, for which I have a fix.  The
> heapsort function isn't even called.
>
> The bulk of the comparisons happen before the insertion sort phase,
> which looks correct, so the handover to heapsort for adversarial input
> isn't happening.

Depth decrement is missing when descending into the companion partition
of a small partition.

Fixing that exposes more heap sort problems unfortunately.  Looking …

Thanks,
Florian



More information about the Libc-alpha mailing list