[PATCH] Don't divide by zero when trying to destroy an uninitialised barrier.

Adhemerval Zanella adhemerval.zanella@linaro.org
Tue Apr 26 19:47:00 GMT 2016



On 26/04/2016 15:03, Torvald Riegel wrote:
> On Tue, 2016-04-26 at 11:44 -0300, Adhemerval Zanella wrote:
>>
>> On 26/04/2016 11:38, Florian Weimer wrote:
>>> On 04/20/2016 09:46 PM, Adhemerval Zanella wrote:
>>>> I do not see a compelling reason to not return EINVAL if the UB
>>>> could be detected and if POSIX stated this behaviour is recommended.
>>>
>>> It would result in silent loss of synchronization if the return value is not checked.  Such bugs are difficult to track down.
>>>
>>> Florian
>>
>> But the check is user responsibility and getting such error means the
>> program is doing something fuzzy.
> 
> EINVAL is not listed as an error code, so there is no user
> responsibility.
> 

Alright, so abort seems the best solution then.



More information about the Libc-alpha mailing list