From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24382 invoked by alias); 26 Apr 2016 14:44:54 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 24353 invoked by uid 89); 26 Apr 2016 14:44:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=indication, his X-HELO: mail-yw0-f181.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=L/kNiE05ET16Edxomdh6i3BSQgA7iaea85gebOyNszI=; b=LGBW6j5UHc9NE96fx3A9bz9Jqs7hjqk5kFN8XdBxqP6prPbwDy4Gx+w5YKrMlotPOM b+77kjUtYZHDk+c2Lb0IbipADGvHg1eCUco4qINYKyo8Xp0AgoJ7NrJhnajdphf/nF0m nP2le6Fz3u5uYSyOTvHjbi/AM6yGzz2lqF7nf6PAj4p8NniRc3MNa9TKiF9QnghHauCS FR5+pmtBgsdB40a3afEz83ZLYzCSVGQYD22y4FrAMqOxQeIs6iiIXSrpiEVDaX/4gKFk yrtNY0ePfonpoTPwhKy+k6AnPgeRDW8WDJfP8fFN+R5GzErm9nNb5bfTGhzVufPTXM8U Ao1Q== X-Gm-Message-State: AOPr4FUbFwda9czfZ2TE2XLkVjzD8UqEYqQ5IbxFMwC44lFbwXhtxzg4mvi/knO6FAg9b+IU X-Received: by 10.13.207.5 with SMTP id r5mr1678501ywd.284.1461681880333; Tue, 26 Apr 2016 07:44:40 -0700 (PDT) Subject: Re: [PATCH] Don't divide by zero when trying to destroy an uninitialised barrier. To: Florian Weimer References: <5717B2F4.9050105@starleaf.com> <5717B657.6040007@arm.com> <5717D575.40806@starleaf.com> <5717DCA6.1090809@linaro.org> <571F7D5F.2080603@redhat.com> Cc: libc-alpha@sourceware.org From: Adhemerval Zanella Message-ID: <571F7ED0.9040001@linaro.org> Date: Tue, 26 Apr 2016 14:44:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <571F7D5F.2080603@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-04/txt/msg00653.txt.bz2 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. But thinking twice seems that abort in such cases seems a better alternative, it gives the user a more straightforward indication he should check his code.