rustc SIGILL since qsort_r patches

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Tue Nov 7 13:26:07 GMT 2023



On 07/11/23 10:13, Florian Weimer wrote:
> * Florian Weimer:
> 
>> I'm not sure where equal-pointers call happens, but why wouldn't
>> something like this be an overall win?
>>
>>   while (k <= n / 2)
>>     {
>>       size_t j = 2 * k;
>>       if (j < n && cmp (base + (j * size), base + ((j + 1) * size), arg) < 0)
>>       j++;
>>
>> +     if (k ==j)
>> +       continue;
> 
> That should be a break, not a continue.
> 
>>       if (cmp (base + (k * size), base + (j * size), arg) >= 0)
>>         break;
>>
>>       do_swap (base + (size * j), base + (k * size), size, swap_type);
>>       k = j;
>>     }
> 
> And I think we need it because we entire undefined terrority: we end up
> calling __memswap with identical pointers.

Fair enough, could you send a patch?


More information about the Libc-alpha mailing list